-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
High specificity paragraph styles #8769
Comments
Thanks for a great ticket! Forgive me if I misunderstand you, and please correct me if that is the case. But as I understand it, the objection is to the highly specific The classic WordPress editor exists inside an iframe, which means you can have unscoped generic selectors for elements, and not worry about the CSS styles bleeding into the rest of the admin. Not the case here. The CSS is specific for two reasons:
There's a good argument for 1 being solved by the selector for the rest of the admin being more specific, but this should be an upstream ticket filed on trac, you're welcome to do that here: https://core.trac.wordpress.org/ 2 is necessary so as to prevent this from happening: ☝️ that's what a plain paragraph would look like if we removed the I would welcome a patch or code example, if you have ideas for how to address this! |
I completely agree with @inc2734 . Some of the styles of gutenberg leak into my components. One of this is the mentioned p element but also .wp-core-ui .button, .wp-core-ui .button-secondary leaks into my component. For the button components one should use a more specific class name in my opinion. |
CC: @youknowriad, will recent experiments help address this? |
I see ! understood. However, it seems that style is too strong for p. Because, If I removed the style related to p from
I understand that I don't know how the CSS of the Gutenberg plugin is made now, so I will investigate and try making a patch if I can do it. Thank you. |
I've been stymied by this as well. I have a custom block which allows setting a background and foreground color, and also contains an (I don't have a good solution in mind at the moment… definitely wishing the Shadow DOM was a bit better supported though!) |
That's exactly what my experiment is trying to resolve, it would force us to "rework" our styles a little bit (to use the same wrapper used for theme styles) but it should work. A more detailed comment here: |
Quoting myself from the Slack (relevant part bolded):
|
@designsimply I do think this is largely solved by #9008 and #10956. We can definitely re-open if something specific/actionable comes up! :) |
Thank you for the wonderful development.
I think that many themes basic text colo set to body. But, in the current editor style of Gutenberg, since the text color style is also applied to the paragraph, the editor and the actual page display different character colors.
This styles are written on
/build/edit-post/style.css
. I tryed dequee it. As a result, Not only the style of blocks and HTML elements, the style of the whole editor has disappeared.I propose that you should delete the style below or split it into HTML elements and other styles.
https://github.com/WordPress/gutenberg/blob/master/edit-post/components/visual-editor/style.scss#L7-L16
These problems also apply to line-hight and list margin.
How about that?
Thank you and regards.
The text was updated successfully, but these errors were encountered: