-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Increase specificity of the NoPreview CSS rules to avoid conflicts with theme styles #33200
Conversation
Size Change: +38 B (0%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚢
@@ -114,10 +114,15 @@ | |||
width: 100%; | |||
} | |||
|
|||
.wp-block-legacy-widget__edit-no-preview { | |||
.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview.wp-block-legacy-widget__edit-no-preview { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have seen this pattern more and more often :) Repeating classname syndrome. I guess it's the only way? (At least this is the constant answer).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like it either, but unfortunately it seems so – it's just the charm of applying theme styles in an environment where we have a bunch of other stylesheets already. Maybe some planning and a major refactor of how we work with the styles would spare us doing this in the future (maybe), but I can't see a simple solution.
Description
When the
use theme styles
option is enabled, legacy widget block styles are getting overridden by the theme styles. In particular, one offending CSS rule is.editor-styles-wrapper p
. As a result, the "preview unavailable" component ends up looking like this:This PR tweaks the selector specificity, which makes for a final effect like this:
How has this been tested?
Types of changes
Bug fix (non-breaking change which fixes an issue)