Site logo

[Support request] How to change background color for selected widgets

Home Forums Support [Support request] How to change background color for selected widgets

Home Forums Support How to change background color for selected widgets

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2415627
    Tawna

    How to change background color for selected widgets (not the entire sidebar)

    #2415715
    Leo
    Staff
    Customer Support

    Hi there,

    You would need to target the specific widget.

    Any chance you can link us to the page in question?

    You can use the private information field:
    https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    Let me know 🙂

    #2416314
    Tawna

    sent – I added it in the gray field below – can you see it?

    #2416716
    David
    Staff
    Customer Support

    Hi there,

    you will need some CSS.
    This for example:

    
    .left-sidebar .widget:nth-of-type(2) {
        background-color: #f00;
    }

    The nth-of-type(2) property will target the 2nd .widget in the left-sidebar

    You can repeat that CSS rule and change the 2 for anyone you like.

    And if you want to use one of your Customizer GLobal Colors then you can use a var like so:

    .left-sidebar .widget:nth-of-type(2) {
        background-color: var(--contrast);
    }

    Just swap the --contrast for your chosen global color variable name

    #2416869
    Tawna

    That worked perfectly – thank you

    #2417829
    David
    Staff
    Customer Support

    Glad to be of help!

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