WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.55k stars 4.22k forks source link

Post terms color in theme.json ignored if element link color is set #66651

Open bradhogan opened 3 weeks ago

bradhogan commented 3 weeks ago

Description

The core/post-terms color is being overwritten by the element link.

Step-by-step reproduction instructions

In your theme.json, add:

"styles": {
    "elements": {
        "link": {
            "color": {
                "text": "var(--wp--preset--color--contrast)"
            }
        }
    }
    "blocks": {
        "core/post-terms": {
            "color": {
                "text": "var(--wp--preset--color--accent)"
            }
        }
    }
}

Swap out the variables to whatever your theme uses.

Add a post terms block and notice the terms as links use the element link color and not the block core/post-terms color.

Screenshots, screen recording, code snippet

No response

Environment info

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

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

Please confirm which theme type you used for testing.

carolinan commented 3 weeks ago

I think this may be true for any block that is a link by default (Except maybe the navigation blocks).