-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Fields Components: Add missing style resets for fieldset elements #71217
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
Conversation
|
Size Change: +79 B (0%) Total Size: 1.92 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 4d67f5b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/16982532884
|
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 think you've formulated a good case for the change. The package shouldn't rely on the existence of a common.css but should work on their own, right?
| Before | After |
|---|---|
![]() |
![]() |
ignore any fonts or font-size changes as that's not in scope for this PR
What makes fieldsets special? Just asking. If a consumer is going to have to style the fields anyway... or are typography and other styles going to be added at a latef date?
Otherwise I think it makes sense. Fieldsets are one of those things that I've rarely seen left in their native state. 😄
|
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. |
Good question! As in Riad's review on one of the earlier PRs (#70700 (review)) this is more about consistency with how the components in |


What?
Add
fieldsetresets for the components in thefieldspackage that use thefieldsetelement. Essentially this will ensure we remove unexpected borders when fields are used in contexts that don't automatically reset these elements.This is a very similar PR to #70685, which included the same kinds of resets in the block editor package.
Why?
Components in the components library already do this, but those in
fieldsweren't — ideally, as in #70685, components should be responsible for their own CSS resets for things likefieldsetand not expect that the containing environment provides it for them.Right now this issue isn't apparent in Gutenberg, because we currently depend on
common.css, but ideally we shouldn't really depend on that.How?
fieldspackage and add missing style resets for thefieldsetelementsstyle.scssfile in order to include the reset, add one of those, tooTesting Instructions
Testing this will be slightly artificial as things work correctly in Gutenberg already. However, we can approximate how things might look without
common.cssby opening the browser console and entering the following:In order to test the affected fields, you'll also need to enable the Quick Edit experiment in order to access the quick edit panel / sidebar within the site editor's view of Pages:
Testing steps
Note: this PR only adjusts
fieldsetresets, so that's all we're focusing on right now — as you're testing, ignore any fonts or font-size changes as that's not in scope for this PR (in general on previous PRs it was considered not to worry about fonts at this stage).Add Template Part modal (note border around "area")
document.querySelector( 'link#common-css' ).remove()to hide the common.css resetsFields used in Quick Edit for Pages
document.querySelector( 'link#common-css' ).remove()to hide the common.css resetsThis is the area we're checking: