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 +273 -43 3.10.0-beta.1 → trunk View file →
@@ -1,22 +1,18 @@
1 -@use 'theme';
2 1 @use 'upsell';
3 2
4 -$toolbar-block-size: 136px;
5 -$wpcontent-inline-start-indent: 20px;
6 -
7 3 #wpbody {
8 - padding-block-start: $toolbar-block-size;
4 + padding-block-start: var(--cs-toolbar-block-size);
9 5 }
10 6
11 7 .code-snippets-toolbar {
12 - color: #2c3337;
13 - background: #fff;
8 + color: var(--cs-color-text);
9 + background: var(--cs-color-surface);
14 10 font-family: 'SF Pro', sans-serif;
15 - margin-inline-start: -$wpcontent-inline-start-indent - 2;
11 + margin-inline-start: calc(-1 * var(--cs-wpcontent-inline-start-indent) - 2px);
16 12 position: absolute;
17 - inline-size: calc(100% + $wpcontent-inline-start-indent);
18 - block-size: $toolbar-block-size;
13 + inline-size: calc(100% + var(--cs-wpcontent-inline-start-indent));
14 + block-size: var(--cs-toolbar-block-size);
19 15 inset-block-start: 0;
20 16 display: flex;
21 17 flex-direction: column;
22 18
@@ -51,14 +47,8 @@
51 47 font-weight: 700;
52 48 }
53 49 }
54 50
55 - h1 {
56 - font-size: 18px;
57 - font-weight: 700;
58 - line-height: 1.5;
59 - }
60 -
61 51 ul {
62 52 display: flex;
63 53 gap: 22px;
64 54 align-items: center;
@@ -66,13 +56,40 @@
66 56
67 57 a {
68 58 color: inherit;
69 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 + }
70 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 + }
71 88 }
72 89
73 90 .code-snippets-toolbar-lower {
74 - border-block-end: 1px solid #e2e2e4;
91 + border-block-end: 1px solid var(--cs-color-border-subtle);
75 92 block-size: 60px;
76 93 box-sizing: border-box;
77 94
78 95 nav,
@@ -86,12 +103,18 @@
86 103 }
87 104
88 105 li {
89 106 display: flex;
107 +
108 + &:last-of-type {
109 + margin-inline-start: auto;
110 + }
90 111 }
91 112
92 113 // Items fill the 60px band; the active tab is indicated by accent colour on
93 - // its icon and label, with no underline.
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
94 117 li a {
95 118 display: flex;
96 119 margin: 0;
97 120 block-size: 100%;
@@ -96,9 +119,9 @@
96 119 margin: 0;
97 120 block-size: 100%;
98 121 padding-block: 0;
99 122 padding-inline: 24px;
100 - color: #2c3337;
123 + color: var(--cs-color-text);
101 124 gap: 12px;
102 125 align-items: center;
103 126 font-size: 16px;
104 127 font-weight: 600;
@@ -105,8 +128,9 @@
105 128 letter-spacing: -0.16px;
106 129 text-decoration: none;
107 130 box-sizing: border-box;
108 131 cursor: pointer;
132 + border-block-end: 3px solid transparent;
109 133
110 134 svg {
111 135 inline-size: 26px;
112 136 block-size: 26px;
@@ -112,14 +136,18 @@
112 136 block-size: 26px;
113 137 }
114 138
115 139 &.active-link, &:hover, &:focus, &:active {
116 - color: theme.$accent;
140 + color: var(--cs-color-accent);
141 + z-index: 1;
142 + border-color: var(--cs-color-accent);
143 + box-shadow: none;
117 144 }
118 - }
119 145
120 - li:not(.toolbar-end-item) + li.toolbar-end-item {
121 - margin-inline-start: auto;
146 + &:focus-visible {
147 + outline: 2px solid var(--cs-color-accent);
148 + outline-offset: -2px;
149 + }
122 150 }
123 151
124 152 // Narrow widths: centre each item's label directly beneath its icon and
125 153 // shrink the type so the nav still fits on one row. The pro chip becomes a
@@ -136,9 +164,11 @@
136 164 padding-inline: 14px;
137 165 font-size: 13px;
138 166 text-align: center;
139 167
140 - .pro-chip {
168 + .pro-chip,
169 + .new-chip,
170 + .demo-chip {
141 171 position: absolute;
142 172 inset-block-start: 7px;
143 173 inset-inline-end: 4px;
144 174 padding-block: 1px;
@@ -148,24 +178,13 @@
148 178 }
149 179 }
150 180 }
151 181
152 - // Mobile: the primary navigation scrolls horizontally on its band rather
153 - // than wrapping, with the scrollbar chrome hidden.
154 182 @media (width <= 782px) {
155 - overflow-x: auto;
156 - scrollbar-width: none;
157 -
158 - &::-webkit-scrollbar {
159 - display: none;
160 - }
161 -
162 - ul {
163 - flex-wrap: nowrap;
164 - }
165 -
166 183 li a {
167 - white-space: nowrap;
184 + inline-size: 100%;
185 + padding-inline: 8px;
186 + white-space: normal;
168 187 }
169 188 }
170 189 }
171 190
@@ -172,16 +191,17 @@
172 191 .code-snippets-toolbar-upper li a.active-link,
173 192 .code-snippets-toolbar-upper li a:hover,
174 193 .code-snippets-toolbar-upper li a:focus,
175 194 .code-snippets-toolbar-upper li a:active {
176 - color: theme.$accent;
195 + color: var(--cs-color-accent);
177 196 }
178 197
179 198 .code-snippets-toolbar-lower .pro-chip,
199 +.code-snippets-toolbar-lower .demo-chip,
180 200 .nav-tab .pro-chip,
181 201 .snippet-type-link .pro-chip {
182 - color: theme.$accent;
183 - background: #eff5f9;
202 + color: var(--cs-color-accent);
203 + background: var(--cs-color-surface-info);
184 204 border: 1px solid rgb(34 113 177 / 10%);
185 205 text-transform: uppercase;
186 206 border-radius: 999px;
187 207 display: flex;
@@ -193,12 +213,32 @@
193 213 line-height: 1;
194 214 }
195 215
196 216
197 -.code-snippets-toolbar-lower .pro-chip {
217 +.code-snippets-toolbar-lower .pro-chip,
218 +.code-snippets-toolbar-lower .demo-chip {
198 219 font-size: 12px;
199 220 }
200 221
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 +
201 241 .nav-tab .pro-chip,
202 242 .snippet-type-link .pro-chip {
203 243 font-size: 10px;
204 244 }
@@ -203,6 +243,196 @@
203 243 font-size: 10px;
204 244 }
205 245
206 246 .code-snippets-return-link {
207 - float: inline-end;
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 + }
208 438 }