blades 2.3.3
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.
- checksums.yaml +7 -0
- data/_includes/blades/html.liquid +49 -0
- data/_includes/blades/html.njk +52 -0
- data/_includes/blades/html.twig +52 -0
- data/_includes/blades/links.liquid +21 -0
- data/_includes/blades/links.twig +18 -0
- data/_includes/blades/sitemap.xml.njk +25 -0
- data/_includes/blades/sitemap.xml.twig +23 -0
- data/css/blades.css +3763 -0
- data/css/blades.standalone.core.css +720 -0
- data/css/blades.standalone.css +878 -0
- data/css/blades.standalone.theme.css +129 -0
- data/css/breakout.css +125 -0
- data/css/float-label.core.css +56 -0
- data/css/float-label.css +96 -0
- data/css/float-label.theme.css +39 -0
- data/css/link-icon.css +59 -0
- data/css/responsive-table.css +57 -0
- metadata +79 -0
|
@@ -0,0 +1,878 @@
|
|
|
1
|
+
/* Follows https://github.com/picocss/pico/blob/main/scss/_index.scss */
|
|
2
|
+
|
|
3
|
+
/* Layout */
|
|
4
|
+
|
|
5
|
+
/* Extends https://github.com/picocss/pico/blob/main/scss/layout/
|
|
6
|
+
\3c !--section:docs,columns-->
|
|
7
|
+
|
|
8
|
+
### Auto-columns
|
|
9
|
+
|
|
10
|
+
`.columns` automatically creates columns with at least 30 characters each:
|
|
11
|
+
|
|
12
|
+
<article class="columns">
|
|
13
|
+
<p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p>
|
|
14
|
+
</article>
|
|
15
|
+
|
|
16
|
+
The smaller the font size, the more columns will be created:
|
|
17
|
+
|
|
18
|
+
<article class="columns" style="font-size: 65%">
|
|
19
|
+
<p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p><p>7</p><p>8</p><p>9</p>
|
|
20
|
+
</article>
|
|
21
|
+
|
|
22
|
+
Useful for tables of contents and long lists.
|
|
23
|
+
|
|
24
|
+
How it works:
|
|
25
|
+
```css */
|
|
26
|
+
|
|
27
|
+
.columns {
|
|
28
|
+
-moz-columns: 25ch auto;
|
|
29
|
+
columns: 25ch auto; /* common container 65ch / 25ch => 2 columns max, with a buffer for list paddings */
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Avoid breaking inside elements, such as nested lists */
|
|
33
|
+
|
|
34
|
+
.columns > * {
|
|
35
|
+
-moz-column-break-inside: avoid;
|
|
36
|
+
break-inside: avoid;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/*```
|
|
40
|
+
\3c !--section:docs,jump-->
|
|
41
|
+
|
|
42
|
+
### Jump to top
|
|
43
|
+
|
|
44
|
+
`data-jump-to="top"` fixes element to the corner and adds extra top padding to make it easy to click:
|
|
45
|
+
```css */
|
|
46
|
+
|
|
47
|
+
[data-jump-to="top"] {
|
|
48
|
+
position: fixed;
|
|
49
|
+
right: 0;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
padding-top: 50vh;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/*```
|
|
55
|
+
\3c !--section--> */
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
\3c !--section:code-->
|
|
59
|
+
```css */
|
|
60
|
+
|
|
61
|
+
.breakout,
|
|
62
|
+
.breakout-all {
|
|
63
|
+
max-width: calc(10% + 65ch + 10%);
|
|
64
|
+
/* Prepare the container for breakout elements */
|
|
65
|
+
padding-inline: 10%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@media (width < 768px) {
|
|
69
|
+
|
|
70
|
+
.breakout,
|
|
71
|
+
.breakout-all {
|
|
72
|
+
max-width: calc(1rem + 65ch + 1rem);
|
|
73
|
+
padding-inline: 1rem
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Breakout direct children only */
|
|
78
|
+
|
|
79
|
+
.breakout > *:is(
|
|
80
|
+
table,
|
|
81
|
+
pre,
|
|
82
|
+
figure, video, iframe, canvas,
|
|
83
|
+
img, picture,
|
|
84
|
+
|
|
85
|
+
.breakout-item,
|
|
86
|
+
.breakout-item-max
|
|
87
|
+
),
|
|
88
|
+
.breakout-all > *:is(
|
|
89
|
+
table,
|
|
90
|
+
pre,
|
|
91
|
+
figure, video, iframe, canvas,
|
|
92
|
+
img, picture,
|
|
93
|
+
|
|
94
|
+
.breakout-item,
|
|
95
|
+
.breakout-item-max
|
|
96
|
+
) {
|
|
97
|
+
width: -moz-fit-content;
|
|
98
|
+
width: fit-content;
|
|
99
|
+
min-width: 100%;
|
|
100
|
+
max-width: min(125%, 100dvw);
|
|
101
|
+
margin-left: 50%;
|
|
102
|
+
transform: translateX(-50%);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Respect img/picture min-width */
|
|
106
|
+
|
|
107
|
+
.breakout > *:is(img, picture), .breakout-all > *:is(img, picture) {
|
|
108
|
+
min-width: auto;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Max out the width of the element */
|
|
112
|
+
|
|
113
|
+
.breakout > *.breakout-item-max, .breakout-all > *.breakout-item-max {
|
|
114
|
+
width: min(125%, 100dvw) !important; /* !important is for cases like figure.breakout-item-max @TODO */
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.breakout-all > *:is(h2, h3, h4, h5, h6, hr):not([class]) {
|
|
118
|
+
position: relative;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.breakout-all > *:is(h2, h3, h4, h5, h6, hr):not([class])::before {
|
|
122
|
+
display: block;
|
|
123
|
+
position: absolute;
|
|
124
|
+
background: gray;
|
|
125
|
+
content: "";
|
|
126
|
+
opacity: 12.5%;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.breakout-all > *:is(h2, h3, h4, h5, h6):not([class])::before {
|
|
130
|
+
top: 50%;
|
|
131
|
+
right: 100%;
|
|
132
|
+
width: 10em;
|
|
133
|
+
height: 0.25em;
|
|
134
|
+
margin-right: 0.8ch;
|
|
135
|
+
transform: translateY(-50%);
|
|
136
|
+
background: linear-gradient(to left, gray, transparent);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* @TODO: add to tricks-wiki why `*` works here, but `&` fails */
|
|
140
|
+
|
|
141
|
+
.breakout-all > *:is(h2, h3, h4, h5, h6):not([class]):where(hr + *)::before {
|
|
142
|
+
display: none !important;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.breakout-all > *:is(hr) {
|
|
146
|
+
height: 0.5rem;
|
|
147
|
+
overflow: visible;
|
|
148
|
+
border: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.breakout-all > *:is(hr)::before {
|
|
152
|
+
left: 50%;
|
|
153
|
+
width: 100dvw;
|
|
154
|
+
height: 100%;
|
|
155
|
+
transform: translateX(-50%);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/*```
|
|
159
|
+
\3c !--section:summary-->
|
|
160
|
+
|
|
161
|
+
The `.breakout` layout allows images, tables, and other figures to automatically extend or bleed beyond their parent container’s width.
|
|
162
|
+
|
|
163
|
+
\3c !--section:docs-->
|
|
164
|
+
|
|
165
|
+
### Demo \3c !-- inside parent .breakout -->
|
|
166
|
+
|
|
167
|
+
Break out a wide image from the text flow:
|
|
168
|
+
|
|
169
|
+
<div>\3c !-- Dummy div to avoid p tag in Markdown --></div><img
|
|
170
|
+
src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='3000' height='300'><rect width='100%' height='100%' fill='gray'/></svg>">
|
|
171
|
+
|
|
172
|
+
Or table:
|
|
173
|
+
|
|
174
|
+
| Imagine<hr> | a<hr> | really<hr> | wide<hr> | table<hr> | here<hr> |
|
|
175
|
+
| ----------- | ----- | ---------- | -------- | --------- | -------- |
|
|
176
|
+
| ... |
|
|
177
|
+
|
|
178
|
+
Or code block:
|
|
179
|
+
|
|
180
|
+
```html
|
|
181
|
+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quod. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quod.</p>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Or anything else:
|
|
185
|
+
|
|
186
|
+
<article class="breakout-item-max" data-theme="dark">
|
|
187
|
+
|
|
188
|
+
Using `.breakout-item` and `.breakout-item-max` helpers {style=margin:0}
|
|
189
|
+
</article>
|
|
190
|
+
|
|
191
|
+
<div><hr></div>
|
|
192
|
+
|
|
193
|
+
`.breakout-all` also visually breaks out headings and horizontal rules:
|
|
194
|
+
|
|
195
|
+
<h2>Heading 2</h2><h3>Heading 3</h3><h4>Heading 4</h4><h5>Heading 5</h5><h6>Heading 6</h6>
|
|
196
|
+
<hr>
|
|
197
|
+
|
|
198
|
+
\3c !--section--> */
|
|
199
|
+
|
|
200
|
+
/* Content */
|
|
201
|
+
|
|
202
|
+
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_typography.scss
|
|
203
|
+
\3c !--section:docs,h-anchor-->
|
|
204
|
+
|
|
205
|
+
### Heading anchors
|
|
206
|
+
|
|
207
|
+
Links with `href="#..."` inside headings are automatically displayed as anchors:
|
|
208
|
+
|
|
209
|
+
<article>
|
|
210
|
+
<h2 style="margin: 0 0 0 1.5rem">Heading with anchor <a href="#hwa" style="visibility: visible">#</a></h2>
|
|
211
|
+
</article>
|
|
212
|
+
|
|
213
|
+
How it works:
|
|
214
|
+
```css */
|
|
215
|
+
|
|
216
|
+
h1,
|
|
217
|
+
h2,
|
|
218
|
+
h3,
|
|
219
|
+
h4,
|
|
220
|
+
h5,
|
|
221
|
+
h6 {
|
|
222
|
+
position: relative;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
h1 a[aria-hidden="true"], h2 a[aria-hidden="true"], h3 a[aria-hidden="true"], h4 a[aria-hidden="true"], h5 a[aria-hidden="true"], h6 a[aria-hidden="true"] {
|
|
226
|
+
visibility: hidden;
|
|
227
|
+
position: absolute;
|
|
228
|
+
top: 50%;
|
|
229
|
+
right: 100%;
|
|
230
|
+
padding-right: 0.2ch;
|
|
231
|
+
transform: translateY(-50%);
|
|
232
|
+
color: silver;
|
|
233
|
+
text-decoration: none;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@media /* to avoid double-tap on touch devices */ (hover: hover) {
|
|
237
|
+
h1:hover a[aria-hidden="true"], h2:hover a[aria-hidden="true"], h3:hover a[aria-hidden="true"], h4:hover a[aria-hidden="true"], h5:hover a[aria-hidden="true"], h6:hover a[aria-hidden="true"] {
|
|
238
|
+
visibility: visible;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/*```
|
|
243
|
+
|
|
244
|
+
**PRO** example of automatic anchors for `11ty`+`markdown-it-anchor`: https://github.com/anyblades/eleventy-blades/blob/main/src/eleventy.config.js
|
|
245
|
+
|
|
246
|
+
\3c !--section:docs,list-->
|
|
247
|
+
|
|
248
|
+
### List markers
|
|
249
|
+
|
|
250
|
+
Customize markers using inline `style="--list-marker:..."` on `<ul>/<ol>` or even individual `<li>`:
|
|
251
|
+
|
|
252
|
+
<article>
|
|
253
|
+
|
|
254
|
+
- you
|
|
255
|
+
- can
|
|
256
|
+
- make
|
|
257
|
+
- really
|
|
258
|
+
- cool markers {style="--list-marker:'🧊 '"}
|
|
259
|
+
- with
|
|
260
|
+
- *Bl*ades {style="--list-marker:'🥷 '"}
|
|
261
|
+
|
|
262
|
+
{style="--list-marker:'→ '"}
|
|
263
|
+
</article>
|
|
264
|
+
|
|
265
|
+
How it works:
|
|
266
|
+
```css */
|
|
267
|
+
|
|
268
|
+
ul[style*="--list-marker:"], ol[style*="--list-marker:"] {
|
|
269
|
+
list-style-type: var(--list-marker);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
ul[style*="--list-marker:"] > li, ol[style*="--list-marker:"] > li {
|
|
273
|
+
list-style-type: inherit;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
ul li[style*="--list-marker:"], ol li[style*="--list-marker:"] {
|
|
277
|
+
list-style-type: var(--list-marker);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
ul li[data-marker]::marker, ol li[data-marker]::marker {
|
|
281
|
+
content: attr(data-marker) " "; /* ⚠️ Chrome and Firefox only */
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/*```
|
|
285
|
+
|
|
286
|
+
### Markerless
|
|
287
|
+
|
|
288
|
+
`.markerless` removes markers and reduces padding:
|
|
289
|
+
|
|
290
|
+
<article>
|
|
291
|
+
|
|
292
|
+
- 1️⃣ so you can use
|
|
293
|
+
- 2️⃣ emojis or images
|
|
294
|
+
- 3️⃣ instead of bullets
|
|
295
|
+
|
|
296
|
+
{.markerless}
|
|
297
|
+
</article>
|
|
298
|
+
|
|
299
|
+
How it works:
|
|
300
|
+
```css */
|
|
301
|
+
|
|
302
|
+
ul.markerless, ol.markerless {
|
|
303
|
+
padding-inline-start: 1.25rem;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
ul.markerless li, ol.markerless li {
|
|
307
|
+
list-style: none;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/*```
|
|
311
|
+
|
|
312
|
+
### Unlist
|
|
313
|
+
|
|
314
|
+
`.unlist` removes list styling at all:
|
|
315
|
+
|
|
316
|
+
<article>
|
|
317
|
+
|
|
318
|
+
- One: <article>1</article>
|
|
319
|
+
- Two: <article>2</article>
|
|
320
|
+
- Three: <article>3</article>
|
|
321
|
+
|
|
322
|
+
{.unlist .grid style=margin:0}
|
|
323
|
+
</article>
|
|
324
|
+
|
|
325
|
+
`.unlist-all` removes styling from all nested lists too.
|
|
326
|
+
|
|
327
|
+
How it works:
|
|
328
|
+
```css */
|
|
329
|
+
|
|
330
|
+
ul.unlist,
|
|
331
|
+
ul.unlist-all,
|
|
332
|
+
.unlist-all ul,
|
|
333
|
+
ol.unlist,
|
|
334
|
+
ol.unlist-all,
|
|
335
|
+
.unlist-all ol {
|
|
336
|
+
padding-inline-start: 0;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
ul.unlist > li, ul.unlist-all > li, .unlist-all ul > li, ol.unlist > li, ol.unlist-all > li, .unlist-all ol > li {
|
|
340
|
+
list-style: none;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/*```
|
|
344
|
+
\3c !--section--> */
|
|
345
|
+
|
|
346
|
+
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
|
|
347
|
+
\3c !--section:code-->
|
|
348
|
+
```css */
|
|
349
|
+
|
|
350
|
+
/* Use inline flex only if link contains an icon */
|
|
351
|
+
|
|
352
|
+
a:has(> i) {
|
|
353
|
+
display: inline-flex;
|
|
354
|
+
overflow-y: clip; /* to work in pair with text-underline-offset in Safari */
|
|
355
|
+
gap: 0.375ch; /* =3/8 */
|
|
356
|
+
text-wrap: balance;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
a > i {
|
|
360
|
+
float: left; /* ✅ Chrome ❌ Safari */
|
|
361
|
+
font-style: normal;
|
|
362
|
+
text-underline-offset: -2em; /* ❌ Chrome ✅ Safari - to clip it with overflow-y */
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/* Favicons */
|
|
366
|
+
|
|
367
|
+
a > i > img {
|
|
368
|
+
display: inline-block; /* for Tailwind CSS Typography */
|
|
369
|
+
max-width: none; /* to keep ratio safe */
|
|
370
|
+
height: 1.25em;
|
|
371
|
+
margin-block-start: calc(-0.25em / 2);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
a > i[class^="fa-"],
|
|
375
|
+
a > i[class*=" fa-"] {
|
|
376
|
+
line-height: inherit;
|
|
377
|
+
--fa-width: auto;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/* Font Awesome */
|
|
381
|
+
|
|
382
|
+
a > i.fa-lg {
|
|
383
|
+
line-height: normal;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/*```
|
|
387
|
+
\3c !--section:summary-->
|
|
388
|
+
|
|
389
|
+
Use *Bl*ades `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links.
|
|
390
|
+
It automatically handles sizing and alignment while preventing underline on icons.
|
|
391
|
+
|
|
392
|
+
\3c !--section:docs-->
|
|
393
|
+
|
|
394
|
+
<article class="breakout-item">
|
|
395
|
+
|
|
396
|
+
| Use `<i>`-helper with | Clean HTML without `<span>ning` |
|
|
397
|
+
| ------------------------------------------------------------------------------------- | ------------------------------------ |
|
|
398
|
+
| [<i>🥷</i> Emojis](#) | `<a><i>🥷</i> Text</a>` |
|
|
399
|
+
| [<i></i> Favicons](#) | `<a><i><img src="..."></i> Text</a>` |
|
|
400
|
+
| [<i class="fa-brands fa-github fa-lg"></i> Font Awesome icons](#) | `<a><i class="fa-..."></i> Text</a>` |
|
|
401
|
+
</article>
|
|
402
|
+
|
|
403
|
+
Or even for:
|
|
404
|
+
|
|
405
|
+
<article>
|
|
406
|
+
<a href="#" style="margin: 0 0 0 1rem"><i>🥷</i> very-very-very-very-very-<br>long-multiline-links</a>
|
|
407
|
+
</article>
|
|
408
|
+
|
|
409
|
+
How we made it: https://codepen.io/editor/anydigital/pen/019d2b94-5616-75dc-a23e-e111869d5237
|
|
410
|
+
|
|
411
|
+
**PRO** example of automatic favicons for `11ty`: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
|
|
412
|
+
|
|
413
|
+
\3c !--section--> */
|
|
414
|
+
|
|
415
|
+
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_table.scss
|
|
416
|
+
\3c !--section:docs-->
|
|
417
|
+
|
|
418
|
+
### Column expanders
|
|
419
|
+
|
|
420
|
+
Place `<hr>` element inside `<th>` column to expand it horizontally:
|
|
421
|
+
|
|
422
|
+
<article>
|
|
423
|
+
|
|
424
|
+
| Column with `<hr>`<hr> | Same column without `<hr>` | ... {style=width:100%} |
|
|
425
|
+
| --- | --- | --- |
|
|
426
|
+
| (012) 345-6789 | (012) 345-6789 |
|
|
427
|
+
</article>
|
|
428
|
+
|
|
429
|
+
Living examples of big tables with `<hr>`-expanders: \3c !--A-Z-->
|
|
430
|
+
- https://blades.ninja/ai/ide/
|
|
431
|
+
- https://blades.ninja/build-awesome-11ty/starters/
|
|
432
|
+
- https://blades.ninja/css/frameworks/
|
|
433
|
+
- https://blades.ninja/ssg/
|
|
434
|
+
|
|
435
|
+
How it works:
|
|
436
|
+
```css */
|
|
437
|
+
|
|
438
|
+
th hr {
|
|
439
|
+
visibility: hidden;
|
|
440
|
+
width: 12ch; /* min ~65/12 = ~5 cols */
|
|
441
|
+
height: 0;
|
|
442
|
+
margin: 0;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
th hr.lg {
|
|
446
|
+
width: 18ch;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
th hr.x2 {
|
|
450
|
+
width: 24ch;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/*```
|
|
454
|
+
|
|
455
|
+
### Borderless table
|
|
456
|
+
|
|
457
|
+
`.borderless` removes all default borders:
|
|
458
|
+
|
|
459
|
+
<article>
|
|
460
|
+
|
|
461
|
+
| Less | borders |
|
|
462
|
+
| ---- | ------- |
|
|
463
|
+
| More | fun |
|
|
464
|
+
|
|
465
|
+
{.borderless}
|
|
466
|
+
</article>
|
|
467
|
+
|
|
468
|
+
Living example: https://bladeswitch.com/#minimal-dependencies table
|
|
469
|
+
|
|
470
|
+
\3c !--section--> */
|
|
471
|
+
|
|
472
|
+
table.borderless th,
|
|
473
|
+
table.borderless td {
|
|
474
|
+
border: none;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/*
|
|
478
|
+
\3c !--section:code-->
|
|
479
|
+
```css */
|
|
480
|
+
|
|
481
|
+
table.responsive,
|
|
482
|
+
.breakout > table:not(.does-not-exist),
|
|
483
|
+
.breakout-all > table:not(.does-not-exist) {
|
|
484
|
+
|
|
485
|
+
/* Let them scroll */
|
|
486
|
+
display: block;
|
|
487
|
+
|
|
488
|
+
/* Let them full-bleed */
|
|
489
|
+
width: -moz-max-content;
|
|
490
|
+
width: max-content;
|
|
491
|
+
min-width: auto;
|
|
492
|
+
max-width: 100dvw;
|
|
493
|
+
/* Center horizontally */
|
|
494
|
+
margin-left: 50%;
|
|
495
|
+
padding-inline: 7.5%;
|
|
496
|
+
overflow-x: auto;
|
|
497
|
+
transform: translateX(-50%);
|
|
498
|
+
-webkit-overflow-scrolling: touch; /* Smooth scroll for iOS */
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
table.responsive th,
|
|
502
|
+
table.responsive td,
|
|
503
|
+
.breakout > table:not(.does-not-exist) th,
|
|
504
|
+
.breakout > table:not(.does-not-exist) td,
|
|
505
|
+
.breakout-all > table:not(.does-not-exist) th,
|
|
506
|
+
.breakout-all > table:not(.does-not-exist) td {
|
|
507
|
+
padding-inline-start: 0;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/*```
|
|
511
|
+
`table:not(.does-not-exist)` trick (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
|
|
512
|
+
|
|
513
|
+
\3c !--section:summary-->
|
|
514
|
+
|
|
515
|
+
`.responsive` makes a table full-bleed and scroll on mobile, without a need for a redundant wrapper (finally).
|
|
516
|
+
Tables inside https://blades.ninja/css/breakout/ are responsive by default.
|
|
517
|
+
|
|
518
|
+
\3c !--section:docs-->
|
|
519
|
+
|
|
520
|
+
### Demo table
|
|
521
|
+
|
|
522
|
+
| Term | Description <hr class="x2"> | Link |
|
|
523
|
+
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
524
|
+
| Responsive design | Approach to web design that aims to make web pages render well on a variety of devices and window or screen sizes from minimum to maximum display size to ensure usability and satisfaction. | https://en.wikipedia.org/wiki/Responsive_web_design |
|
|
525
|
+
|
|
526
|
+
{.responsive}
|
|
527
|
+
|
|
528
|
+
---
|
|
529
|
+
|
|
530
|
+
Living examples: \3c !--A-Z-->
|
|
531
|
+
- https://blades.ninja/ai/ide/
|
|
532
|
+
- https://blades.ninja/build-awesome-11ty/starters/
|
|
533
|
+
- https://blades.ninja/css/frameworks/
|
|
534
|
+
- https://blades.ninja/ssg/
|
|
535
|
+
|
|
536
|
+
\3c !--section--> */
|
|
537
|
+
|
|
538
|
+
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_code.scss
|
|
539
|
+
\3c !--section:docs-->
|
|
540
|
+
|
|
541
|
+
### Code
|
|
542
|
+
|
|
543
|
+
The `<pre><code>` blocks are Prism-compatible and support captions via `data-caption="..."` attribute:
|
|
544
|
+
|
|
545
|
+
```treeview {data-caption="Blades CSS:"}
|
|
546
|
+
./css/
|
|
547
|
+
├── blades.core.css # reusable class-light utilities, unthemed
|
|
548
|
+
├── blades.theme.css # minimal opinionated theme
|
|
549
|
+
└── blades.css # above two together
|
|
550
|
+
```
|
|
551
|
+
How it works:
|
|
552
|
+
```css */
|
|
553
|
+
|
|
554
|
+
pre {
|
|
555
|
+
padding: 1rem 1.5rem;
|
|
556
|
+
padding-inline-end: 2rem;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
@media (max-width: 767px) {
|
|
560
|
+
|
|
561
|
+
pre {
|
|
562
|
+
border-radius: 0
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/* Code block caption via data-attr (to display filename, etc.) */
|
|
567
|
+
|
|
568
|
+
code[data-caption]::before {
|
|
569
|
+
display: block;
|
|
570
|
+
margin-bottom: 1rem;
|
|
571
|
+
content: attr(data-caption);
|
|
572
|
+
font-style: italic;
|
|
573
|
+
opacity: 50%;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
code:where(pre > *) {
|
|
577
|
+
padding: 0;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/*```
|
|
581
|
+
\3c !--section--> */
|
|
582
|
+
|
|
583
|
+
/* Forms */
|
|
584
|
+
|
|
585
|
+
/* Moved here from https://github.com/anyblades/float-label-css for easier maintenance
|
|
586
|
+
\3c !--section:docs-->
|
|
587
|
+
|
|
588
|
+
First, we target either:
|
|
589
|
+
1. `<label>` which `:has` inner form inputs (classless approach)
|
|
590
|
+
2. or explicit `.has-float-label` class (alternative approach)
|
|
591
|
+
```css */
|
|
592
|
+
|
|
593
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select),
|
|
594
|
+
.has-float-label {
|
|
595
|
+
display: block;
|
|
596
|
+
position: relative;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/*
|
|
600
|
+
```
|
|
601
|
+
Then, we define the default/fallback state (when the float label should be minimized):
|
|
602
|
+
```css */
|
|
603
|
+
|
|
604
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) > span,
|
|
605
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) label,
|
|
606
|
+
.has-float-label > span,
|
|
607
|
+
.has-float-label label {
|
|
608
|
+
position: absolute;
|
|
609
|
+
top: 0;
|
|
610
|
+
left: 0;
|
|
611
|
+
font-size: 75%;
|
|
612
|
+
cursor: text;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/*
|
|
616
|
+
```
|
|
617
|
+
Finally, we detect if placeholder is shown, but not in focus. That means we can safely hide it, and enlarge the float label instead:
|
|
618
|
+
```css */
|
|
619
|
+
|
|
620
|
+
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 {
|
|
621
|
+
opacity: 0;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
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 {
|
|
625
|
+
opacity: 0;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
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 {
|
|
629
|
+
opacity: 0;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
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 {
|
|
633
|
+
font-size: inherit;
|
|
634
|
+
opacity: 50%;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:placeholder-shown:not(:focus)) > span,
|
|
638
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:placeholder-shown:not(:focus)) label,
|
|
639
|
+
.has-float-label:has(*:placeholder-shown:not(:focus)) > span,
|
|
640
|
+
.has-float-label:has(*:placeholder-shown:not(:focus)) label {
|
|
641
|
+
font-size: inherit;
|
|
642
|
+
opacity: 50%;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/*
|
|
646
|
+
```
|
|
647
|
+
The `:has(*:placeholder-shown:not(:focus))` trick allows this input state information to *propagate* to the parent level. This enables modern CSS to target inner float label (`<span>` or `<label>`) regardless of its position relative to the input field.
|
|
648
|
+
|
|
649
|
+
Historically, this was not possible: the float label had to be placed after the input field to be targeted using the `input:focus + label` selector.
|
|
650
|
+
\3c !--section--> */
|
|
651
|
+
|
|
652
|
+
/* Utilities */
|
|
653
|
+
|
|
654
|
+
/* Extends https://github.com/picocss/pico/tree/main/scss/utilities
|
|
655
|
+
\3c !--section:docs-->
|
|
656
|
+
|
|
657
|
+
### Auto-dark
|
|
658
|
+
|
|
659
|
+
`.dark-auto` automatically creates a simple dark version of any element:
|
|
660
|
+
|
|
661
|
+
<article data-theme="dark">
|
|
662
|
+
<p>Look how cool <big class="dark-auto">🔥🕷️🐦⬛🐄🦓</big> can look in the dark!</p>
|
|
663
|
+
</article>
|
|
664
|
+
|
|
665
|
+
How it works:
|
|
666
|
+
```css */
|
|
667
|
+
|
|
668
|
+
/* Per https://picocss.com/docs/css-variables#css-variables-for-color-schemes */
|
|
669
|
+
|
|
670
|
+
:root {
|
|
671
|
+
--blades-dark-filter: invert(100%) hue-rotate(180deg);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.dark-auto {
|
|
675
|
+
/* Dark color scheme (Forced) */
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/* Dark color scheme (Auto) */
|
|
679
|
+
|
|
680
|
+
@media (prefers-color-scheme: dark) {
|
|
681
|
+
|
|
682
|
+
.dark-auto {
|
|
683
|
+
filter: var(--blades-dark-filter)
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
.dark-auto[data-theme="dark"],
|
|
688
|
+
.dark-auto:where([data-theme="dark"] *) {
|
|
689
|
+
filter: var(--blades-dark-filter);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/*```
|
|
693
|
+
|
|
694
|
+
### Faded
|
|
695
|
+
|
|
696
|
+
`.faded` reduces the opacity of an element:
|
|
697
|
+
|
|
698
|
+
<article class="faded">
|
|
699
|
+
Hover to unfade me!
|
|
700
|
+
</article>
|
|
701
|
+
|
|
702
|
+
How it works:
|
|
703
|
+
```css */
|
|
704
|
+
|
|
705
|
+
.faded {
|
|
706
|
+
opacity: 50%;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.faded:hover {
|
|
710
|
+
opacity: 87.5%;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/*```
|
|
714
|
+
\3c !--section--> */
|
|
715
|
+
|
|
716
|
+
/* Fix the scrollbar color when inverted by https://tailwindcss.com/docs/filter-invert */
|
|
717
|
+
|
|
718
|
+
.invert ::-webkit-scrollbar {
|
|
719
|
+
filter: invert(1) !important;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/*
|
|
723
|
+
\3c !--section:code-->
|
|
724
|
+
```css */
|
|
725
|
+
|
|
726
|
+
/* Default/fallback state */
|
|
727
|
+
|
|
728
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) > span,
|
|
729
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) label,
|
|
730
|
+
.has-float-label > span,
|
|
731
|
+
.has-float-label label {
|
|
732
|
+
padding-inline-start: calc(1rem + 1px); /* match Pico's padding + border */
|
|
733
|
+
padding-block-start: 0.25rem;
|
|
734
|
+
opacity: 75%;
|
|
735
|
+
transition: all 0.25s;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) input,
|
|
739
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) textarea,
|
|
740
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) select,
|
|
741
|
+
.has-float-label input,
|
|
742
|
+
.has-float-label textarea,
|
|
743
|
+
.has-float-label select {
|
|
744
|
+
margin-block-start: 0; /* reset Pico */
|
|
745
|
+
padding-inline-start: 1rem; /* match Pico */
|
|
746
|
+
padding-block: 1.125rem 0.375rem; /* match Pico's total: 2 x 0.75rem = 1.5rem */
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) input::-moz-placeholder, label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) textarea::-moz-placeholder, label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) select::-moz-placeholder, .has-float-label input::-moz-placeholder, .has-float-label textarea::-moz-placeholder, .has-float-label select::-moz-placeholder {
|
|
750
|
+
opacity: 100%;
|
|
751
|
+
-moz-transition: all 0.25s;
|
|
752
|
+
transition: all 0.25s;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) input::placeholder, label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) textarea::placeholder, label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) select::placeholder, .has-float-label input::placeholder, .has-float-label textarea::placeholder, .has-float-label select::placeholder {
|
|
756
|
+
opacity: 100%;
|
|
757
|
+
transition: all 0.25s;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/* Enlarged state */
|
|
761
|
+
|
|
762
|
+
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 {
|
|
763
|
+
padding-block: 0.75rem; /* match Pico */
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:placeholder-shown:not(:focus)) > span,
|
|
767
|
+
label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):has(*:placeholder-shown:not(:focus)) label,
|
|
768
|
+
.has-float-label:has(*:placeholder-shown:not(:focus)) > span,
|
|
769
|
+
.has-float-label:has(*:placeholder-shown:not(:focus)) label {
|
|
770
|
+
padding-block: 0.75rem; /* match Pico */
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
html {
|
|
774
|
+
/* Prevent horizontal overflow and scrolling, modern way. */
|
|
775
|
+
overflow-x: clip;
|
|
776
|
+
|
|
777
|
+
/* Enable font smoothing */
|
|
778
|
+
-webkit-font-smoothing: antialiased;
|
|
779
|
+
-moz-osx-font-smoothing: grayscale;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
body {
|
|
783
|
+
|
|
784
|
+
/* Make the `body` a flex container with column layout, and `main` to automatically fill available space. This is useful for creating sticky footers and full-height layouts. */
|
|
785
|
+
display: flex;
|
|
786
|
+
flex-direction: column;
|
|
787
|
+
/* Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support). */
|
|
788
|
+
min-height: 100dvh;
|
|
789
|
+
|
|
790
|
+
/* Evaluates the last ~4 lines of text blocks to prevent a single word from sitting on the final line. */
|
|
791
|
+
|
|
792
|
+
/* Enable global hyphenation */
|
|
793
|
+
/* ... except for links and tables which are better (safer) without hyphenation */
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
body > main {
|
|
797
|
+
flex-grow: 1;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
body {
|
|
801
|
+
hyphens: auto;
|
|
802
|
+
text-wrap: pretty;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
body a,
|
|
806
|
+
body table {
|
|
807
|
+
hyphens: none;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
a:not([href^="#"]) {
|
|
811
|
+
text-decoration-thickness: 1px;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
a:not([href^="#"]):hover {
|
|
815
|
+
text-decoration-thickness: 2px;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
h1 {
|
|
819
|
+
margin-bottom: 1rem; /* for tw-typography */
|
|
820
|
+
font-size: 2.5em; /* for pico.css & tw-typography */
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
hr {
|
|
824
|
+
margin-block: 2em; /* for pico.css & tw-typography */
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
ul ul {
|
|
828
|
+
font-size: 87.5%;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
pre small {
|
|
832
|
+
font-weight: lighter;
|
|
833
|
+
opacity: 75%;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
table th {
|
|
837
|
+
font-weight: bold;
|
|
838
|
+
vertical-align: bottom;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
table td {
|
|
842
|
+
vertical-align: top;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
table pre {
|
|
846
|
+
margin-bottom: 0.25rem;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
[data-jump-to="top"] {
|
|
850
|
+
opacity: 25%;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
[data-jump-to="top"]:hover {
|
|
854
|
+
opacity: 75%;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
[data-jump-to="top"] > i {
|
|
858
|
+
display: inline-block;
|
|
859
|
+
margin: 0.5rem;
|
|
860
|
+
padding: 0.25rem 0.375rem;
|
|
861
|
+
border-color: black;
|
|
862
|
+
color: black;
|
|
863
|
+
font-size: 0.75rem;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
.breakout > img,
|
|
867
|
+
.breakout > figure,
|
|
868
|
+
.breakout-all > img,
|
|
869
|
+
.breakout-all > figure {
|
|
870
|
+
margin-bottom: 1rem;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.faded a {
|
|
874
|
+
text-decoration-style: dotted;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/*```
|
|
878
|
+
\3c !--section--> */
|