-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
[Block] NavigationAffects the Navigation BlockAffects the Navigation Block[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
Likely a symptom similar to discussion at Core block styles are overriding theme.json styles in WordPress 6.6, the link and :hover styles for the Navigation block are being overridden by core block styles. This is a concerning trend, as this overriding is also happening at #62960 in addition to other blocks that have yet to be fixed (#62679 (comment)).
Here is the code from /wp-includes/blocks/navigation/style.min.css?ver=6.6-RC1 that is causing the override:
.wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content {
color: inherit;
}
Here is the code it is overriding:
:root :where(.wp-block-navigation a:where(:not(.wp-element-button))) {
color: var(--wp--preset--color--contrast);
}
Here is the code I have in the theme.json file seen below in the video
{
"styles": {
"blocks": {
"core/navigation": {
"elements": {
"link": {
"color": {
"text": "var(--wp--preset--color--contrast)"
},
":hover": {
"color": {
"text": "var(--wp--preset--color--primary)"
}
}
}
}
}
}
}
}
Step-by-step reproduction instructions
- Add code above into theme.json file.
- Hover links in Navigation block on front end.
- Witness theme.json style being overridden by core block style.
Screenshots, screen recording, code snippet
Screen.Recording.2024-06-28.at.9.09.52.PM.mp4
Environment info
WordPress 6.6 RC1
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No
germanfrelo
Metadata
Metadata
Assignees
Labels
[Block] NavigationAffects the Navigation BlockAffects the Navigation Block[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended