PluginProbe
Code Snippets / 3.10.2
Code Snippets v3.10.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 3.10.2, at css/common/_toolbar.scss

334 lines 6.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 @use 'theme';
2 @use 'upsell';
3
4 $toolbar-block-size: 136px;
5 $wpcontent-inline-start-indent: 20px;
6
7 #wpbody {
8 padding-block-start: $toolbar-block-size;
9 }
10
11 .code-snippets-toolbar {
12 color: #2c3337;
13 background: #fff;
14 font-family: 'SF Pro', sans-serif;
15 margin-inline-start: -$wpcontent-inline-start-indent - 2;
16 position: absolute;
17 inline-size: calc(100% + $wpcontent-inline-start-indent);
18 block-size: $toolbar-block-size;
19 inset-block-start: 0;
20 display: flex;
21 flex-direction: column;
22
23 ul, li {
24 margin: 0;
25 padding: 0;
26 list-style: none;
27 }
28 }
29
30 .code-snippets-toolbar-upper {
31 justify-content: space-between;
32 block-size: 76px;
33 box-sizing: border-box;
34 padding-block: 16px;
35 padding-inline: 24px;
36 border-block-end: 1px solid rgb(195 196 199 / 50%);
37 display: flex;
38 align-items: center;
39
40 .logo {
41 display: flex;
42 align-items: center;
43 gap: 8px;
44
45 img {
46 block-size: 42px;
47 }
48
49 div {
50 font-size: 18px;
51 font-weight: 700;
52 }
53 }
54
55 h1 {
56 font-size: 18px;
57 font-weight: 700;
58 line-height: 1.5;
59 }
60
61 ul {
62 display: flex;
63 gap: 22px;
64 align-items: center;
65 }
66
67 a {
68 color: inherit;
69 text-decoration: none;
70 }
71
72 @media (width <= 480px) {
73 padding-inline: 10px;
74
75 .logo img {
76 block-size: 34px;
77 }
78
79 .logo div {
80 display: none;
81 }
82
83 .toolbar-upgrade-item .button {
84 padding-inline: 10px;
85 }
86 }
87 }
88
89 .code-snippets-toolbar-lower {
90 border-block-end: 1px solid #e2e2e4;
91 block-size: 60px;
92 box-sizing: border-box;
93
94 nav,
95 ul {
96 block-size: 100%;
97 }
98
99 ul {
100 display: flex;
101 align-items: stretch;
102 }
103
104 li {
105 display: flex;
106 }
107
108 // Items fill the 60px band; the active tab is indicated by accent colour on
109 // its icon and label, with no underline.
110 li a {
111 display: flex;
112 margin: 0;
113 block-size: 100%;
114 padding-block: 0;
115 padding-inline: 24px;
116 color: #2c3337;
117 gap: 12px;
118 align-items: center;
119 font-size: 16px;
120 font-weight: 600;
121 letter-spacing: -0.16px;
122 text-decoration: none;
123 box-sizing: border-box;
124 cursor: pointer;
125 border-block-end: 3px solid transparent;
126
127 svg {
128 inline-size: 26px;
129 block-size: 26px;
130 }
131
132 &.active-link, &:hover, &:focus, &:active {
133 color: theme.$accent;
134 z-index: 1;
135 border-color: theme.$accent;
136 }
137 }
138
139 li:not(.toolbar-end-item) + li.toolbar-end-item {
140 margin-inline-start: auto;
141 }
142
143 // Narrow widths: centre each item's label directly beneath its icon and
144 // shrink the type so the nav still fits on one row. The pro chip becomes a
145 // small badge pinned to the item's top corner, out of the flow so it never
146 // shifts the icon off-centre from its label. Below 782px the row scrolls
147 // sideways (see the mobile block below) rather than wrapping.
148 @media (width <= 1140px) {
149 li a {
150 position: relative;
151 flex-direction: column;
152 justify-content: center;
153 align-items: center;
154 gap: 4px;
155 padding-inline: 14px;
156 font-size: 13px;
157 text-align: center;
158
159 .pro-chip {
160 position: absolute;
161 inset-block-start: 7px;
162 inset-inline-end: 4px;
163 padding-block: 1px;
164 padding-inline: 5px;
165 font-size: 8px;
166 line-height: normal;
167 }
168 }
169 }
170
171 // On narrow screens Settings remains available through the WordPress submenu.
172 // The remaining primary destinations fill the toolbar evenly rather than
173 // becoming a second horizontally-scrolling navigation row.
174 @media (width <= 782px) {
175 li.toolbar-end-item {
176 display: none;
177 }
178
179 li:not(.toolbar-end-item) {
180 flex: 1 1 0;
181 min-inline-size: 0;
182 }
183
184 li:not(.toolbar-end-item) + li.toolbar-end-item {
185 margin-inline-start: 0;
186 }
187
188 li a {
189 inline-size: 100%;
190 padding-inline: 8px;
191 white-space: normal;
192 }
193 }
194 }
195
196 .code-snippets-toolbar-upper li a.active-link,
197 .code-snippets-toolbar-upper li a:hover,
198 .code-snippets-toolbar-upper li a:focus,
199 .code-snippets-toolbar-upper li a:active {
200 color: theme.$accent;
201 }
202
203 .code-snippets-toolbar-lower .pro-chip,
204 .nav-tab .pro-chip,
205 .snippet-type-link .pro-chip {
206 color: theme.$accent;
207 background: #eff5f9;
208 border: 1px solid rgb(34 113 177 / 10%);
209 text-transform: uppercase;
210 border-radius: 999px;
211 display: flex;
212 justify-content: center;
213 align-items: center;
214 box-sizing: border-box;
215 padding: 5px 12px;
216 font-weight: 700;
217 line-height: 1;
218 }
219
220
221 .code-snippets-toolbar-lower .pro-chip {
222 font-size: 12px;
223 }
224
225 .nav-tab .pro-chip,
226 .snippet-type-link .pro-chip {
227 font-size: 10px;
228 }
229
230 .code-snippets-return-link {
231 float: inline-end;
232 }
233
234 .code-snippets-toolbar-upper .toolbar-more-item {
235 display: none;
236 }
237
238 .code-snippets-toolbar-upper .toolbar-more-menu {
239 position: relative;
240
241 .dashicons, .dashicons::before {
242 inline-size: 16px;
243 block-size: 16px;
244 font-size: 16px;
245 }
246 }
247
248 .code-snippets-toolbar-upper .toolbar-more-menu summary {
249 display: inline-flex;
250 align-items: center;
251 gap: 4px;
252 cursor: pointer;
253 }
254
255 .code-snippets-toolbar-upper .toolbar-more-menu ul {
256 position: absolute;
257 inset-block-start: calc(100% + 8px);
258 inset-inline-end: 0;
259 z-index: 2;
260 display: grid;
261 min-inline-size: 180px;
262 block-size: auto;
263 margin: 0;
264 padding: 8px;
265 background: #fff;
266 border: 1px solid theme.$control-border;
267 box-shadow: 0 3px 8px rgb(0 0 0 / 15%);
268 }
269
270 .code-snippets-toolbar-upper .toolbar-more-menu li {
271 margin: 0;
272 }
273
274 // The upper and lower toolbars are distinct navigation trees; keep this rule
275 // after the lower-toolbar link state rules so the compact menu owns its hover state.
276 // stylelint-disable-next-line no-descending-specificity
277 .code-snippets-toolbar-upper .toolbar-more-menu a {
278 display: block;
279 padding: 8px;
280 white-space: nowrap;
281 }
282
283 .code-snippets-toolbar-upper .toolbar-more-menu a:hover,
284 .code-snippets-toolbar-upper .toolbar-more-menu a:focus {
285 background: #f6f7f7;
286 }
287
288 @media (width <= 960px) {
289 .code-snippets-toolbar-upper {
290 gap: 12px;
291 padding-inline: 16px;
292 }
293
294 .code-snippets-toolbar-upper .logo {
295 flex: 0 1 auto;
296 min-inline-size: 0;
297 }
298
299 .code-snippets-toolbar-upper nav {
300 margin-inline-start: auto;
301 }
302
303 .code-snippets-toolbar-upper > nav > ul {
304 gap: 8px;
305 }
306
307 .code-snippets-toolbar-upper > nav > ul > li:not(.toolbar-upgrade-item, .toolbar-more-item) {
308 display: none;
309 }
310
311 .code-snippets-toolbar-upper .toolbar-more-item {
312 display: flex;
313 }
314
315 .code-snippets-toolbar-upper .toolbar-more-menu summary {
316 padding: 8px;
317 white-space: nowrap;
318 }
319
320 .code-snippets-toolbar-upper .toolbar-upgrade-item .button {
321 display: block;
322 max-inline-size: 180px;
323 overflow: hidden;
324 text-overflow: ellipsis;
325 white-space: nowrap;
326 }
327 }
328
329 @media (width <= 640px) {
330 .code-snippets-toolbar-upper .logo div {
331 display: none;
332 }
333 }
334