Skip to content
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

Merged
merged 1 commit into from
Jul 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions packages/widgets/src/blocks/legacy-widget/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Copy link
Contributor

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).

Copy link
Contributor Author

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.

&,
& h3,
& p {
font-family: $default-font;
font-size: $default-font-size;
}

background: $gray-100;
font-family: $default-font;
font-size: $default-font-size;
padding: $grid-unit-10 $grid-unit-15;

h3 {
Expand Down