-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Block Editor Components: Add missing style resets for fieldset elements #70685
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 Components: Add missing style resets for fieldset elements #70685
Conversation
Does |
|
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. |
It sure does! I'm slightly ashamed to admit I didn't even think to try it in JS, I was too focused thinking about how CSS is enqueued 😄 I'll update the testing instructions 👍 |
|
Size Change: +190 B (+0.01%) Total Size: 1.89 MB
ℹ️ View Unchanged
|
| @@ -1,3 +1,10 @@ | |||
| fieldset.block-editor-block-variation-transforms { | |||
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.
Is there a reason this one needs to be prefixed with fieldset? I'm guessing the classname is applied to non-fieldset elements too?
Just wondering if we want to be careful to keep the specificity low on these resets.
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.
Oh, good question! Due to how the block-editor-block-variation-transforms classname is applied, it can be used in two different states for variation transforms, and we only want the fieldset state. I can give it a :where() to reduce the specificity back down.
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.
talldan
left a comment
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.
|
Thanks for the quick review! I'm nearly at the end of my week, so I'll finish off on Monday.
Yes, we'll probably want to do a separate pass on |
youknowriad
left a comment
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.
Thanks for fixing that.
I just reviewed the instances of |
…ts (#70685) * Block Editor Components: Add missing style resets for fieldset elements * Ensure specificity isn't too high Co-authored-by: andrewserong <[email protected]> Co-authored-by: talldan <[email protected]> Co-authored-by: youknowriad <[email protected]>


What?
Closes #70684
Add
fieldsetresets for a number of the block-editor components (those listed in #70684) that didn't already have them.Why?
Components in the components library appear to already be doing this, but a number in
block-editorweren't. Currently, the block editor components expect to be displayed within an admin context that includes CSS resets for thefieldsetelement. However, these components should be responsible for their own resets, similar to the components library.How?
I reviewed components in the
block-editorpackage to findfieldsetelements that didn't have resets, and then added them in. I think I've covered all the fieldsets with current usage in the block editor.Testing Instructions
Smoke test the following areas in the editor UI to make sure this doesn't break anything:
In normal usage, this PR should be identical to trunk. However if you want to test that these rules work, you can run the following in the browser console to remove
common.css:document.querySelector( 'link#common-css' ).remove().Screenshots or screencast
This is a pretty contrived before/after: