Site logo

[Support request] Using your own variables for global colors in generatePress

Home Forums Support [Support request] Using your own variables for global colors in generatePress

Home Forums Support Using your own variables for global colors in generatePress

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2080136
    Hans-Gerd

    Hi,
    I have defined my own variables for colors in additional CSS, e.g.

    :root {
         --hellgrau-color: rgba(217,217,217,1);
         --grau_1-color: rgba(190,190,190,1);
         --grau_2-color: rgba(204,204,204,1);
         --blau-color: rgba(11,48,67,1);
         --tuerkis-color: rgba(0,255,255,1);
    }

    However, if I want to use these variables in the Customizer at Global Colors, this is unfortunately not possible. Of course I can enter the color codes without any problems, but I would rather use the variables.
    Is there a way to do this or maybe even use a theme.json in the context (I know that theme.json is used first with block themes).
    I had already looked at the following post: https://generatepress.com/generatepress-3-1-global-colors-dynamic-typography/
    Thanks for advice.
    Best regards,
    Hans-Gerd

    #2080180
    David
    Staff
    Customer Support

    Hi there,

    you can use the generate_option_defaults filter to set default customizer options including the global_colors – see here for more info:

    https://generatepress.com/forums/topic/changing-global-colors-programatically/#post-1979258

    #2080496
    Hans-Gerd

    Hi David,
    thank you very much for the quick reply. I will check this and get back to you if necessary.
    Best regards,
    Hans-Gerd

    #2080964
    David
    Staff
    Customer Support

    You’re welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.