- This topic has 16 replies, 5 voices, and was last updated 1 year, 11 months ago by Tom.
-
AuthorPosts
-
October 6, 2022 at 4:36 am #2365042Gabriel
I have added button to a page and specified text and background color on it. For some strange reason the text color (.has-text-bright-color) only wins when logged in to WordPress. When not logged in the default style in GeneratePress (.inside-article a) wins.
Is this a bug or have I done something wrong? Added screenshots and login information to staging site in private information.
October 6, 2022 at 7:59 am #2365364DavidStaffCustomer SupportHi there,
does this only occur if the link has been visited ?
October 6, 2022 at 8:47 am #2365419GabrielNo, I don’t think so. It also occurs if I open the site in guest mode in Microsoft Edge, which means there is no history of visited links.
October 6, 2022 at 10:36 am #2365517GabrielNow I see that the color CSS property is the expected white when the button link is visited.
I found the following in block-library/style.min.css:
.wp-block-button__link:active, .wp-block-button__link:focus, .wp-block-button__link:hover, .wp-block-button__link:visited { color: #fff; }
Though this does not seem to be based on the .has-text-bright-color class from my settings in the editor. I don’t understand why the default link color is winning over the text color set in the editor.
October 6, 2022 at 1:44 pm #2365623GabrielIt seems that to get a border width when using the outlined button style I must add a background color in the editor, but if I do link color wins over button text color.
October 6, 2022 at 6:10 pm #2365741Fernando Customer SupportHi Gabriel,
What’s the login link to your site?
October 6, 2022 at 10:57 pm #2365856GabrielSorry. Forgot that. Added login link to private information.
October 6, 2022 at 11:45 pm #2365881Fernando Customer SupportThank you! One way to override the visited color is through adding this in Appearance > Customize > Additional CSS:
.wp-block-button__link:visited{ color: #ec008c; }
Another option is to use a GB Button Block and set the color through its Block settings.
October 6, 2022 at 11:49 pm #2365887GabrielI understand that is a workaround. But I wonder if this is a bug in GeneratePress. I think the look of the button should match that of in the editor.
October 6, 2022 at 11:59 pm #2365897GabrielI have updated a sandbox site (just WP and GP) that reproduces this issue, default colors overriding buttons colors set in the editor. See private information.
October 7, 2022 at 6:20 pm #2366695TomLead DeveloperLead DeveloperHi there,
I believe the issue here is that WordPress adds the
has-text-color
class to the core button if you’ve specified a text color.You’ve also added a global color to GeneratePress named
text
, which is generating thehas-text-color
variable with that color (black) after thebase-3
color you’ve specified for the button.The easiest fix here is to rename your
text
variable to something else.Let me know if you need more info ๐
October 10, 2022 at 12:26 am #2368387GabrielHi Tom,
I updated the page now so that there is no “text” color variable. At first that fixed the issue. But then I realized that I had no link color set in the customizer. After setting a link color in the customizer I have the same behaviour as in my OP. Link color wins on the button until the link is visited.
October 10, 2022 at 11:22 am #2369115YingStaffCustomer SupportHi Gabriel,
As you already use the GenerateBlocks plugin, why not use the GB Buttons block instead of the WP buttons block?
It should fix this issue.
Let me know!
October 10, 2022 at 11:54 pm #2369487GabrielI am sure that for fix it. At this point I see this thread as more of a bug report. Just want confirmation on whether this is something with core blocks that should work in GeneratePress, since it seems to work correctly in the editor, just not in the front end if the link is not visited.
@Tom If you can confirm that this is a bug, then I am happy to move this to a Github issue and close this topic, if you prefer.October 11, 2022 at 7:31 pm #2370530TomLead DeveloperLead DeveloperThis is a known issue which we can’t control, unfortunately. When you set a link color in the Customize > Colors > Content area, it creates CSS that is specific to the content area:
.inside-article a
This is more specific than the CSS WordPress sets for the core button:
.has-text-bright-color { color: #ffffff; }
The best thing to do here is to remove the Content Link color and use the link color in Customize > Colors > Body.
Hope this helps ๐
-
AuthorPosts
- You must be logged in to reply to this topic.