-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Global styles: add element support for text related inputs #70378
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: -650 B (-0.04%) Total Size: 1.85 MB
ℹ️ View Unchanged
|
Please don't forget to submit a core backports PR and add a changelog entry to this PR. See https://github.com/WordPress/gutenberg/blob/trunk/backport-changelog/readme.md |
yes, it was my plan as soon as I had technical feedback on the approach, thanks for the reminder! |
94a9a09
to
2c75a53
Compare
I need to update the description of the PR but after a long discussion with @mtias about what the best way forward we think it's best if we don't add an extra class we need to commit to maintaining in the future. Targeting the inputs directly instead is very similar to what we are already doing, if you look at the file changes of this PR, we are just moving the styles from stylesheets to theme.json, and the specificity stays the same, but we are adding the benefit of consistency between blocks (should we want to!) both core ones and third party ones. A few screenshots of my test site with and without the theme.json changes pointed in the description:
|
As commented on the closed PR, I am still concerned that not all text inputs needs the same styling. |
I think those can still be targeted specifically, the same way it happens with heading. If you check the implementation on lib/theme.json you can see that I've done just that. The idea/goal is that we get the form block out of the experiment (when they are ready) so 3rd party blocks can just extend them, and if a specific block needs a different style, we just use the cascade. I think elements should be an abstraction, so it wouldn't make sense to make an element specifically for the textarea, I think it's better to override the styles that don't work for it |
…l form block, updated the schema too
d68d688
to
8578ef0
Compare
What?
Part of #34198
This PR adds a new class that can be used by themers and extenders to style text based input elements. This PR also updates the experimental form block to implement this.
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 adding a new class
wp-element-text-input
the same way we do for the button element. We are also adding said class to the relevant inputs on the form block.Testing Instructions
If this PR gets merged we should probably follow up and update the comments block to implement the class too.
/cc @WordPress/block-themers