Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation Link Block Color is overriden by block CSS #57499

Closed
adarshakshatPosimyth opened this issue Jan 3, 2024 · 5 comments
Closed

Navigation Link Block Color is overriden by block CSS #57499

adarshakshatPosimyth opened this issue Jan 3, 2024 · 5 comments
Labels
[Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended

Comments

@adarshakshatPosimyth
Copy link

Description

Even though color for Hover and text is provided in theme.json
"core/navigation": { "spacing": { "blockGap": "0.5rem" }, "elements": { "link": { "typography": { "textDecoration": "none" }, "color": { "text": "var(--wp--preset--color--on-surface)" }, ":hover": { "color": { "text": "var(--wp--preset--color--on-surface-variant)" }, "typography": { "textDecoration": "underline" } } } }
The Hover State color is overriden by Css Rule from wp-includes/blocks/navigation/style.min.css
Normal State
Screenshot 2024-01-03 at 1 37 21 PM
On Hover State
Screenshot 2024-01-03 at 1 39 46 PM

Step-by-step reproduction instructions

  1. Create a Block Theme and mention the navigation link rule for hover and normal state
  2. Add a link to Navigation block in post/page
  3. View the link in front end and hover over it . Notice Color doesn't change

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@adarshakshatPosimyth adarshakshatPosimyth added the [Type] Bug An existing feature does not function as intended label Jan 3, 2024
@jordesign jordesign added Needs Testing Needs further testing to be confirmed. [Block] Navigation Affects the Navigation Block labels Jan 4, 2024
@carolinan
Copy link
Contributor

The navigation block links are specific blocks. What I means is that the actual link is not in the block called "core-navigation" but on the inner blocks like the core/navigation-link, core/page-list and so on.
So try to move the link styles to those blocks.

@carolinan carolinan removed the Needs Testing Needs further testing to be confirmed. label Jan 8, 2024
@carolinan
Copy link
Contributor

I am removing the needs testing label because I can confirm that this style in theme.json does not work.

It might not be a true "bug", it might be intended?, but it does not work like developers expect it to, and it would be much easier if the style could just be added to core/navigation.

@adarshakshatPosimyth
Copy link
Author

Apologies for the delay, I tried targetting page-list and it was of no help.

Screenshot 2024-01-20 at 12 17 46 AM

Here's the theme.json

"core/page-list": { "spacing": { "blockGap": "0.5rem" }, "elements": { "link": { "color": { "text": "var(--wp--preset--color--on-surface)" }, ":hover": { "color": { "text": "var(--wp--preset--color--on-surface-variant)" }, "typography": { "textDecoration": "underline" } } } } },

@gaambo
Copy link
Contributor

gaambo commented Mar 25, 2024

#47431 seems to be related. I commented a summary there. Should these issue be merged?

@talldan
Copy link
Contributor

talldan commented Jul 1, 2024

Thanks @gaambo, a bit late, but I'll close this issue as a duplicate of the original you mentioned.

@talldan talldan closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended
5 participants