[wp-trac] [WordPress Trac] #64263: Backport: Add support for pseudo classes for the block and its variations on theme.json
WordPress Trac
noreply at wordpress.org
Tue Feb 10 15:19:58 UTC 2026
#64263: Backport: Add support for pseudo classes for the block and its variations
on theme.json
--------------------------------------+------------------------
Reporter: scruffian | Owner: scruffian
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 7.0
Component: Editor | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+------------------------
Changes (by scruffian):
* owner: (none) => scruffian
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"61607" 61607]:
{{{
#!CommitTicketReference repository="" revision="61607"
Editor: Add support for pseudo elements for the block and its variations
on theme.json.
Adds support for pseudo elements on the core/button block for ( ':hover',
':focus', ':focus-visible', ':active' ) at the theme.json level. This is
also allowing the block's variations to control the same pseudo elements,
so now we can style hover for the outline variation too.
Example usage:
{{{
"styles": {
"blocks": {
"core/button": {
"color": {
"background": "blue"
},
":hover": {
"color": {
"background": "green"
}
},
":focus": {
"color": {
"background": "purple"
}
},
"variations": {
"outline": {
":hover": {
"color": {
"background":
"pink"
}
}
}
}
}
}
}
}}}
Reviewed by palak678, getdave, MaggieCabrera.
Props MaggieCabrera, scruffian, palak678. joedolson, getdave, mikachan.
Fixes #64263.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64263#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list