-
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
Block editor: separate content styles for the iframe #44298
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
packages/block-editor/src/components/block-draggable/content.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// This creates a "slot" where the block you're dragging appeared. | ||
// We use !important as one of the rules are meant to be overriden. | ||
.block-editor-block-list__layout .is-dragging { | ||
background-color: currentColor !important; | ||
opacity: 0.05 !important; | ||
border-radius: $radius-block-ui !important; | ||
|
||
// Disabling pointer events during the drag event is necessary, | ||
// lest the block might affect your drag operation. | ||
pointer-events: none !important; | ||
|
||
// Hide the multi selection indicator when dragging. | ||
&::selection { | ||
background: transparent !important; | ||
} | ||
|
||
&::after { | ||
content: none !important; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
packages/block-editor/src/components/block-preview/content.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Hide inserter from previews. | ||
.block-editor-block-preview__content-iframe .block-list-appender { | ||
display: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 42 additions & 0 deletions
42
packages/block-editor/src/components/rich-text/content.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.rich-text { | ||
[data-rich-text-placeholder] { | ||
pointer-events: none; | ||
} | ||
|
||
[data-rich-text-placeholder]::after { | ||
content: attr(data-rich-text-placeholder); | ||
// Use opacity to work in various editor styles. | ||
// We don't specify the color here, because blocks or editor styles might provide their own. | ||
opacity: 0.62; | ||
} | ||
|
||
&:focus { | ||
// Removes outline added by the browser. | ||
outline: none; | ||
|
||
[data-rich-text-format-boundary] { | ||
border-radius: 2px; | ||
} | ||
} | ||
} | ||
|
||
.block-editor-rich-text__editable { | ||
> p:first-child { | ||
margin-top: 0; | ||
} | ||
} | ||
|
||
// Captions may have lighter (gray) text, or be shown on a range of different background luminosites. | ||
// To ensure legibility, we increase the default placeholder opacity to ensure contrast. | ||
figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before { | ||
opacity: 0.8; | ||
} | ||
|
||
[data-rich-text-script] { | ||
display: inline; | ||
|
||
&::before { | ||
content: "</>"; | ||
background: rgb(255, 255, 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@import "./components/block-list/content.scss"; | ||
@import "./components/block-list-appender/content.scss"; | ||
@import "./components/block-content-overlay/content.scss"; | ||
@import "./components/block-draggable/content.scss"; | ||
@import "./components/block-preview/content.scss"; | ||
@import "./components/default-block-appender/content.scss"; | ||
@import "./components/inner-blocks/content.scss"; | ||
@import "./components/media-placeholder/content.scss"; | ||
@import "./components/plain-text/content.scss"; | ||
@import "./components/rich-text/content.scss"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,5 @@ | |
"customClassName": false, | ||
"html": false, | ||
"inserter": false | ||
}, | ||
"editorStyle": "wp-block-editor" | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@ellatrix We think that this code is causing a fatal error in WordPress 6.0 with the latest version of the Gutenberg plugin. 🤔
Since these
block_type->style_handles
, etc. properties were added in WordPress 6.1, this code becomesarray_merge( $style_handles, NULL, NULL )
, which throws a warning in PHP <8, but a fatal error in PHP 8.I have a fix here: #46488, which just checks for null values, but just a heads up in case further work is needed to support 6.0 here