Skip to content
Merged
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
25 changes: 0 additions & 25 deletions docs/how-to-guides/themes/global-settings-and-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -1149,31 +1149,6 @@ A breakpoint can also carry styles for a block's elements, including their pseud
@media (width <= 480px) { :root :where(.wp-block-group a:where(:not(.wp-element-button)):hover) { color: darkred; } }
```

An element does not need styles outside the breakpoint. Styling it only inside one is valid, and outputs a single rule inside the media query:

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

```css
@media (width <= 480px) { :root :where(.wp-block-group a:where(:not(.wp-element-button))) { color: red; } }
```

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

#### Variations
Expand Down
Loading