Open jeflopodev opened 1 year ago
Oh wait. At first I thought the global style was being used over an existing and a more specific block level style. But now I think that this is because there's no block level hover color styles being used/applied for core/query-pagination-next
and core/query-pagination-previous
blocks.
That's why it falls back to the value from styles.elements.link.:hover.color.text
I've added a video of the CSS selectors being used.
Description
Given the code below, the blocks
core/query-pagination-next
core/query-pagination-previous
should override the value ofstyles.elements.link.:hover.color.text
set to#00ff00
. Since these two blocks have block level definitions of that same style set to#ff0000
instead.Other blocks with links like
core/query-pagination-numbers
&core/paragraph
can override it, and work as expected (hovering with the color#ff0000
set). I've used them just to check.home.html & theme.json
```htmlMauris convallis lectus sit amet aliquet bibendum
``` ```json { "styles": { "elements": { "link": { ":hover": { "color": { "text": "#00ff00" } } } }, "blocks": { "core/paragraph": { "elements": { "link": { ":hover": { "color": { "text": "#ff0000" } } } } }, "core/query-pagination-next": { "elements": { "link": { ":hover": { "color": { "text": "#ff0000" } } } } }, "core/query-pagination-previous": { "elements": { "link": { ":hover": { "color": { "text": "#ff0000" } } } } }, "core/query-pagination-numbers": { "elements": { "link": { ":hover": { "color": { "text": "#ff0000" } } } } } } }, "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 2 } ```Step-by-step reproduction instructions
Settings > Reading
templates\home.html
template with thecore/query-navigation-next
&core/query-navigation-previous
blocksstyles.elements.link.:hover.color.text
,styles.blocks.core/query-navigation-next.elements.link.hover.color.text
&styles.blocks.core/query-navigation-previous.elements.link.hover.color.text
Screenshots, screen recording, code snippet
https://github.com/WordPress/gutenberg/assets/679512/18a49416-0a26-4914-a74e-0ef4537aaf15
These are the selectors used for every element while forcing :hover state in the DevTools:
https://github.com/WordPress/gutenberg/assets/679512/ec3d585b-4a16-4437-87f5-3584255db887
Environment info
simple
with the very minimal files needed to reproduce the bug. It's shown in the video.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