Repository navigation
Commit 7bb013f
Global Styles: List elements alongside blocks (#81645)
* Global Styles: Add Forms section
* Global Styles: Add Elements section
* Global Styles: Give elements their own home and the full control set
Blocks and elements are listed together under one item in the main Styles
menu, so there is a single place to style anything on the site. Inputs,
selects and buttons are grouped under Form controls.
Elements now offer the background, spacing, border, shadow and custom CSS
controls that theme.json already accepts and the styles engine already
emits, instead of typography and colour alone. Sizing, block gap, text
alignment and duotone stay out: the first three belong to the block that
contains an element, and the engine emits nothing for the last two.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Global Styles: Preview elements with the site's own styles
An element was previewed as a letter specimen built from a handful of
properties copied across by hand, so it could not react to the border,
shadow, spacing or background controls elements now have.
Each element is previewed instead as a sample of the markup its selector
applies to, rendered in the editor iframe with the generated stylesheet.
The sample picks up the cascade, the theme's fonts and every panel without
a list of properties to keep in sync.
Text color and background color are left to the Typography and Background
panels, where they were relocated in #77279, rather than shown a second
time in a Colors panel.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Global Styles: List elements in one flat list with blocks
Elements sit in the same list as blocks under Elements, Headings and Form
controls subheadings, with no drilldowns between them, so everything that
can be styled is one screen away and easy to find alongside blocks. Each
heading level is its own row, and the button element is labelled to tell
it apart from the Button block further down the list.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Global Styles: Resolve an element's styles once per screen
The typography panel had its own wrapper that read the element's styles and
settings a second time, separately from the panels beside it. One component
now resolves them and renders every panel.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Global Styles: Share border handling and the CSS capability check
The block and element screens each carried their own copy of the border
reconciliation and of the check for whether custom CSS may be edited. Both
now use one shared version.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Global Styles: Restore the Text and All headings entries and fix CI
Bring back the root Text screen under Typography, which the style
variations tests depend on, and list "All headings" at the top of the
Headings group so the shared `elements.heading` node themes style can
still be edited. Update the unit expectations for the widened element
supports, the e2e labels for the renamed "Blocks & Elements" screen,
and add the PR links the changelog check requires.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Global Styles: Reformat for the wp-prettier upgrade on trunk
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Icons: Move the formInput changelog entry to Unreleased
The rebase left the entry under the published 17.0.0 section, which
fails the changelog checks. Also restore the formatting of an older
entry the branch had touched without reason.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Mention elements in the Blocks & Elements description
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Blocks: Keep text alignment for elements in Global Styles
Text alignment was added to elements in #73854, and the element
screens should keep offering it alongside the new panels.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Offer states on the link and button element screens
Moving the element colors out of the Colors screen dropped the only
control for link hover color. The link and button element screens
now offer the states the package already defines for them, and follow
the setting that turns off state editing for blocks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Show the default background size on element screens
An element's background image with no size renders with cover, as a
block's does, so the element screens now show the same defaults as
the block screen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Use one route for the element screens
The block list's elements now open through a single path with the
element name as a parameter, instead of one route per element.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Share element titles between the list and their screens
The Blocks & Elements list now reads each element's label from the
element screen's table, so the two cannot drift apart. The Button
element's screen is titled "Button (element)" to match its row and
tell it apart from the Button block.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Restore trunk's formatting of a media query
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Drop the deprecated spacer from the element screen
The preview's own class now sets its side margin, and no longer
shrinks inside the screen's scrolling flex column. This removes the
element screen's use-recommended-components suppression.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Keep trunk's Text row under Typography
Restore trunk's Typography element list with only the Text row, instead
of rebuilding it inline. The row keeps its sample in the site's font,
and the other elements stay in the Blocks & Elements list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Move this PR's changelog entries back under Unreleased
Trunk published new releases, so the rebase left the entries under
published versions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Drop the custom styles dot from element rows
Trunk removed the dot from block rows in #84657. Element rows follow,
and the customized filter keeps working for both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Keep the border helper in the block screen
Trunk's fallback helpers stay where they were, and the border
handling the element screen shares becomes an exported function next
to them, instead of a new file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Inline the customized check for elements
The element list calls the existing value check directly instead of
a separate exported wrapper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Check that searching lists matching elements
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Style Book: Show the Text category on element screens
Element screens moved under the Blocks & Elements path, so the Style
Book showed every block for them instead of the Text category it
showed when they lived under Typography.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: Match element names and group titles in search
Searching "h1" now finds Heading 1, and "form" lists the form
controls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Fix the formatting of the heading styles end-to-end test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Update the ESLint suppressions after rebasing on trunk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Blocks: Leave the layout widths out of element styles
Elements started from the root supports, so they kept contentSize and
wideSize. The element screen never renders the width controls, but the
Dimensions panel still counted them and showed up empty on themes that
set layout widths without padding or margin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Global Styles: List elements without icons
Whether elements need icons is still open in #84074, so start without
them and drop the formInput icon this PR added to @wordpress/icons.
Also restore the icons changelog line this PR reformatted by accident.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Update packages/editor/src/components/global-styles/block-link.js
Co-authored-by: Sarah Norris <1645628+mikachan@users.noreply.github.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Sarah Norris <1645628+mikachan@users.noreply.github.com>1 parent 2a96cb2 commit 7bb013f
26 files changed
Lines changed: 790 additions & 503 deletions
File tree
- packages
- blocks/src/store
- test
- editor/src/components
- global-styles
- style-book
- global-styles-ui
- src
- test/e2e/specs/site-editor
- tools/eslint
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
59 | 86 | | |
60 | 87 | | |
61 | 88 | | |
| |||
122 | 149 | | |
123 | 150 | | |
124 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
125 | 164 | | |
126 | 165 | | |
127 | 166 | | |
| |||
136 | 175 | | |
137 | 176 | | |
138 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
139 | 181 | | |
140 | | - | |
| 182 | + | |
141 | 183 | | |
142 | 184 | | |
143 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 64 | | |
68 | 65 | | |
69 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| |||
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
100 | 114 | | |
101 | 115 | | |
102 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
447 | 452 | | |
448 | 453 | | |
449 | 454 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
209 | 212 | | |
210 | 213 | | |
211 | 214 | | |
| |||
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | 248 | | |
270 | 249 | | |
271 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
272 | 256 | | |
273 | 257 | | |
274 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
0 commit comments