PluginProbe
Code Snippets / 4.0.0-beta.2
Code Snippets v4.0.0-beta.2
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
code-snippets / css / common / _toolbar.scss

_toolbar.scss in Code Snippets 4.0.0-beta.2, at css/common/_toolbar.scss

439 lines 8.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 @use 'upsell';
2
3 #wpbody {
4 padding-block-start: var(--cs-toolbar-block-size);
5 }
6
7 .code-snippets-toolbar {
8 color: var(--cs-color-text);
9 background: var(--cs-color-surface);
10 font-family: 'SF Pro', sans-serif;
11 margin-inline-start: calc(-1 * var(--cs-wpcontent-inline-start-indent) - 2px);
12 position: absolute;
13 inline-size: calc(100% + var(--cs-wpcontent-inline-start-indent));
14 block-size: var(--cs-toolbar-block-size);
15 inset-block-start: 0;
16 display: flex;
17 flex-direction: column;
18
19 ul, li {
20 margin: 0;
21 padding: 0;
22 list-style: none;
23 }
24 }
25
26 .code-snippets-toolbar-upper {
27 justify-content: space-between;
28 block-size: 76px;
29 box-sizing: border-box;
30 padding-block: 16px;
31 padding-inline: 24px;
32 border-block-end: 1px solid rgb(195 196 199 / 50%);
33 display: flex;
34 align-items: center;
35
36 .logo {
37 display: flex;
38 align-items: center;
39 gap: 8px;
40
41 img {
42 block-size: 42px;
43 }
44
45 div {
46 font-size: 18px;
47 font-weight: 700;
48 }
49 }
50
51 ul {
52 display: flex;
53 gap: 22px;
54 align-items: center;
55 }
56
57 a {
58 color: inherit;
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 }
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 }
88 }
89
90 .code-snippets-toolbar-lower {
91 border-block-end: 1px solid var(--cs-color-border-subtle);
92 block-size: 60px;
93 box-sizing: border-box;
94
95 nav,
96 ul {
97 block-size: 100%;
98 }
99
100 ul {
101 display: flex;
102 align-items: stretch;
103 }
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
117 li a {
118 display: flex;
119 margin: 0;
120 block-size: 100%;
121 padding-block: 0;
122 padding-inline: 24px;
123 color: var(--cs-color-text);
124 gap: 12px;
125 align-items: center;
126 font-size: 16px;
127 font-weight: 600;
128 letter-spacing: -0.16px;
129 text-decoration: none;
130 box-sizing: border-box;
131 cursor: pointer;
132 border-block-end: 3px solid transparent;
133
134 svg {
135 inline-size: 26px;
136 block-size: 26px;
137 }
138
139 &.active-link, &:hover, &:focus, &:active {
140 color: var(--cs-color-accent);
141 z-index: 1;
142 border-color: var(--cs-color-accent);
143 box-shadow: none;
144 }
145
146 &:focus-visible {
147 outline: 2px solid var(--cs-color-accent);
148 outline-offset: -2px;
149 }
150 }
151
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 }
180 }
181
182 @media (width <= 782px) {
183 li a {
184 inline-size: 100%;
185 padding-inline: 8px;
186 white-space: normal;
187 }
188 }
189 }
190
191 .code-snippets-toolbar-upper li a.active-link,
192 .code-snippets-toolbar-upper li a:hover,
193 .code-snippets-toolbar-upper li a:focus,
194 .code-snippets-toolbar-upper li a:active {
195 color: var(--cs-color-accent);
196 }
197
198 .code-snippets-toolbar-lower .pro-chip,
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%);
205 text-transform: uppercase;
206 border-radius: 999px;
207 display: flex;
208 justify-content: center;
209 align-items: center;
210 box-sizing: border-box;
211 padding: 5px 12px;
212 font-weight: 700;
213 line-height: 1;
214 }
215
216
217 .code-snippets-toolbar-lower .pro-chip,
218 .code-snippets-toolbar-lower .demo-chip {
219 font-size: 12px;
220 }
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
241 .nav-tab .pro-chip,
242 .snippet-type-link .pro-chip {
243 font-size: 10px;
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 }
438 }
439