Make WordPress Core

Opened 4 weeks ago

Last modified 4 weeks ago

#65880 new enhancement

Global Styles: Add pseudo-selector support for text inputs

Reported by: onemaggie Owned by:
Priority: normal Milestone: 7.2
Component: Editor Version: 7.1
Severity: normal Keywords: has-patch gutenberg-merge
Cc: Focuses:

Description

Global Styles supports styling text inputs through theme.json, but it does not currently support the pseudo-classes and pseudo-element needed for common form states.

The Gutenberg implementation adds support for:

  • :required
  • :valid
  • :invalid
  • :focus
  • :focus-visible
  • ::placeholder

Pseudo-elements such as ::placeholder are output outside the :where() wrapper because pseudo-elements are not valid inside it.

Gutenberg PR: https://github.com/WordPress/gutenberg/pull/71634

This ticket tracks the WordPress Core backport for 7.2.

Change History (2)

This ticket was mentioned in PR #13056 on WordPress/wordpress-develop by @onemaggie.


4 weeks ago
#1

  • Keywords has-patch added; needs-patch removed

Backports the WP_Theme_JSON changes from Gutenberg PR #71634.

This adds :required, :valid, :invalid, :focus, :focus-visible, and ::placeholder support for the textInput element. Pseudo-elements are output without the :where() wrapper because pseudo-elements are not valid inside it.

## Testing

  • php -l src/wp-includes/class-wp-theme-json.php
  • vendor/bin/phpcs src/wp-includes/class-wp-theme-json.php

## Use of AI Tools

AI assistance: Yes
Tool(s): OpenAI Codex
Model(s): GPT-5
Used for: Translating the Gutenberg change to its WordPress Core counterpart, running validation, and drafting the pull request.

#2 @wildworks
4 weeks ago

  • Keywords gutenberg-merge added
Note: See TracTickets for help on using tickets.