Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

add separate color options for icons in buttons

  • How do you change the icon color on a button that is different from the text button color?
    https://postimg.cc/DJcH6fpb

  • Hi there,

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

    You can use the private information field.

    Let me know πŸ™‚

  • How do you change the icon color on a button that is different from the text button color?
    https://postimg.cc/DJcH6fpb

  • Hi there,

    You can change the button icon color by clicking your button in the back-end and then in the right sidebar go to Block -> Advanced and inside the ADDITIONAL CSS CLASS(ES) field, add a custom class like, for example, custom-color.

    Then, you can add custom CSS code to alter the fill value, even for hover:

    /* CSS to change the fill color */
    .custom-color > .gb-icon > svg > path { 
      fill: red; /* Replace 'red' with your desired color */
    }
    
    /* CSS for hover effect */
    .custom-color:hover > .gb-icon > svg > path { 
      fill: blue; /* Replace 'blue' with the desired hover color */
    }

    Reference: https://docs.generatepress.com/article/adding-css/.

    Side note: There’s also feature request for this already. I’ll add a +1 for you so that it increases in priority of our Feature Request list.

    Let us know how it goes πŸ™‚ Thanks!

  • Thank you

  • Hi Francisco – Please upvote this feature from me too. Anytime you can move CSS like this to the editor makes sense – especially when using Global Styles.

    To link the color to the GP color palette, give this CSS a whirl. The variable color can be linked to whatever palette color desired, and it now has more global styling capabilities.

    /* CSS to change the fill color */
    .custom-color > .gb-icon > svg > path { 
      fill: var(--primary-accent); /* Replace 'primary-accent' with your desired palette color */
    }
    
    /* CSS for hover effect */
    .custom-color:hover > .gb-icon > svg > path { 
      fill: var(--secondary-accent); /* Replace 'secondary-accent' with your desired palette color */
    }

    Thanks,
    David

  • You’re welcome, jdroland! πŸ™‚

    Hi David, I’ve already added your +1 as well. Thank you! πŸ™‚

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