diff --git a/docs/how-to-guides/themes/global-settings-and-styles.md b/docs/how-to-guides/themes/global-settings-and-styles.md index b8237ab3dc51a2..19e03c7280dee3 100644 --- a/docs/how-to-guides/themes/global-settings-and-styles.md +++ b/docs/how-to-guides/themes/global-settings-and-styles.md @@ -1036,7 +1036,7 @@ h3 { {% end %} ##### Element pseudo selectors -Pseudo selectors `:hover`, `:focus`, `:focus-visible`, `:visited`, `:active`, `:link`, `:any-link` are supported by Gutenberg. +Pseudo selectors `:hover`, `:focus`, `:focus-visible`, `:visited`, `:active`, `:link`, `:any-link`, `:placeholder` are supported by Gutenberg. ```json "elements": { diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index febaadd441e062..4f8c3a50668cf8 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -590,10 +590,12 @@ class WP_Theme_JSON_Gutenberg { * @since 6.1.0 * @since 6.2.0 Added support for `:link` and `:any-link`. * @since 6.8.0 Added support for `:focus-visible`. + * @since #.#.# Added support for `::placeholder`. */ const VALID_ELEMENT_PSEUDO_SELECTORS = array( 'link' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':focus-visible', ':active' ), 'button' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':focus-visible', ':active' ), + 'textInput' => array( ':hover', ':focus', ':focus-visible', '::placeholder' ), ); /** diff --git a/schemas/json/theme.json b/schemas/json/theme.json index 026313e2379a1b..04d2b712f7e67f 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -1788,6 +1788,9 @@ }, ":visited": { "$ref": "#/definitions/stylesPropertiesComplete" + }, + "::placeholder": { + "$ref": "#/definitions/stylesPropertiesComplete" } } }, @@ -1816,7 +1819,8 @@ ":focus-visible", ":hover", ":link", - ":visited" + ":visited", + "::placeholder" ] }, "stylesElementsPropertiesComplete": {