Skip to content

Commit 2bc0982

Browse files
committed
Editor: Add support for select elements to theme.json.
Adds support for the select element in theme.json so that theme builders and extenders can be style select elements consistently. We are targeting the select HTML element 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#70379. Example usage: {{{ "elements": { "select": { "color": { "text": "red", "background": "blue" } } } }}} Props onemaggie, joen, get_dave, wildworks, ocean90, mikachan, poena, SirLouen, tusharbharti, yashjawale, abcd95. Fixes #63555. See #63878. git-svn-id: https://develop.svn.wordpress.org/trunk@61031 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a6e2d81 commit 2bc0982

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/wp-includes/class-wp-theme-json.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ class WP_Theme_JSON {
629629
// The block classes are necessary to target older content that won't use the new class names.
630630
'caption' => '.wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption',
631631
'cite' => 'cite',
632+
'select' => 'select',
632633
);
633634

634635
const __EXPERIMENTAL_ELEMENT_CLASS_NAMES = array(

0 commit comments

Comments
 (0)