@anyblades/blades 0.28.0-alpha.6 → 0.28.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/_includes/blades/html.liquid +0 -3
- package/_includes/blades/html.njk +0 -2
- package/_includes/blades/links.liquid +1 -7
- package/_includes/blades/sitemap.xml.njk +15 -2
- package/assets/blades.core.css +177 -159
- package/assets/blades.css +241 -213
- package/assets/blades.theme.css +53 -58
- package/assets/breakout.css +30 -42
- package/assets/float-label.core.css +22 -10
- package/assets/float-label.css +48 -28
- package/assets/float-label.theme.css +25 -17
- package/assets/link-icon.css +18 -24
- package/assets/pico.blades.css +1211 -0
- package/assets/responsive-table.css +9 -10
- package/blades.gemspec +1 -1
- package/package.json +6 -2
- package/src/blades.theme.css +1 -3
- package/src/breakout.css +3 -10
- package/src/content/_code.css +3 -3
- package/src/content/_table.css +16 -20
- package/src/content/_typography.css +4 -4
- package/src/link-icon.css +8 -10
- package/src/pico.blades.css +6 -0
- package/src/responsive-table.css +1 -6
- package/_includes/blades/gtm.liquid +0 -39
- package/_includes/blades/gtm.njk +0 -42
- package/postcss.config.js +0 -5
package/assets/blades.core.css
CHANGED
|
@@ -25,13 +25,16 @@ Useful for tables of contents and long lists.
|
|
|
25
25
|
```css */
|
|
26
26
|
|
|
27
27
|
.columns {
|
|
28
|
+
-moz-columns: 30ch auto;
|
|
28
29
|
columns: 30ch auto; /* 2 cols max for 65ch container */
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Avoid breaking inside elements, such as nested lists */
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
.columns > * {
|
|
35
|
+
-moz-column-break-inside: avoid;
|
|
32
36
|
break-inside: avoid;
|
|
33
37
|
}
|
|
34
|
-
}
|
|
35
38
|
|
|
36
39
|
/*```
|
|
37
40
|
</details>
|
|
@@ -52,8 +55,7 @@ Useful for tables of contents and long lists.
|
|
|
52
55
|
<!--section--> */
|
|
53
56
|
|
|
54
57
|
/*
|
|
55
|
-
<!--section:
|
|
56
|
-
<details>How it works:
|
|
58
|
+
<!--section:code-->
|
|
57
59
|
```css */
|
|
58
60
|
|
|
59
61
|
.breakout,
|
|
@@ -61,18 +63,29 @@ Useful for tables of contents and long lists.
|
|
|
61
63
|
/* Prepare the container for breakout elements */
|
|
62
64
|
padding-inline: 10%;
|
|
63
65
|
max-width: calc(10% + 65ch + 10%);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Breakout direct children only */
|
|
64
69
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
.breakout > *:is(
|
|
71
|
+
table,
|
|
72
|
+
pre,
|
|
73
|
+
figure, video, iframe, canvas,
|
|
74
|
+
img, picture,
|
|
75
|
+
|
|
76
|
+
.breakout-item,
|
|
77
|
+
.breakout-item-max
|
|
78
|
+
),
|
|
79
|
+
.breakout-all > *:is(
|
|
68
80
|
table,
|
|
69
81
|
pre,
|
|
70
82
|
figure, video, iframe, canvas,
|
|
71
83
|
img, picture,
|
|
72
|
-
|
|
84
|
+
|
|
73
85
|
.breakout-item,
|
|
74
86
|
.breakout-item-max
|
|
75
87
|
) {
|
|
88
|
+
width: -moz-fit-content;
|
|
76
89
|
width: fit-content;
|
|
77
90
|
min-width: 100%;
|
|
78
91
|
max-width: 125%;
|
|
@@ -80,33 +93,31 @@ Useful for tables of contents and long lists.
|
|
|
80
93
|
transform: translateX(-50%);
|
|
81
94
|
}
|
|
82
95
|
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
/* Respect img/picture min-width */
|
|
97
|
+
|
|
98
|
+
.breakout > *:is(img, picture), .breakout-all > *:is(img, picture) {
|
|
85
99
|
min-width: auto;
|
|
86
100
|
}
|
|
87
101
|
|
|
88
|
-
|
|
89
|
-
|
|
102
|
+
/* Max out the width of the element */
|
|
103
|
+
|
|
104
|
+
.breakout > *.breakout-item-max, .breakout-all > *.breakout-item-max {
|
|
90
105
|
width: 125% !important; /* !important is for cases like figure.breakout-item-max @TODO */
|
|
91
106
|
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
107
|
|
|
95
|
-
.breakout-all >
|
|
96
|
-
&:is(h2, h3, h4, h5, h6, hr):not([class]) {
|
|
108
|
+
.breakout-all > *:is(h2, h3, h4, h5, h6, hr):not([class]) {
|
|
97
109
|
position: relative;
|
|
110
|
+
}
|
|
98
111
|
|
|
99
|
-
|
|
112
|
+
.breakout-all > *:is(h2, h3, h4, h5, h6, hr):not([class])::before {
|
|
100
113
|
content: "";
|
|
101
114
|
display: block;
|
|
102
115
|
position: absolute;
|
|
103
116
|
background: gray;
|
|
104
117
|
opacity: 12.5%;
|
|
105
118
|
}
|
|
106
|
-
}
|
|
107
119
|
|
|
108
|
-
|
|
109
|
-
&::before {
|
|
120
|
+
.breakout-all > *:is(h2, h3, h4, h5, h6):not([class])::before {
|
|
110
121
|
width: 10em;
|
|
111
122
|
right: 100%;
|
|
112
123
|
margin-right: 0.8ch;
|
|
@@ -116,30 +127,26 @@ Useful for tables of contents and long lists.
|
|
|
116
127
|
background: linear-gradient(to left, gray, transparent);
|
|
117
128
|
}
|
|
118
129
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
130
|
+
/* @TODO: add to tricks-wiki why `*` works here, but `&` fails */
|
|
131
|
+
|
|
132
|
+
.breakout-all > *:is(h2, h3, h4, h5, h6):not([class]):where(hr + *)::before {
|
|
122
133
|
display: none !important;
|
|
123
134
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
&:is(hr) {
|
|
135
|
+
|
|
136
|
+
.breakout-all > *:is(hr) {
|
|
127
137
|
height: 0.5rem;
|
|
128
138
|
border: none;
|
|
129
139
|
overflow: visible;
|
|
140
|
+
}
|
|
130
141
|
|
|
131
|
-
|
|
142
|
+
.breakout-all > *:is(hr)::before {
|
|
132
143
|
width: 100vw;
|
|
133
144
|
left: 50%;
|
|
134
145
|
height: 100%;
|
|
135
146
|
transform: translateX(-50%);
|
|
136
147
|
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
148
|
|
|
140
149
|
/*```
|
|
141
|
-
</details>
|
|
142
|
-
|
|
143
150
|
<!--section:summary-->
|
|
144
151
|
|
|
145
152
|
The `.breakout` layout allows images, tables, and other figures to automatically extend or bleed beyond their parent container’s width.
|
|
@@ -162,18 +169,14 @@ Or table:
|
|
|
162
169
|
Or code block:
|
|
163
170
|
|
|
164
171
|
```html
|
|
165
|
-
<p>
|
|
166
|
-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quod. Lorem ipsum dolor sit amet consectetur
|
|
167
|
-
adipisicing elit. Quisquam, quod.
|
|
168
|
-
</p>
|
|
172
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quod. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quod.</p>
|
|
169
173
|
```
|
|
170
174
|
|
|
171
175
|
Or anything else:
|
|
172
176
|
|
|
173
177
|
<article class="breakout-item-max" data-theme="dark">
|
|
174
178
|
|
|
175
|
-
Using `.breakout-item` and `.breakout-item-max` helpers {style=margin:0}
|
|
176
|
-
|
|
179
|
+
Using `.breakout-item` and `.breakout-item-max` helpers {style=margin:0}
|
|
177
180
|
</article>
|
|
178
181
|
|
|
179
182
|
<div><hr></div>
|
|
@@ -208,8 +211,9 @@ h4,
|
|
|
208
211
|
h5,
|
|
209
212
|
h6 {
|
|
210
213
|
position: relative;
|
|
214
|
+
}
|
|
211
215
|
|
|
212
|
-
|
|
216
|
+
h1 a[href^="#"], h2 a[href^="#"], h3 a[href^="#"], h4 a[href^="#"], h5 a[href^="#"], h6 a[href^="#"] {
|
|
213
217
|
position: absolute;
|
|
214
218
|
right: 100%;
|
|
215
219
|
top: 50%;
|
|
@@ -219,14 +223,12 @@ h6 {
|
|
|
219
223
|
text-decoration: none;
|
|
220
224
|
visibility: hidden;
|
|
221
225
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
a[href^="#"] {
|
|
226
|
+
|
|
227
|
+
@media /* to avoid double-tap on touch devices */ (hover: hover) {
|
|
228
|
+
h1:hover a[href^="#"], h2:hover a[href^="#"], h3:hover a[href^="#"], h4:hover a[href^="#"], h5:hover a[href^="#"], h6:hover a[href^="#"] {
|
|
225
229
|
visibility: visible;
|
|
226
230
|
}
|
|
227
|
-
}
|
|
228
231
|
}
|
|
229
|
-
}
|
|
230
232
|
|
|
231
233
|
/*```
|
|
232
234
|
</details>
|
|
@@ -253,31 +255,28 @@ Customize markers using inline `style="--list-marker:..."` on `<ul>/<ol>` or eve
|
|
|
253
255
|
<details>How it works:
|
|
254
256
|
```css */
|
|
255
257
|
|
|
256
|
-
ul,
|
|
257
|
-
ol {
|
|
258
|
-
&[style*="--list-marker:"] {
|
|
258
|
+
ul[style*="--list-marker:"], ol[style*="--list-marker:"] {
|
|
259
259
|
list-style-type: var(--list-marker);
|
|
260
|
+
}
|
|
260
261
|
|
|
261
|
-
|
|
262
|
+
ul[style*="--list-marker:"] > li, ol[style*="--list-marker:"] > li {
|
|
262
263
|
list-style-type: inherit;
|
|
263
264
|
}
|
|
264
|
-
}
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
ul li[style*="--list-marker:"], ol li[style*="--list-marker:"] {
|
|
267
267
|
list-style-type: var(--list-marker);
|
|
268
268
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
content: attr(data-marker) " ";
|
|
269
|
+
|
|
270
|
+
ul li[data-marker]::marker, ol li[data-marker]::marker {
|
|
271
|
+
content: attr(data-marker) " "; /* ⚠️ Chrome and Firefox only */
|
|
272
272
|
}
|
|
273
|
-
}
|
|
274
273
|
|
|
275
274
|
/*```
|
|
276
275
|
</details>
|
|
277
276
|
|
|
278
277
|
### Unlist
|
|
279
278
|
|
|
280
|
-
|
|
279
|
+
`.unlist` removes list styling:
|
|
281
280
|
|
|
282
281
|
<article>
|
|
283
282
|
|
|
@@ -288,73 +287,72 @@ Helper class to remove list styling at all:
|
|
|
288
287
|
{.unlist .grid style=margin:0}
|
|
289
288
|
</article>
|
|
290
289
|
|
|
290
|
+
`.unlist-all` also removes styling from all nested lists.
|
|
291
|
+
|
|
291
292
|
<details>How it works:
|
|
292
293
|
```css */
|
|
293
294
|
|
|
294
|
-
ul,
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
.unlist-all
|
|
295
|
+
ul.unlist,
|
|
296
|
+
ul.unlist-all,
|
|
297
|
+
.unlist-all ul,
|
|
298
|
+
ol.unlist,
|
|
299
|
+
ol.unlist-all,
|
|
300
|
+
.unlist-all ol {
|
|
299
301
|
padding-inline-start: 0;
|
|
302
|
+
}
|
|
300
303
|
|
|
301
|
-
|
|
304
|
+
ul.unlist > li, ul.unlist-all > li, .unlist-all ul > li, ol.unlist > li, ol.unlist-all > li, .unlist-all ol > li {
|
|
302
305
|
list-style: none;
|
|
303
306
|
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
307
|
|
|
307
308
|
/*```
|
|
308
309
|
</details>
|
|
309
310
|
<!--section--> */
|
|
310
311
|
|
|
311
312
|
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
|
|
312
|
-
<!--section:
|
|
313
|
-
<details>How it works:
|
|
313
|
+
<!--section:code-->
|
|
314
314
|
```css */
|
|
315
315
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
316
|
+
/* Use inline flex only if link contains an icon */
|
|
317
|
+
|
|
318
|
+
a:has(> i) {
|
|
319
319
|
display: inline-flex;
|
|
320
320
|
gap: 0.375ch; /* =3/8 */
|
|
321
321
|
overflow-y: clip; /* to work in pair with text-underline-offset in Safari */
|
|
322
322
|
}
|
|
323
|
-
|
|
323
|
+
|
|
324
|
+
a > i {
|
|
324
325
|
font-style: normal;
|
|
325
326
|
float: left; /* ✅ Chrome ❌ Safari */
|
|
326
327
|
text-underline-offset: -2em; /* ❌ Chrome ✅ Safari - to clip it with overflow-y */
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/* Favicons */
|
|
327
331
|
|
|
328
|
-
|
|
329
|
-
> img {
|
|
332
|
+
a > i > img {
|
|
330
333
|
height: 1.25em;
|
|
331
334
|
margin-block-start: calc(-0.25em / 2);
|
|
332
335
|
max-width: none; /* to keep ratio safe */
|
|
333
336
|
display: inline-block; /* for Tailwind CSS Typography */
|
|
334
337
|
}
|
|
335
338
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
&[class*=" fa-"] {
|
|
339
|
+
a > i[class^="fa-"],
|
|
340
|
+
a > i[class*=" fa-"] {
|
|
339
341
|
line-height: inherit;
|
|
340
342
|
--fa-width: auto;
|
|
341
343
|
}
|
|
342
|
-
|
|
344
|
+
|
|
345
|
+
/* Font Awesome */
|
|
346
|
+
|
|
347
|
+
a > i.fa-lg {
|
|
343
348
|
line-height: normal;
|
|
344
349
|
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
350
|
|
|
348
351
|
/*```
|
|
349
|
-
</details>
|
|
350
|
-
|
|
351
|
-
How we made it: https://codepen.io/editor/anydigital/pen/019d2b94-5616-75dc-a23e-e111869d5237
|
|
352
|
-
|
|
353
|
-
**PRO** example of automatic favicons for `11ty`: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
|
|
354
|
-
|
|
355
352
|
<!--section:summary-->
|
|
356
353
|
|
|
357
|
-
Use *Bl*ades `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links.
|
|
354
|
+
Use *Bl*ades `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links.
|
|
355
|
+
It automatically handles sizing and alignment while preventing underline on icons.
|
|
358
356
|
|
|
359
357
|
<!--section:docs-->
|
|
360
358
|
|
|
@@ -367,12 +365,16 @@ Use *Bl*ades `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome
|
|
|
367
365
|
| [<i class="fa-brands fa-github fa-lg"></i> Font Awesome icons](#) | `<a><i class="fa-..."></i> Text</a>` |
|
|
368
366
|
</article>
|
|
369
367
|
|
|
370
|
-
Or even:
|
|
368
|
+
Or even for:
|
|
371
369
|
|
|
372
370
|
<article>
|
|
373
371
|
<a href="#" style="margin: 0 0 0 1rem"><i>🥷</i> very-very-very-very-very-<br>long-multiline-links</a>
|
|
374
372
|
</article>
|
|
375
373
|
|
|
374
|
+
How we made it: https://codepen.io/editor/anydigital/pen/019d2b94-5616-75dc-a23e-e111869d5237
|
|
375
|
+
|
|
376
|
+
**PRO** example of automatic favicons for `11ty`: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
|
|
377
|
+
|
|
376
378
|
<!--section--> */
|
|
377
379
|
|
|
378
380
|
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_table.scss
|
|
@@ -384,14 +386,12 @@ Place `<hr>` element inside `<th>` column to expand it horizontally:
|
|
|
384
386
|
|
|
385
387
|
<article>
|
|
386
388
|
|
|
387
|
-
| Column with `<hr
|
|
388
|
-
| --- | --- |
|
|
389
|
+
| Column with `<hr>`<hr> | Same column without `<hr>` | ... {style=width:100%} |
|
|
390
|
+
| --- | --- | --- |
|
|
389
391
|
| (012) 345-6789 | (012) 345-6789 |
|
|
390
|
-
|
|
391
|
-
{style=max-width:30ch}
|
|
392
392
|
</article>
|
|
393
393
|
|
|
394
|
-
Living examples of big tables with `<hr>`-expanders:
|
|
394
|
+
Living examples of big tables with `<hr>`-expanders: <!--A-Z-->
|
|
395
395
|
- https://blades.ninja/ai/ide/
|
|
396
396
|
- https://blades.ninja/build-awesome-11ty/starters/
|
|
397
397
|
- https://blades.ninja/css/frameworks/
|
|
@@ -400,23 +400,20 @@ Living examples of big tables with `<hr>`-expanders:
|
|
|
400
400
|
<details>How it works:
|
|
401
401
|
```css */
|
|
402
402
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
visibility: hidden;
|
|
403
|
+
th hr {
|
|
404
|
+
width: 12ch; /* min ~65/12 = ~5 cols */
|
|
405
|
+
height: 0;
|
|
406
|
+
margin: 0;
|
|
407
|
+
visibility: hidden;
|
|
408
|
+
}
|
|
410
409
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
410
|
+
th hr.lg {
|
|
411
|
+
width: 18ch;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
th hr.x2 {
|
|
415
|
+
width: 24ch;
|
|
417
416
|
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
417
|
|
|
421
418
|
/*```
|
|
422
419
|
</details>
|
|
@@ -429,7 +426,7 @@ table {
|
|
|
429
426
|
|
|
430
427
|
| Less | borders |
|
|
431
428
|
| ---- | ------- |
|
|
432
|
-
|
|
|
429
|
+
| More | fun |
|
|
433
430
|
|
|
434
431
|
{.borderless}
|
|
435
432
|
</article>
|
|
@@ -438,16 +435,13 @@ Living example: https://bladeswitch.com/#minimal-dependencies table
|
|
|
438
435
|
|
|
439
436
|
<!--section--> */
|
|
440
437
|
|
|
441
|
-
table.borderless
|
|
442
|
-
|
|
443
|
-
td {
|
|
438
|
+
table.borderless th,
|
|
439
|
+
table.borderless td {
|
|
444
440
|
border: none;
|
|
445
441
|
}
|
|
446
|
-
}
|
|
447
442
|
|
|
448
443
|
/*
|
|
449
|
-
<!--section:
|
|
450
|
-
<details>How it works:
|
|
444
|
+
<!--section:code-->
|
|
451
445
|
```css */
|
|
452
446
|
|
|
453
447
|
table.responsive,
|
|
@@ -458,6 +452,7 @@ table.responsive,
|
|
|
458
452
|
transform: translateX(-50%);
|
|
459
453
|
|
|
460
454
|
/* Let them full-bleed */
|
|
455
|
+
width: -moz-max-content;
|
|
461
456
|
width: max-content;
|
|
462
457
|
min-width: auto;
|
|
463
458
|
max-width: 100vw;
|
|
@@ -467,22 +462,23 @@ table.responsive,
|
|
|
467
462
|
display: block;
|
|
468
463
|
overflow-x: auto;
|
|
469
464
|
-webkit-overflow-scrolling: touch; /* Smooth scroll for iOS */
|
|
465
|
+
}
|
|
470
466
|
|
|
471
|
-
|
|
472
|
-
td
|
|
467
|
+
table.responsive th,
|
|
468
|
+
table.responsive td,
|
|
469
|
+
.breakout > table:not(.does-not-exist) th,
|
|
470
|
+
.breakout > table:not(.does-not-exist) td,
|
|
471
|
+
.breakout-all > table:not(.does-not-exist) th,
|
|
472
|
+
.breakout-all > table:not(.does-not-exist) td {
|
|
473
473
|
padding-inline-start: 0;
|
|
474
474
|
}
|
|
475
|
-
}
|
|
476
475
|
|
|
477
476
|
/*```
|
|
478
|
-
</details>
|
|
479
|
-
|
|
480
477
|
`table:not(.does-not-exist)` trick (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
|
|
481
478
|
|
|
482
479
|
<!--section:summary-->
|
|
483
480
|
|
|
484
481
|
`.responsive` makes a table full-bleed and scroll on mobile, without a need for a redundant wrapper (finally).
|
|
485
|
-
|
|
486
482
|
Tables inside https://blades.ninja/css/breakout/ are responsive by default.
|
|
487
483
|
|
|
488
484
|
<!--section:docs-->
|
|
@@ -498,7 +494,6 @@ Tables inside https://blades.ninja/css/breakout/ are responsive by default.
|
|
|
498
494
|
---
|
|
499
495
|
|
|
500
496
|
Living examples: <!--A-Z-->
|
|
501
|
-
|
|
502
497
|
- https://blades.ninja/ai/ide/
|
|
503
498
|
- https://blades.ninja/build-awesome-11ty/starters/
|
|
504
499
|
- https://blades.ninja/css/frameworks/
|
|
@@ -513,56 +508,55 @@ Living examples: <!--A-Z-->
|
|
|
513
508
|
|
|
514
509
|
The `<pre><code>` blocks are Prism-compatible and support captions via `data-caption="..."` attribute:
|
|
515
510
|
|
|
516
|
-
```treeview {data-caption="
|
|
511
|
+
```treeview {data-caption="Blades CSS:"}
|
|
512
|
+
./assets/
|
|
517
513
|
├── blades.core.css # reusable class-light utilities, unthemed
|
|
518
514
|
├── blades.theme.css # minimal opinionated theme
|
|
519
515
|
└── blades.css # above two together
|
|
520
516
|
```
|
|
521
|
-
|
|
522
517
|
<details>How it works:
|
|
523
518
|
```css */
|
|
524
519
|
|
|
525
520
|
pre {
|
|
526
521
|
padding: 1rem 1.5rem;
|
|
527
522
|
padding-inline-end: 2rem;
|
|
523
|
+
}
|
|
528
524
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
525
|
+
@media (max-width: 767px) {
|
|
526
|
+
|
|
527
|
+
pre {
|
|
528
|
+
border-radius: 0
|
|
532
529
|
}
|
|
530
|
+
}
|
|
533
531
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
&::before {
|
|
532
|
+
/* Code block caption via data-attr (to display filename, etc.) */
|
|
533
|
+
|
|
534
|
+
code[data-caption]::before {
|
|
538
535
|
content: attr(data-caption);
|
|
539
536
|
display: block;
|
|
540
537
|
margin-bottom: 1rem;
|
|
541
538
|
opacity: 50%;
|
|
542
539
|
font-style: italic;
|
|
543
540
|
}
|
|
544
|
-
}
|
|
545
541
|
|
|
546
|
-
|
|
542
|
+
code:where(pre > *) {
|
|
547
543
|
padding: 0;
|
|
548
544
|
}
|
|
549
|
-
}
|
|
550
545
|
|
|
551
546
|
/* Extends https://github.com/PrismJS/prism/blob/master/plugins/treeview/prism-treeview.css */
|
|
552
547
|
|
|
553
|
-
.token.treeview-part {
|
|
554
|
-
.entry-line {
|
|
548
|
+
.token.treeview-part .entry-line {
|
|
555
549
|
width: 2.5em !important;
|
|
556
550
|
opacity: 25%;
|
|
557
551
|
}
|
|
558
|
-
|
|
552
|
+
|
|
553
|
+
.token.treeview-part .entry-name:last-child {
|
|
559
554
|
opacity: 50%;
|
|
555
|
+
}
|
|
560
556
|
|
|
561
|
-
|
|
557
|
+
.token.treeview-part .entry-name:last-child::before {
|
|
562
558
|
display: none !important;
|
|
563
559
|
}
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
560
|
|
|
567
561
|
/*```
|
|
568
562
|
</details>
|
|
@@ -582,33 +576,53 @@ label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea
|
|
|
582
576
|
.has-float-label {
|
|
583
577
|
display: block;
|
|
584
578
|
position: relative;
|
|
585
|
-
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/*
|
|
586
582
|
```
|
|
587
583
|
Then, we define the default/fallback state (when the float label should be minimized):
|
|
588
584
|
```css */
|
|
589
|
-
|
|
590
|
-
|
|
585
|
+
|
|
586
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) > span,
|
|
587
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) label,
|
|
588
|
+
.has-float-label > span,
|
|
589
|
+
.has-float-label label {
|
|
591
590
|
position: absolute;
|
|
592
591
|
left: 0;
|
|
593
592
|
top: 0;
|
|
594
593
|
cursor: text;
|
|
595
594
|
font-size: 75%;
|
|
596
595
|
}
|
|
597
|
-
|
|
596
|
+
|
|
597
|
+
/*
|
|
598
598
|
```
|
|
599
599
|
Finally, we detect if placeholder is shown, but not in focus. That means we can safely hide it, and enlarge the float label instead:
|
|
600
600
|
```css */
|
|
601
|
-
|
|
601
|
+
|
|
602
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) *:placeholder-shown:not(:focus)::-moz-placeholder, .has-float-label *:placeholder-shown:not(:focus)::-moz-placeholder {
|
|
603
|
+
opacity: 0;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) *:-moz-placeholder:not(:focus)::placeholder, .has-float-label *:-moz-placeholder:not(:focus)::placeholder {
|
|
602
607
|
opacity: 0;
|
|
603
608
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
609
|
+
|
|
610
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) *:placeholder-shown:not(:focus)::placeholder, .has-float-label *:placeholder-shown:not(:focus)::placeholder {
|
|
611
|
+
opacity: 0;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:-moz-placeholder:not(:focus)) > span, label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:-moz-placeholder:not(:focus)) label, .has-float-label:has(*:-moz-placeholder:not(:focus)) > span, .has-float-label:has(*:-moz-placeholder:not(:focus)) label {
|
|
615
|
+
font-size: inherit;
|
|
616
|
+
opacity: 50%;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:placeholder-shown:not(:focus)) > span,
|
|
620
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:placeholder-shown:not(:focus)) label,
|
|
621
|
+
.has-float-label:has(*:placeholder-shown:not(:focus)) > span,
|
|
622
|
+
.has-float-label:has(*:placeholder-shown:not(:focus)) label {
|
|
607
623
|
font-size: inherit;
|
|
608
624
|
opacity: 50%;
|
|
609
625
|
}
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
626
|
|
|
613
627
|
/*
|
|
614
628
|
```
|
|
@@ -640,16 +654,22 @@ Historically, this was not possible: the float label had to be placed after the
|
|
|
640
654
|
}
|
|
641
655
|
|
|
642
656
|
.dark-auto {
|
|
643
|
-
/* Dark color scheme (Auto) */
|
|
644
|
-
@media (prefers-color-scheme: dark) {
|
|
645
|
-
filter: var(--blades-dark-filter);
|
|
646
|
-
}
|
|
647
657
|
/* Dark color scheme (Forced) */
|
|
648
|
-
|
|
649
|
-
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/* Dark color scheme (Auto) */
|
|
661
|
+
|
|
662
|
+
@media (prefers-color-scheme: dark) {
|
|
663
|
+
|
|
664
|
+
.dark-auto {
|
|
665
|
+
filter: var(--blades-dark-filter)
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
.dark-auto[data-theme="dark"],
|
|
670
|
+
.dark-auto:where([data-theme="dark"] *) {
|
|
650
671
|
filter: var(--blades-dark-filter);
|
|
651
672
|
}
|
|
652
|
-
}
|
|
653
673
|
|
|
654
674
|
/*```
|
|
655
675
|
</details>
|
|
@@ -667,11 +687,11 @@ Historically, this was not possible: the float label had to be placed after the
|
|
|
667
687
|
|
|
668
688
|
.faded {
|
|
669
689
|
opacity: 50%;
|
|
690
|
+
}
|
|
670
691
|
|
|
671
|
-
|
|
692
|
+
.faded:hover {
|
|
672
693
|
opacity: 87.5%;
|
|
673
694
|
}
|
|
674
|
-
}
|
|
675
695
|
|
|
676
696
|
/*```
|
|
677
697
|
</details>
|
|
@@ -679,8 +699,6 @@ Historically, this was not possible: the float label had to be placed after the
|
|
|
679
699
|
|
|
680
700
|
/* Fix the scrollbar color when inverted by https://tailwindcss.com/docs/filter-invert */
|
|
681
701
|
|
|
682
|
-
.invert {
|
|
683
|
-
::-webkit-scrollbar {
|
|
702
|
+
.invert ::-webkit-scrollbar {
|
|
684
703
|
filter: invert(1) !important;
|
|
685
704
|
}
|
|
686
|
-
}
|