@anyblades/blades 0.28.0 → 2.2.0
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 +145 -70
- package/_includes/blades/html.liquid +1 -1
- package/_includes/blades/html.njk +1 -1
- package/assets/blades.css +521 -177
- package/assets/{blades.core.css → blades.standalone.core.css} +41 -46
- package/assets/blades.standalone.css +857 -0
- package/assets/{blades.theme.css → blades.standalone.theme.css} +2 -2
- package/assets/breakout.css +6 -6
- package/assets/float-label.core.css +2 -2
- package/assets/float-label.css +2 -2
- package/assets/link-icon.css +4 -4
- package/assets/responsive-table.css +5 -5
- package/blades.gemspec +1 -1
- package/package.json +5 -6
- package/src/_layout.css +4 -4
- package/src/_utilities.css +2 -4
- package/src/blades.css +6 -2
- package/src/blades.standalone.css +2 -0
- package/src/content/_code.css +1 -2
- package/src/content/_table.css +1 -2
- package/src/content/_typography.css +6 -7
- package/assets/pico.blades.css +0 -1211
- package/src/pico.blades.css +0 -6
- /package/{LICENSE → LICENSE.md} +0 -0
- /package/src/{blades.core.css → blades.standalone.core.css} +0 -0
- /package/src/{blades.theme.css → blades.standalone.theme.css} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/* Layout */
|
|
4
4
|
|
|
5
5
|
/* Extends https://github.com/picocss/pico/blob/main/scss/layout/
|
|
6
|
-
|
|
6
|
+
\3c !--section:docs,columns-->
|
|
7
7
|
|
|
8
8
|
### Auto-columns
|
|
9
9
|
|
|
@@ -21,12 +21,12 @@ The smaller the font size, the more columns will be created:
|
|
|
21
21
|
|
|
22
22
|
Useful for tables of contents and long lists.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
How it works:
|
|
25
25
|
```css */
|
|
26
26
|
|
|
27
27
|
.columns {
|
|
28
|
-
-moz-columns:
|
|
29
|
-
columns:
|
|
28
|
+
-moz-columns: 25ch auto;
|
|
29
|
+
columns: 25ch auto; /* common container 65ch / 25ch => 2 columns max, with a buffer for list paddings */
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/* Avoid breaking inside elements, such as nested lists */
|
|
@@ -37,7 +37,7 @@ Useful for tables of contents and long lists.
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/*```
|
|
40
|
-
|
|
40
|
+
\3c !--section:docs,jump-->
|
|
41
41
|
|
|
42
42
|
### Jump to top
|
|
43
43
|
|
|
@@ -52,10 +52,10 @@ Useful for tables of contents and long lists.
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/*```
|
|
55
|
-
|
|
55
|
+
\3c !--section--> */
|
|
56
56
|
|
|
57
57
|
/*
|
|
58
|
-
|
|
58
|
+
\3c !--section:code-->
|
|
59
59
|
```css */
|
|
60
60
|
|
|
61
61
|
.breakout,
|
|
@@ -147,17 +147,17 @@ Useful for tables of contents and long lists.
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
/*```
|
|
150
|
-
|
|
150
|
+
\3c !--section:summary-->
|
|
151
151
|
|
|
152
152
|
The `.breakout` layout allows images, tables, and other figures to automatically extend or bleed beyond their parent container’s width.
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
\3c !--section:docs-->
|
|
155
155
|
|
|
156
|
-
### Demo
|
|
156
|
+
### Demo \3c !-- inside parent .breakout -->
|
|
157
157
|
|
|
158
158
|
Break out a wide image from the text flow:
|
|
159
159
|
|
|
160
|
-
<div
|
|
160
|
+
<div>\3c !-- Dummy div to avoid p tag in Markdown --></div><img
|
|
161
161
|
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>">
|
|
162
162
|
|
|
163
163
|
Or table:
|
|
@@ -186,12 +186,12 @@ Or anything else:
|
|
|
186
186
|
<h2>Heading 2</h2><h3>Heading 3</h3><h4>Heading 4</h4><h5>Heading 5</h5><h6>Heading 6</h6>
|
|
187
187
|
<hr>
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
\3c !--section--> */
|
|
190
190
|
|
|
191
191
|
/* Content */
|
|
192
192
|
|
|
193
193
|
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_typography.scss
|
|
194
|
-
|
|
194
|
+
\3c !--section:docs,h-anchor-->
|
|
195
195
|
|
|
196
196
|
### Heading anchors
|
|
197
197
|
|
|
@@ -201,7 +201,7 @@ Links with `href="#..."` inside headings are automatically displayed as anchors:
|
|
|
201
201
|
<h2 style="margin: 0 0 0 1.5rem">Heading with anchor <a href="#hwa" style="visibility: visible">#</a></h2>
|
|
202
202
|
</article>
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
How it works:
|
|
205
205
|
```css */
|
|
206
206
|
|
|
207
207
|
h1,
|
|
@@ -231,10 +231,11 @@ h1 a[href^="#"], h2 a[href^="#"], h3 a[href^="#"], h4 a[href^="#"], h5 a[href^="
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
/*```
|
|
234
|
-
</details>
|
|
235
234
|
|
|
236
235
|
**PRO** example of automatic anchors for `11ty`+`markdown-it-anchor`: https://github.com/anyblades/eleventy-blades/blob/main/src/eleventy.config.js
|
|
237
236
|
|
|
237
|
+
\3c !--section:docs,list-->
|
|
238
|
+
|
|
238
239
|
### List markers
|
|
239
240
|
|
|
240
241
|
Customize markers using inline `style="--list-marker:..."` on `<ul>/<ol>` or even individual `<li>`:
|
|
@@ -252,7 +253,7 @@ Customize markers using inline `style="--list-marker:..."` on `<ul>/<ol>` or eve
|
|
|
252
253
|
{style="--list-marker:'→ '"}
|
|
253
254
|
</article>
|
|
254
255
|
|
|
255
|
-
|
|
256
|
+
How it works:
|
|
256
257
|
```css */
|
|
257
258
|
|
|
258
259
|
ul[style*="--list-marker:"], ol[style*="--list-marker:"] {
|
|
@@ -272,7 +273,6 @@ ul li[data-marker]::marker, ol li[data-marker]::marker {
|
|
|
272
273
|
}
|
|
273
274
|
|
|
274
275
|
/*```
|
|
275
|
-
</details>
|
|
276
276
|
|
|
277
277
|
### Unlist
|
|
278
278
|
|
|
@@ -289,7 +289,7 @@ ul li[data-marker]::marker, ol li[data-marker]::marker {
|
|
|
289
289
|
|
|
290
290
|
`.unlist-all` also removes styling from all nested lists.
|
|
291
291
|
|
|
292
|
-
|
|
292
|
+
How it works:
|
|
293
293
|
```css */
|
|
294
294
|
|
|
295
295
|
ul.unlist,
|
|
@@ -306,11 +306,10 @@ ul.unlist > li, ul.unlist-all > li, .unlist-all ul > li, ol.unlist > li, ol.unli
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
/*```
|
|
309
|
-
|
|
310
|
-
<!--section--> */
|
|
309
|
+
\3c !--section--> */
|
|
311
310
|
|
|
312
311
|
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
|
|
313
|
-
|
|
312
|
+
\3c !--section:code-->
|
|
314
313
|
```css */
|
|
315
314
|
|
|
316
315
|
/* Use inline flex only if link contains an icon */
|
|
@@ -349,12 +348,12 @@ a > i.fa-lg {
|
|
|
349
348
|
}
|
|
350
349
|
|
|
351
350
|
/*```
|
|
352
|
-
|
|
351
|
+
\3c !--section:summary-->
|
|
353
352
|
|
|
354
353
|
Use *Bl*ades `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links.
|
|
355
354
|
It automatically handles sizing and alignment while preventing underline on icons.
|
|
356
355
|
|
|
357
|
-
|
|
356
|
+
\3c !--section:docs-->
|
|
358
357
|
|
|
359
358
|
<article class="breakout-item">
|
|
360
359
|
|
|
@@ -375,10 +374,10 @@ How we made it: https://codepen.io/editor/anydigital/pen/019d2b94-5616-75dc-a23e
|
|
|
375
374
|
|
|
376
375
|
**PRO** example of automatic favicons for `11ty`: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
|
|
377
376
|
|
|
378
|
-
|
|
377
|
+
\3c !--section--> */
|
|
379
378
|
|
|
380
379
|
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_table.scss
|
|
381
|
-
|
|
380
|
+
\3c !--section:docs-->
|
|
382
381
|
|
|
383
382
|
### Column expanders
|
|
384
383
|
|
|
@@ -391,13 +390,13 @@ Place `<hr>` element inside `<th>` column to expand it horizontally:
|
|
|
391
390
|
| (012) 345-6789 | (012) 345-6789 |
|
|
392
391
|
</article>
|
|
393
392
|
|
|
394
|
-
Living examples of big tables with `<hr>`-expanders:
|
|
393
|
+
Living examples of big tables with `<hr>`-expanders: \3c !--A-Z-->
|
|
395
394
|
- https://blades.ninja/ai/ide/
|
|
396
395
|
- https://blades.ninja/build-awesome-11ty/starters/
|
|
397
396
|
- https://blades.ninja/css/frameworks/
|
|
398
397
|
- https://blades.ninja/ssg/
|
|
399
398
|
|
|
400
|
-
|
|
399
|
+
How it works:
|
|
401
400
|
```css */
|
|
402
401
|
|
|
403
402
|
th hr {
|
|
@@ -416,7 +415,6 @@ th hr.x2 {
|
|
|
416
415
|
}
|
|
417
416
|
|
|
418
417
|
/*```
|
|
419
|
-
</details>
|
|
420
418
|
|
|
421
419
|
### Borderless table
|
|
422
420
|
|
|
@@ -433,7 +431,7 @@ th hr.x2 {
|
|
|
433
431
|
|
|
434
432
|
Living example: https://bladeswitch.com/#minimal-dependencies table
|
|
435
433
|
|
|
436
|
-
|
|
434
|
+
\3c !--section--> */
|
|
437
435
|
|
|
438
436
|
table.borderless th,
|
|
439
437
|
table.borderless td {
|
|
@@ -441,7 +439,7 @@ table.borderless th,
|
|
|
441
439
|
}
|
|
442
440
|
|
|
443
441
|
/*
|
|
444
|
-
|
|
442
|
+
\3c !--section:code-->
|
|
445
443
|
```css */
|
|
446
444
|
|
|
447
445
|
table.responsive,
|
|
@@ -476,12 +474,12 @@ table.responsive th,
|
|
|
476
474
|
/*```
|
|
477
475
|
`table:not(.does-not-exist)` trick (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
|
|
478
476
|
|
|
479
|
-
|
|
477
|
+
\3c !--section:summary-->
|
|
480
478
|
|
|
481
479
|
`.responsive` makes a table full-bleed and scroll on mobile, without a need for a redundant wrapper (finally).
|
|
482
480
|
Tables inside https://blades.ninja/css/breakout/ are responsive by default.
|
|
483
481
|
|
|
484
|
-
|
|
482
|
+
\3c !--section:docs-->
|
|
485
483
|
|
|
486
484
|
### Demo table
|
|
487
485
|
|
|
@@ -493,16 +491,16 @@ Tables inside https://blades.ninja/css/breakout/ are responsive by default.
|
|
|
493
491
|
|
|
494
492
|
---
|
|
495
493
|
|
|
496
|
-
Living examples:
|
|
494
|
+
Living examples: \3c !--A-Z-->
|
|
497
495
|
- https://blades.ninja/ai/ide/
|
|
498
496
|
- https://blades.ninja/build-awesome-11ty/starters/
|
|
499
497
|
- https://blades.ninja/css/frameworks/
|
|
500
498
|
- https://blades.ninja/ssg/
|
|
501
499
|
|
|
502
|
-
|
|
500
|
+
\3c !--section--> */
|
|
503
501
|
|
|
504
502
|
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_code.scss
|
|
505
|
-
|
|
503
|
+
\3c !--section:docs-->
|
|
506
504
|
|
|
507
505
|
### Code
|
|
508
506
|
|
|
@@ -514,7 +512,7 @@ The `<pre><code>` blocks are Prism-compatible and support captions via `data-cap
|
|
|
514
512
|
├── blades.theme.css # minimal opinionated theme
|
|
515
513
|
└── blades.css # above two together
|
|
516
514
|
```
|
|
517
|
-
|
|
515
|
+
How it works:
|
|
518
516
|
```css */
|
|
519
517
|
|
|
520
518
|
pre {
|
|
@@ -559,13 +557,12 @@ code:where(pre > *) {
|
|
|
559
557
|
}
|
|
560
558
|
|
|
561
559
|
/*```
|
|
562
|
-
|
|
563
|
-
<!--section--> */
|
|
560
|
+
\3c !--section--> */
|
|
564
561
|
|
|
565
562
|
/* Forms */
|
|
566
563
|
|
|
567
564
|
/* Moved here from https://github.com/anyblades/float-label-css for easier maintenance
|
|
568
|
-
|
|
565
|
+
\3c !--section:docs-->
|
|
569
566
|
|
|
570
567
|
First, we target either:
|
|
571
568
|
1. `<label>` which `:has` inner form inputs (classless approach)
|
|
@@ -629,12 +626,12 @@ label:has(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea
|
|
|
629
626
|
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.
|
|
630
627
|
|
|
631
628
|
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.
|
|
632
|
-
|
|
629
|
+
\3c !--section--> */
|
|
633
630
|
|
|
634
631
|
/* Utilities */
|
|
635
632
|
|
|
636
633
|
/* Extends https://github.com/picocss/pico/tree/main/scss/utilities
|
|
637
|
-
|
|
634
|
+
\3c !--section:docs-->
|
|
638
635
|
|
|
639
636
|
### Auto-dark
|
|
640
637
|
|
|
@@ -644,7 +641,7 @@ Historically, this was not possible: the float label had to be placed after the
|
|
|
644
641
|
<p>Look how cool <big class="dark-auto">🔥🕷️🐦⬛🐄🦓</big> can look in the dark!</p>
|
|
645
642
|
</article>
|
|
646
643
|
|
|
647
|
-
|
|
644
|
+
How it works:
|
|
648
645
|
```css */
|
|
649
646
|
|
|
650
647
|
/* Per https://picocss.com/docs/css-variables#css-variables-for-color-schemes */
|
|
@@ -672,7 +669,6 @@ Historically, this was not possible: the float label had to be placed after the
|
|
|
672
669
|
}
|
|
673
670
|
|
|
674
671
|
/*```
|
|
675
|
-
</details>
|
|
676
672
|
|
|
677
673
|
### Faded
|
|
678
674
|
|
|
@@ -682,7 +678,7 @@ Historically, this was not possible: the float label had to be placed after the
|
|
|
682
678
|
Hover to unfade me!
|
|
683
679
|
</article>
|
|
684
680
|
|
|
685
|
-
|
|
681
|
+
How it works:
|
|
686
682
|
```css */
|
|
687
683
|
|
|
688
684
|
.faded {
|
|
@@ -694,8 +690,7 @@ Historically, this was not possible: the float label had to be placed after the
|
|
|
694
690
|
}
|
|
695
691
|
|
|
696
692
|
/*```
|
|
697
|
-
|
|
698
|
-
<!--section--> */
|
|
693
|
+
\3c !--section--> */
|
|
699
694
|
|
|
700
695
|
/* Fix the scrollbar color when inverted by https://tailwindcss.com/docs/filter-invert */
|
|
701
696
|
|