-
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
Iframe: skip scoping styles #46752
Iframe: skip scoping styles #46752
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
// We use :where to keep specificity minimal. | ||
// https://css-tricks.com/almanac/selectors/w/where/ | ||
html :where(.editor-styles-wrapper) { | ||
:where(.editor-styles-wrapper) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you think the changes in this "reset" file might impact non-framed editors? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changing this line has created a regression within the iframe when using some classic themes. |
||
/** | ||
* The following styles revert to the browser defaults overriding the WPAdmin styles. | ||
* This is only needed while the block editor is not being loaded in an iframe. | ||
|
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.
@ntsekouras This isn't a good solution because now this rule has a higher specificity than a theme just using the
body
selector. Also, if a theme sets it onhtml
, it won't be visible. We need to set the white background on theiframe
element so that it's not transparent. I fixed that below.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.
In this brunch this issue #46291 doesn't work though since we're scaling the
body
of the iframe and this is where the background is applied from theme.json. Any ideas to work around that?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.
Ah the scaling... I just talked to Riad about that the other day. I think we should moved the scaling outside the iframe. I'll make a separate PR for that then first.
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.
Would love to see this fix merged! It's breaking a lot of themes in our deployment of Gutenberg, so we've had to remove this line of CSS from our deployment. It seems like load order of CSS (for example, if CSS is concatenated) can break this.
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.
Ah nice, @fullofcaffeine found that this PR fixes the issue: #46732