PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
← All changes | css/common/_toolbar.scss +346 -35 4.0.0-beta.1 → trunk View file →
@@ -1,21 +1,18 @@
1 1 @use 'upsell';
2 2
3 -$toolbar-block-size: 150px;
4 -$wpcontent-inline-start-indent: 20px;
5 -
6 3 #wpbody {
7 - padding-block-start: $toolbar-block-size;
4 + padding-block-start: var(--cs-toolbar-block-size);
8 5 }
9 6
10 7 .code-snippets-toolbar {
11 - color: #2c3337;
12 - background: #fff;
8 + color: var(--cs-color-text);
9 + background: var(--cs-color-surface);
13 10 font-family: 'SF Pro', sans-serif;
14 - margin-inline-start: -$wpcontent-inline-start-indent - 2;
11 + margin-inline-start: calc(-1 * var(--cs-wpcontent-inline-start-indent) - 2px);
15 12 position: absolute;
16 - inline-size: calc(100% + $wpcontent-inline-start-indent);
17 - block-size: $toolbar-block-size;
13 + inline-size: calc(100% + var(--cs-wpcontent-inline-start-indent));
14 + block-size: var(--cs-toolbar-block-size);
18 15 inset-block-start: 0;
19 16 display: flex;
20 17 flex-direction: column;
21 18
@@ -27,10 +24,13 @@
27 24 }
28 25
29 26 .code-snippets-toolbar-upper {
30 27 justify-content: space-between;
31 - block-size: 77px;
28 + block-size: 76px;
29 + box-sizing: border-box;
30 + padding-block: 16px;
32 31 padding-inline: 24px;
32 + border-block-end: 1px solid rgb(195 196 199 / 50%);
33 33 display: flex;
34 34 align-items: center;
35 35
36 36 .logo {
@@ -40,14 +40,13 @@
40 40
41 41 img {
42 42 block-size: 42px;
43 43 }
44 - }
45 44
46 - h1 {
47 - font-size: 18px;
48 - font-weight: 700;
49 - line-height: 1.5;
45 + div {
46 + font-size: 18px;
47 + font-weight: 700;
48 + }
50 49 }
51 50
52 51 ul {
53 52 display: flex;
@@ -57,43 +56,137 @@
57 56
58 57 a {
59 58 color: inherit;
60 59 text-decoration: none;
60 +
61 + &:hover,
62 + &:focus {
63 + color: var(--cs-color-accent);
64 + box-shadow: none;
65 + }
66 +
67 + &:focus-visible {
68 + outline: 2px solid var(--cs-color-accent);
69 + outline-offset: 6px;
70 + }
61 71 }
72 +
73 + @media (width <= 480px) {
74 + padding-inline: 10px;
75 +
76 + .logo img {
77 + block-size: 34px;
78 + }
79 +
80 + .logo div {
81 + display: none;
82 + }
83 +
84 + .toolbar-upgrade-item .button {
85 + padding-inline: 10px;
86 + }
87 + }
62 88 }
63 89
64 90 .code-snippets-toolbar-lower {
65 - border-block: 1px solid #c3c4c7;
91 + border-block-end: 1px solid var(--cs-color-border-subtle);
92 + block-size: 60px;
93 + box-sizing: border-box;
66 94
95 + nav,
67 96 ul {
97 + block-size: 100%;
98 + }
99 +
100 + ul {
68 101 display: flex;
69 - align-items: end;
102 + align-items: stretch;
70 103 }
71 104
105 + li {
106 + display: flex;
107 +
108 + &:last-of-type {
109 + margin-inline-start: auto;
110 + }
111 + }
112 +
113 + // Items fill the 60px band; the active tab is indicated by accent colour on
114 + // its icon and label plus a 3px accent underline, reserved on every item as a
115 + // transparent border so activating a tab never shifts the row.
116 + // stylelint-disable-next-line no-descending-specificity
72 117 li a {
73 118 display: flex;
74 119 margin: 0;
75 - padding: 24px 24px 20px;
76 - color: inherit;
120 + block-size: 100%;
121 + padding-block: 0;
122 + padding-inline: 24px;
123 + color: var(--cs-color-text);
77 124 gap: 12px;
78 125 align-items: center;
79 126 font-size: 16px;
127 + font-weight: 600;
128 + letter-spacing: -0.16px;
80 129 text-decoration: none;
81 - font-weight: bold;
82 130 box-sizing: border-box;
83 - transition: border unset;
84 - border-block-end: 4px solid transparent;
85 131 cursor: pointer;
132 + border-block-end: 3px solid transparent;
86 133
134 + svg {
135 + inline-size: 26px;
136 + block-size: 26px;
137 + }
138 +
87 139 &.active-link, &:hover, &:focus, &:active {
88 - color: #2271b1;
89 - border-block-end-color: currentcolor;
140 + color: var(--cs-color-accent);
141 + z-index: 1;
142 + border-color: var(--cs-color-accent);
143 + box-shadow: none;
90 144 }
145 +
146 + &:focus-visible {
147 + outline: 2px solid var(--cs-color-accent);
148 + outline-offset: -2px;
149 + }
91 150 }
92 151
93 - li:last-of-type {
94 - margin-inline-start: auto;
152 + // Narrow widths: centre each item's label directly beneath its icon and
153 + // shrink the type so the nav still fits on one row. The pro chip becomes a
154 + // small badge pinned to the item's top corner, out of the flow so it never
155 + // shifts the icon off-centre from its label. Below 782px the row scrolls
156 + // sideways (see the mobile block below) rather than wrapping.
157 + @media (width <= 1140px) {
158 + li a {
159 + position: relative;
160 + flex-direction: column;
161 + justify-content: center;
162 + align-items: center;
163 + gap: 4px;
164 + padding-inline: 14px;
165 + font-size: 13px;
166 + text-align: center;
167 +
168 + .pro-chip,
169 + .new-chip,
170 + .demo-chip {
171 + position: absolute;
172 + inset-block-start: 7px;
173 + inset-inline-end: 4px;
174 + padding-block: 1px;
175 + padding-inline: 5px;
176 + font-size: 8px;
177 + line-height: normal;
178 + }
179 + }
95 180 }
181 +
182 + @media (width <= 782px) {
183 + li a {
184 + inline-size: 100%;
185 + padding-inline: 8px;
186 + white-space: normal;
187 + }
188 + }
96 189 }
97 190
98 191 .code-snippets-toolbar-upper li a.active-link,
99 192 .code-snippets-toolbar-upper li a:hover,
@@ -98,30 +191,248 @@
98 191 .code-snippets-toolbar-upper li a.active-link,
99 192 .code-snippets-toolbar-upper li a:hover,
100 193 .code-snippets-toolbar-upper li a:focus,
101 194 .code-snippets-toolbar-upper li a:active {
102 - color: #2271b1;
195 + color: var(--cs-color-accent);
103 196 }
104 197
105 198 .code-snippets-toolbar-lower .pro-chip,
106 -.nav-tab .pro-chip {
107 - color: #d46f4d;
199 +.code-snippets-toolbar-lower .demo-chip,
200 +.nav-tab .pro-chip,
201 +.snippet-type-link .pro-chip {
202 + color: var(--cs-color-accent);
203 + background: var(--cs-color-surface-info);
204 + border: 1px solid rgb(34 113 177 / 10%);
108 205 text-transform: uppercase;
109 - border: 2px solid currentcolor;
110 206 border-radius: 999px;
111 207 display: flex;
112 208 justify-content: center;
113 209 align-items: center;
114 210 box-sizing: border-box;
115 - padding: 3px 9px;
116 - font-weight: 600;
211 + padding: 5px 12px;
212 + font-weight: 700;
213 + line-height: 1;
117 214 }
118 215
119 216
120 -.code-snippets-toolbar-lower .pro-chip {
217 +.code-snippets-toolbar-lower .pro-chip,
218 +.code-snippets-toolbar-lower .demo-chip {
121 219 font-size: 12px;
122 220 }
123 221
124 -.nav-tab .pro-chip {
222 +// Deliberately warm, so it reads as "new here" rather than as another locked
223 +// Pro destination alongside the blue pro chips.
224 +.code-snippets-toolbar-lower .new-chip {
225 + color: #fff;
226 + background: linear-gradient(135deg, var(--cs-color-secondary) 0%, #e2953f 100%);
227 + border: 1px solid rgb(0 0 0 / 5%);
228 + text-transform: uppercase;
229 + border-radius: 999px;
230 + display: flex;
231 + justify-content: center;
232 + align-items: center;
233 + box-sizing: border-box;
234 + padding: 5px 10px;
235 + font-size: 12px;
236 + font-weight: 700;
237 + letter-spacing: 0.04em;
238 + line-height: 1;
239 +}
240 +
241 +.nav-tab .pro-chip,
242 +.snippet-type-link .pro-chip {
125 243 font-size: 10px;
126 - padding: 0 6px;
244 +}
245 +
246 +.code-snippets-return-link {
247 + display: inline-flex;
248 + float: none;
249 + align-items: center;
250 + min-block-size: 36px;
251 + margin-block: 32px 20px;
252 + padding-inline: 12px;
253 + border-color: var(--cs-color-accent);
254 + background: transparent;
255 + color: var(--cs-color-accent);
256 + font-size: 14px;
257 + font-weight: 500;
258 + text-decoration: none;
259 +
260 + &:hover,
261 + &:focus-visible {
262 + border-color: var(--cs-color-accent-hover);
263 + background: transparent;
264 + color: var(--cs-color-accent-hover);
265 + }
266 +}
267 +
268 +.code-snippets-toolbar-upper .toolbar-more-item {
269 + display: none;
270 +}
271 +
272 +.code-snippets-toolbar-upper .toolbar-more-menu {
273 + position: relative;
274 +
275 + .dashicons, .dashicons::before {
276 + inline-size: 16px;
277 + block-size: 16px;
278 + font-size: 16px;
279 + }
280 +}
281 +
282 +.code-snippets-toolbar-upper .toolbar-more-menu summary {
283 + display: inline-flex;
284 + align-items: center;
285 + gap: 4px;
286 + cursor: pointer;
287 +}
288 +
289 +.code-snippets-toolbar-upper .toolbar-more-menu ul {
290 + position: absolute;
291 + inset-block-start: calc(100% + 8px);
292 + inset-inline-end: 0;
293 + z-index: 2;
294 + display: grid;
295 + min-inline-size: 180px;
296 + block-size: auto;
297 + margin: 0;
298 + padding: 8px;
299 + background: var(--cs-color-surface);
300 + border: 1px solid var(--cs-color-border);
301 + box-shadow: 0 3px 8px rgb(0 0 0 / 15%);
302 +}
303 +
304 +.code-snippets-toolbar-upper .toolbar-more-menu li {
305 + margin: 0;
306 +}
307 +
308 +// The upper and lower toolbars are distinct navigation trees; keep this rule
309 +// after the lower-toolbar link state rules so the compact menu owns its hover state.
310 +// stylelint-disable-next-line no-descending-specificity
311 +.code-snippets-toolbar-upper .toolbar-more-menu a {
312 + display: block;
313 + padding: 8px;
314 + white-space: nowrap;
315 +}
316 +
317 +.code-snippets-toolbar-upper .toolbar-more-menu a:hover,
318 +.code-snippets-toolbar-upper .toolbar-more-menu a:focus {
319 + background: var(--cs-color-surface-subtle);
320 +}
321 +
322 +@media (width <= 960px) {
323 + .code-snippets-toolbar-upper {
324 + gap: 12px;
325 + padding-inline: 16px;
326 + }
327 +
328 + .code-snippets-toolbar-upper ul {
329 + gap: 0;
330 + }
331 +
332 + .code-snippets-toolbar-upper .logo {
333 + flex: 0 1 auto;
334 + min-inline-size: 0;
335 + }
336 +
337 + .code-snippets-toolbar-upper nav {
338 + margin-inline-start: auto;
339 + }
340 +
341 + .code-snippets-toolbar-upper > nav > ul {
342 + gap: 8px;
343 + }
344 +
345 + .code-snippets-toolbar-upper > nav > ul > li:not(.toolbar-upgrade-item, .toolbar-more-item) {
346 + display: none;
347 + }
348 +
349 + .code-snippets-toolbar-upper .toolbar-more-item {
350 + display: flex;
351 + }
352 +
353 + .code-snippets-toolbar-upper .toolbar-more-menu summary {
354 + padding: 8px;
355 + white-space: nowrap;
356 + }
357 +
358 + .code-snippets-toolbar-upper .toolbar-upgrade-item .button {
359 + display: block;
360 + max-inline-size: 180px;
361 + overflow: hidden;
362 + text-overflow: ellipsis;
363 + white-space: nowrap;
364 + }
365 +}
366 +
367 +@media (width <= 640px) {
368 + .code-snippets-toolbar-upper .logo div {
369 + display: none;
370 + }
371 +}
372 +
373 +.wp-core-ui .code-snippets-toolbar-upper .button.cloud-connected-button {
374 + display: flex;
375 + align-items: center;
376 + justify-content: center;
377 + text-align: center;
378 + gap: 8px;
379 + text-transform: uppercase;
380 + background: #f6f7f7;
381 + color: #646970;
382 + font-size: 12px;
383 + font-weight: bold;
384 + border: none;
385 + min-block-size: 3.5em;
386 + min-inline-size: 12.5em;
387 +}
388 +
389 +.cloud-disconnect-confirmation-modal .components-modal__children-container {
390 + display: flex;
391 + flex-flow: column;
392 + align-items: center;
393 + font-size: 16px;
394 + gap: 1em;
395 + min-inline-size: 512px;
396 +
397 + h1 {
398 + font-size: 28px;
399 + margin-block: 0;
400 + }
401 +
402 + p {
403 + color: #646970;
404 + font-size: inherit;
405 + max-inline-size: 22em;
406 + text-align: center;
407 + }
408 +
409 + a.button {
410 + font-size: inherit;
411 + background-color: var(--cs-color-secondary);
412 + }
413 +
414 + .button-link {
415 + color: var(--cs-color-secondary);
416 + border: none;
417 + }
418 +}
419 +
420 +// Slot that adopts the WordPress Screen Options / Help tabs so they appear
421 +// directly below the toolbar instead of above the page content.
422 +.snippets-screen-meta-slot {
423 + #screen-meta-links {
424 + float: none;
425 + display: flex;
426 + justify-content: flex-end;
427 + margin: 0;
428 + border-color: var(--cs-color-border-subtle);
429 +
430 + .show-settings {
431 + border-color: var(--cs-color-border-subtle);
432 + }
433 + }
434 +
435 + #screen-meta {
436 + margin: 0;
437 + }
127 438 }