-
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
Appender: fix outside canvas styles #66630
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
Seems to work for me, though I'd appreciate a gut-check from @stokesman.
Size Change: +14 B (0%) Total Size: 1.81 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.
I tested and confirm it works. The change makes sense. Thank you for the quick fix!
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 just noticed a regression on trunk with the position of the appender on an empty document, that appears to be introduced here. I've added a couple of comments in case that helps figure out what the right fix would be!
.block-editor-default-block-appender .block-editor-inserter { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
line-height: 0; | ||
|
||
&:disabled { | ||
display: none; | ||
} | ||
} |
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.
// The black plus that shows up on the right side of an empty paragraph block, | ||
// or the initial appender that exists only on empty documents. | ||
.block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter { |
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.
the initial appender that exists only on empty documents.
In an empty document the classnames in use for the default appender appear to be .block-editor-default-block-appender .block-editor-inserter
. Was that rule removed intentionally when moving to this separate file?
Also, it looks like the markup for the default block appender is rendered inside the iframe rather than outside it — so we might still need that rule in content.scss
, unless there's another way to go about this. Here's where the default appender lives:
gutenberg/packages/block-editor/src/components/default-block-appender/index.js
Lines 94 to 99 in f699d2b
<Inserter | |
rootClientId={ rootClientId } | |
position="bottom right" | |
isAppender | |
__experimentalIsQuick | |
/> |
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: stokesman <presstoke@git.wordpress.org>
What?
A misplaced CSS rule was uncovered by #66432 (comment).
Currently, the CSS rule that targets the empty-paragraph inserter is placed in the block editor's
content.css
file rather than itsstyle.css
, even though the empty-paragraph inserter is a popover that is rendered outside the canvas. Only block list appenders are rendered inside the canvas.This was not an issue before #66432, because we were rendering all the content styles outside the iframe too!
Why?
Fixes #66432 (comment).
How?
Move the rule that targets the popover to the appropriate stylesheet.
Testing Instructions
The change in #66432 only affects the Site Editor.
Testing Instructions for Keyboard
Screenshots or screencast