-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Global styles: add support for select or dropdown elements #70379
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
base: trunk
Are you sure you want to change the base?
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. |
Size Change: +8 B (0%) Total Size: 1.85 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.
Please don't forget to submit a core backports PR and add a changelog entry to this PR before merging. See https://github.com/WordPress/gutenberg/blob/trunk/backport-changelog/readme.md |
I wonder if we should rename the element to dropdown? does it make more sense? |
I guess a dropdown might also refer to an expanding menu, a bit like the nav block has, not only the form |
makes sense |
I'd prefer it to be named after the specific element ( |
Flaky tests detected in 14276a1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/15579855352
|
I made the same change here as I did on the textInput PR |
4297a8a
to
0fd96a4
Compare
What?
Part of #34198
This PR adds a new class that can be used by themers and extenders to style selects or dropdown elements. Right now the experimental form block doesn't have dropdowns in it, but many extenders do, so I wanted to cover them too in line with the work being done at #70378
Why?
So a theme can style consistently how forms should look like regardless of the plugins installed (if they opt in this new API)
How?
We are targeting the select HTML element instead of adding a class, more context in this comment about the reasoning. In any case, this PR adds no extra styling unless a theme opts in to use this and the specificity of any generated CSS with the element would be 0.
Testing Instructions
This one is a little hard to test without having a native block that has a dropdown in it that doesn't overly style it. What I did was: