Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f3ec1e2
Try responsive global block styles with states
tellthemachines Apr 21, 2026
7a887ff
rules for specific selectors
tellthemachines Apr 22, 2026
2817ed4
responsive custom CSS support
tellthemachines Apr 22, 2026
a97f742
styles for block elements
tellthemachines Apr 23, 2026
64d4cac
account for block gap
tellthemachines Apr 23, 2026
4c321f2
improve hover style output
tellthemachines Apr 23, 2026
4a4d6a6
fix duplicate selector styles
tellthemachines Apr 23, 2026
208b381
add docs
tellthemachines Apr 23, 2026
272e57b
add unit test for new function
tellthemachines Apr 23, 2026
656996e
Clean up and add tests
tellthemachines Apr 23, 2026
9a6730e
simplify metadata
tellthemachines Apr 24, 2026
65ecacb
fix feature element and style variation combo
tellthemachines Apr 24, 2026
03610a1
Hide settings that don't change per breakpoint
tellthemachines Apr 28, 2026
a02cbec
support setting both pseudo states and viewports
tellthemachines Apr 29, 2026
fedc688
update failing e2e
tellthemachines Apr 30, 2026
cbfb314
hide filters panel on tablet and mobile
tellthemachines Apr 30, 2026
a6318bc
Add badges to show active states
tellthemachines May 1, 2026
c852725
update comments
tellthemachines May 1, 2026
c919c21
Responsive global styles: use responsive nodes (#77881)
talldan May 4, 2026
26763ed
don't close on setting pseudo state
tellthemachines May 5, 2026
2ca0590
try moving popover
tellthemachines May 5, 2026
2a1a854
update button name in test
tellthemachines May 5, 2026
b6aa414
backport changelog
tellthemachines May 5, 2026
18d74e9
Fix pseudo responsive styles not working unless default styles exist
tellthemachines May 5, 2026
35ff5e6
simplify states checks
tellthemachines May 5, 2026
b35c0f5
remove selector variation fix
tellthemachines May 5, 2026
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
3 changes: 3 additions & 0 deletions backport-changelog/7.1/11706.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/11706

* https://github.com/WordPress/gutenberg/pull/77513
77 changes: 77 additions & 0 deletions docs/how-to-guides/themes/global-settings-and-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,83 @@ Pseudo selectors `:hover`, `:focus`, `:focus-visible`, `:visited`, `:active`, `:
}
```

#### Responsive styles

Block styles can be scoped to two named breakpoints: `mobile` and `tablet`. Any style property that is valid at the block or element level can be nested under one of these keys.

| Key | Media query applied |
| --- | --- |
| `mobile` | `@media (width <= 480px)` |
| `tablet` | `@media (480px < width <= 782px)` |

Responsive overrides can be placed directly on a block node:

```json
{
"version": 3,
"styles": {
"blocks": {
"core/group": {
"color": {
"text": "black"
},
"mobile": {
"color": {
"text": "hotpink"
}
}
}
}
}
}
```

```css
:root :where(.wp-block-group) { color: black; }
@media (width <= 480px) { :root :where(.wp-block-group) { color: hotpink; } }
```

They can also be placed on element nodes within a block:

```json
{
"version": 3,
"styles": {
"blocks": {
"core/group": {
"elements": {
"link": {
"color": { "text": "blue" },
":hover": {
"color": { "text": "navy" }
}
}
},
"mobile": {
"elements": {
"link": {
"color": { "text": "red" },
":hover": {
"color": { "text": "darkred" }
}
}
}
}
}
}
}
}
```

```css
:root :where(.wp-block-group a) { color: blue; }
@media (width <= 480px) { :root :where(.wp-block-group a) { color: red; } }
:root :where(.wp-block-group a:hover) { color: navy; }
@media (width <= 480px) { :root :where(.wp-block-group a:hover) { color: darkred; } }
```

Responsive overrides are always output after the default styles they override, so the cascade order is preserved without needing to increase specificity.

#### Variations

A block can have a "style variation," as defined in the [block.json specification](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/#styles-optional). Theme authors can define the style attributes for an existing style variation using the `theme.json` file. Styles for unregistered style variations will be ignored.
Expand Down
Loading
Loading