-
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
Shortcode: Prevent external styling of editing UI #49723
Conversation
border: $border-width solid $gray-900 !important; | ||
box-shadow: none !important; | ||
border-radius: $radius-block-ui !important; | ||
box-sizing: border-box; |
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.
Size Change: -391 B (0%) Total Size: 1.37 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.
It's unfortunate we need to use !important's, but it does seem the simplest way to protect from bleed, short of a massive shadow dom refactor. It's especially unfortunate that we have to replicate all those styles as is — it's likely to cause drift if, say, the default visual style for code inputs changes. Would a mixin make sense?
Giving preliminary approval still, since this fixes the issue and works as is.
While I'm here, I wonder if we should remove the "resize" property from the field. Since it's using an auto-expanding textarea you can't resize it vertically, only horizontally:
And as noted, it does auto resize, and scroll once the max height is reached:
So the resize only actually serves to let you break the appearance. What do you think?
Thanks for the feedback, @jasmussen! Yes, input styles reset would be great that we could use for different blocks. What would be the best place for a similar mixin? The "resizing" option comes from the |
It doesn't feel entirely systematized in a proper way, but for a few focus styles we've so far placed these in
Perhaps |
I checked, and that's how the post text editor disabled it. So that should work here as well :)
Sounds good. Should I land this and create a new PR that introduces the mixing and updates HTML and Shortcode blocks? |
Whichever you prefer! |
Flaky tests detected in 33d2fc3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4676308573
|
What?
Fixes #49482.
The input field for the Shortcode block isn't meant to be styled by themes.
How?
I borrowed a fix from #34727.
Testing Instructions
Screenshots or screencast
Before
After