Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/how-to-guides/themes/global-settings-and-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,12 @@
* @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' ),

Check warning on line 596 in lib/class-wp-theme-json-gutenberg.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Array double arrow not aligned correctly; expected 6 space(s) between "'link'" and double arrow, but found 3.
'button' => array( ':link', ':any-link', ':visited', ':hover', ':focus', ':focus-visible', ':active' ),

Check warning on line 597 in lib/class-wp-theme-json-gutenberg.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Array double arrow not aligned correctly; expected 4 space(s) between "'button'" and double arrow, but found 1.
'textInput' => array( ':hover', ':focus', ':focus-visible', '::placeholder' ),
);

/**
Expand Down
6 changes: 5 additions & 1 deletion schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,9 @@
},
":visited": {
"$ref": "#/definitions/stylesPropertiesComplete"
},
"::placeholder": {
"$ref": "#/definitions/stylesPropertiesComplete"
}
}
},
Expand Down Expand Up @@ -1816,7 +1819,8 @@
":focus-visible",
":hover",
":link",
":visited"
":visited",
"::placeholder"
]
},
"stylesElementsPropertiesComplete": {
Expand Down
Loading