Commit 398a548
committed
Editor: Add support for text inputs to theme.json.
Adds support for text input elements to theme.json so that theme builders and extenders can be style text input elements consistently.
Text input elements are `textarea`, and `input` with type `email`, `number`, `password`, `search`, `text`, `tel` and `url`. We are targeting the HTML elements directly rather than adding a CSS class, as we do for other elements that theme.json supports. This commit adds no extra styling unless a theme opts in to use this and the specificity of any generated CSS with the element is 0.
See original Gutenberg PR: WordPress/gutenberg#70378.
Example usage:
{{{
"elements": {
"textInput": {
"border": {
"radius": "0",
"style": "solid",
"width": "1px",
"color": "red"
},
"color": {
"text": "var(--wp--preset--color--theme-2)"
},
"typography": {
"fontFamily": "var(--wp--preset--font-family--inter)"
}
}
}
}}}
Reviewed by mukesh27, scruffian.
Merges [9600] to the 6.9 branch.
Props onemaggie, mukesh27, sabernhardt, joen, get_dave, wildworks, ocean90, mikachan, poena.
Fixes #63878. See #63555.
Built from https://develop.svn.wordpress.org/trunk@61023
git-svn-id: https://core.svn.wordpress.org/trunk@60359 1a063a9b-81f0-0310-95a4-ce76da25c4cd1 parent bd521a6 commit 398a548
2 files changed
+14
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
613 | 613 | | |
614 | 614 | | |
615 | 615 | | |
| 616 | + | |
616 | 617 | | |
617 | 618 | | |
618 | 619 | | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
627 | 628 | | |
628 | | - | |
| 629 | + | |
629 | 630 | | |
630 | | - | |
631 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
632 | 634 | | |
633 | 635 | | |
634 | 636 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments