-
Notifications
You must be signed in to change notification settings - Fork 4k
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
CSS rules for links in the editor are too specific #59782
Comments
Thanks for the report.
I couldn't find such a selector in the Gutenberg project. Also, for example, if I define a link color in a group block, the CSS selector will be as follows (Tested on WP6.4.3):
Is there a way to reproduce that selector? |
Thanks for your feedback. That selector is copied from the developer tools inspector, from any link in the editor. |
Maybe it's due to another library? I found the issue below. |
Thanks for taking the time to submit this issue @markhowellsmead 👍 I'd like to second @t-hamano's comments here. There are no references to any of the On the Gutenberg and WP Core side of things, link colors are applied in the following manner: Within the editor, the selector used to apply link colors is As this is an issue with a plugin rather than Gutenberg specifically, I'll close this GitHub issue. |
There are no references to any of the a:not clauses from the reported selector within Gutenberg or WordPress core. It stems from the postcss-editor-style plugin here <https://github.com/m-e-h/postcss-editor-styles/blob/master/index.js#L37>.
Thanks for looking into this so thoroughly. You’re right, the additional clauses are being added by PostCSS. I’ve used the reference at https://github.com/m-e-h/postcss-editor-styles/blob/master/index.js#L36 to amend our build process: by removing the `tagSuffix` in the config, only the Block Editor rules are added.
|
Description
The rules which apply link colours in the editor are too specific and cannot easily be overridden.
The specificity of
.editor-styles-wrapper a:not([class^=components-]):not([class^=editor-]):not([class^=block-]):not([aria-owns]):not([id^=mceu_])
is 0,6,1.The rule
.editor-styles-wrapper .wp-block-sht-author-list__author-name-link
(from a custom block) cannot override it, because the specificity is 0,2,0.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
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
The text was updated successfully, but these errors were encountered: