@anydigital/blades 0.27.0-beta.14 → 0.27.0-beta.16

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 CHANGED
@@ -24,15 +24,15 @@ Nunjucks/Liquid batteries included (for 11ty/Build Awesome, Jekyll, etc.) 🥷
24
24
  <!-- copy-paste of ToC from https://blades.ninja/css/ -->
25
25
  <ul class="unlist columns">
26
26
  <li><a href="https://blades.ninja/css/#install">Install</a></li>
27
- <li><a href="https://blades.ninja/css/#layout">Layout</a><ul><li><a href="https://blades.ninja/css/breakout/">🥷 Breakout elements →</a></li>
27
+ <li><a href="https://blades.ninja/css/#layout">Layout</a><ul><li><a href="https://blades.ninja/css/breakout/"><i>🥷</i> Breakout elements →</a></li>
28
28
  <li><a href="https://blades.ninja/css/#landmarks">Landmarks</a></li>
29
29
  <li><a href="https://blades.ninja/css/#auto-columns">Auto-columns</a></li>
30
30
  <li><a href="https://blades.ninja/css/#jump-to-top">Jump to top</a></li></ul></li>
31
31
  <li><a href="https://blades.ninja/css/#content">Content</a><ul><li><a href="https://blades.ninja/css/#heading-anchors">Heading anchors</a></li>
32
32
  <li><a href="https://blades.ninja/css/#list-markers">List markers</a></li>
33
- <li><a href="https://blades.ninja/css/link-icon/">🥷 Link [fav]icons →</a></li>
33
+ <li><a href="https://blades.ninja/css/link-icon/"><i>🥷</i> Link [fav]icons →</a></li>
34
34
  <li><a href="https://blades.ninja/css/#code">Code</a></li></ul></li>
35
- <li><a href="https://blades.ninja/css/#table">Table</a><ul><li><a href="https://blades.ninja/css/responsive-table/">🥷 Responsive table without wrapper →</a></li>
35
+ <li><a href="https://blades.ninja/css/#table">Table</a><ul><li><a href="https://blades.ninja/css/responsive-table/"><i>🥷</i> Responsive table without wrapper →</a></li>
36
36
  <li><a href="https://blades.ninja/css/#horizontal-expanders">Horizontal expanders</a></li>
37
37
  <li><a href="https://blades.ninja/css/#borderless-table">Borderless table</a></li></ul></li>
38
38
  <li><a href="https://blades.ninja/css/#utilities">Utilities</a><ul><li><a href="https://blades.ninja/css/#auto-dark">Auto-dark</a></li>
@@ -43,9 +43,9 @@ Nunjucks/Liquid batteries included (for 11ty/Build Awesome, Jekyll, etc.) 🥷
43
43
  </ul>
44
44
 
45
45
  <!--section:index,install-css-->
46
- <details><summary role="button" class="outline"><b>Install CSS blades</b></summary>
46
+ <details><summary role="button" class="outline"><b>Install CSS blades</b> via CDN or npm</summary>
47
47
 
48
- <mark>Option A.</mark> From CDN:
48
+ <mark>Via CDN:</mark>
49
49
 
50
50
  <!--prettier-ignore-->
51
51
  ```html
@@ -53,7 +53,7 @@ Nunjucks/Liquid batteries included (for 11ty/Build Awesome, Jekyll, etc.) 🥷
53
53
  <link href="https://cdn.jsdelivr.net/npm/@anydigital/blades@^0.27.0-alpha/assets/blades.theme.min.css" rel="stylesheet" /><!-- optional -->
54
54
  ```
55
55
 
56
- <mark>Option B.</mark> Via npm:
56
+ <mark>Via npm:</mark>
57
57
 
58
58
  ```sh
59
59
  npm install @anydigital/blades
@@ -83,7 +83,7 @@ Living example: https://github.com/anydigital/build-awesome-starter/blob/main/_s
83
83
  <!--{.columns}-->
84
84
 
85
85
  <!--section:index,install-html-->
86
- <details><summary role="button" class="outline"><b>Install HTML blades</b></summary>
86
+ <details><summary role="button" class="outline"><b>Install HTML blades</b> via npm</summary>
87
87
 
88
88
  ```sh
89
89
  npm install @anydigital/blades
@@ -93,12 +93,16 @@ ln -s ../node_modules/@anydigital/blades/_includes/blades
93
93
 
94
94
  That's it! Now you can use HTML blades in your templates like this:
95
95
 
96
- ```jinja2 {data-caption=Nunjucks}
96
+ <mark>In Nunjucks:</mark>
97
+
98
+ ```jinja2
97
99
  {% extends 'blades/html.njk' %}
98
100
  {% include 'blades/gtm.njk' %}
99
101
  ```
100
102
 
101
- ```liquid {data-caption=Liquid}
103
+ <mark>In Liquid:</mark>
104
+
105
+ ```liquid
102
106
  {% include blades/html.liquid %}
103
107
  {% include blades/gtm.liquid for_body=true %}
104
108
  {% render blades/links, links: site.links, current_url: page.url %}
@@ -136,10 +140,12 @@ Or use a preconfigured template:
136
140
 
137
141
  - Featured by:
138
142
  - https://github.com/uhub/awesome-css
139
- - [https://jekyll-themes.com/](https://jekyll-themes.com/anydigital/blades)
143
+ - 🕶️ [awesome-css-frameworks](https://github.com/gabrielizalo/Awesome-CSS-Frameworks-and-UI-Libraries/tree/master/Lightweight)
140
144
  - 🕶️ [awesome-eleventy](https://github.com/anydigital/awesome-11ty-build-awesome)
141
- - 🚀 [build-awesome-starter](https://github.com/anydigital/build-awesome-starter)
142
- - 🚀 [bladeswitch starter](https://github.com/anydigital/bladeswitch)
145
+ - https://11tybundle.dev/showcase/
146
+ - [https://jekyll-themes.com/](https://jekyll-themes.com/anydigital/blades)
147
+ - https://github.com/anydigital/build-awesome-starter
148
+ - https://github.com/anydigital/bladeswitch starter
143
149
  - https://github.com/hostfurl/minformhf starter
144
150
  - Showcase:
145
151
  - https://any.digital/ (Pico ⁺ Blades)
package/assets/blades.css CHANGED
@@ -3,34 +3,23 @@
3
3
  /* Layout */
4
4
 
5
5
  /* Extends https://github.com/picocss/pico/blob/main/scss/layout/
6
- <!--section:docs-->
6
+ <!--section:docs-intro-->
7
7
 
8
8
  Global styles:
9
- - Prevent horizontal overflow and scrolling, modern way.
10
9
  ```css */
11
10
 
12
11
  html {
12
+ /* Prevent horizontal overflow and scrolling, modern way. */
13
13
  overflow-x: clip;
14
14
  }
15
15
 
16
- /*```
17
-
18
- ### Landmarks
19
- - Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support).
20
- - 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.
21
- ```css */
22
-
23
16
  body {
17
+ /* Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support). */
24
18
  min-height: 100dvh;
25
-
26
- display: flex;
27
- flex-direction: column;
28
- > main {
29
- flex-grow: 1;
30
- }
31
19
  }
32
20
 
33
21
  /*```
22
+ <!--section:docs-->
34
23
 
35
24
  ### Auto-columns
36
25
  ```css */
@@ -151,10 +140,14 @@ Table of contents (`[data-is-toc]`) has auto-columns by default.
151
140
  }
152
141
  }
153
142
 
154
- /*```<!--section:docs-->
143
+ /*```
144
+ <!--section:docs,summary-->
145
+
155
146
  Framework-agnostic utilities for breaking out images and figures beyond their container width.
156
147
 
157
- Use the `.breakout` class to allow elements to extend beyond their parent container:
148
+ Use the `.breakout` class to allow elements to extend beyond their parent container.
149
+
150
+ <!--section:docs-->
158
151
 
159
152
  ```html
160
153
  <div class="breakout">
@@ -163,12 +156,13 @@ Use the `.breakout` class to allow elements to extend beyond their parent contai
163
156
  ```
164
157
 
165
158
  The breakout container has `10%` inline padding and a max-width of `calc(10% + 65ch + 10%)`. The breakout utilities support images, pictures, figures, canvas, audio, video, tables, pre, iframe, and other media elements. Tables inside `.breakout` are specifically enhanced for horizontal scrolling and full-bleed mobile display. This is automatically included when you import the stylesheet.
159
+
166
160
  <!--section--> */
167
161
 
168
162
  /* Content */
169
163
 
170
164
  /* Extends https://github.com/picocss/pico/blob/main/scss/content/_typography.scss
171
- <!--section:docs-->
165
+ <!--section:docs-intro-->
172
166
 
173
167
  Global styles:
174
168
  ```css */
@@ -190,6 +184,7 @@ body {
190
184
  }
191
185
 
192
186
  /*```
187
+ <!--section:docs-->
193
188
 
194
189
  ### Heading anchors
195
190
 
@@ -209,13 +204,14 @@ h6 {
209
204
  position: relative;
210
205
 
211
206
  [data-is-anchor] {
212
- visibility: hidden;
213
207
  position: absolute;
214
- top: 0;
215
208
  right: 100%;
209
+ top: 50%;
210
+ transform: translateY(-50%);
216
211
  padding-right: 0.2ch;
217
212
  color: silver;
218
213
  text-decoration: none;
214
+ visibility: hidden;
219
215
  }
220
216
  /* Avoid double-tap on touch devices */
221
217
  @media (hover: hover) {
@@ -263,14 +259,20 @@ ol {
263
259
  /* ⚠️ `data-marker` works only in Chrome and Firefox */
264
260
  content: attr(data-marker) " ";
265
261
  }
262
+ }
266
263
 
267
- /* Helper class to remove list styling at all */
268
- &.unlist {
269
- padding-inline-start: 0;
264
+ /*```
270
265
 
271
- > li {
272
- list-style: none;
273
- }
266
+ ### Unlist
267
+
268
+ Helper class to remove list styling at all:
269
+ ```css */
270
+
271
+ .unlist {
272
+ padding-inline-start: 0;
273
+
274
+ > li {
275
+ list-style: none;
274
276
  }
275
277
  }
276
278
 
@@ -282,18 +284,16 @@ ol {
282
284
  ```css */
283
285
 
284
286
  a {
285
- /* If link contains an icon, use inline flex */
287
+ /* Use inline flex only if link contains an icon */
286
288
  &:has(> i) {
287
289
  display: inline-flex;
288
290
  gap: 0.375ch; /* =3/8 */
289
291
  text-wrap: balance;
290
292
  overflow-y: clip; /* to work in pair with text-underline-offset in Safari */
291
293
  }
292
-
293
- /* Helper to handle [fav]icons in links */
294
294
  > i {
295
295
  font-style: normal;
296
- float: left; /* ✅ Chrome ❌ Safari */
296
+ float: left; /* ✅ Chrome ❌ Safari */
297
297
  text-underline-offset: -2em; /* ❌ Chrome ✅ Safari - to clip it with overflow-y */
298
298
 
299
299
  /* Favicons */
@@ -307,8 +307,7 @@ a {
307
307
  &[class^="fa-"],
308
308
  &[class*=" fa-"] {
309
309
  line-height: inherit;
310
- margin-inline-start: -0.25ch;
311
- margin-inline-end: -0.125ch; /* =1/8 */
310
+ --fa-width: auto;
312
311
  }
313
312
  &.fa-lg {
314
313
  line-height: normal;
@@ -319,17 +318,19 @@ a {
319
318
  /*```
320
319
  > **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
321
320
 
322
- <!--section:docs-->
321
+ <!--section:docs,summary-->
323
322
 
324
- Wrap emojis, favicons, or simply drop Font Awesome icons inside links using the Blades' `<i>` helper. It automatically handles sizing and alignment while preventing underlines. Compare:
323
+ Use Blades' `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links. It automatically handles sizing and alignment while preventing underline on icons.
325
324
 
326
- ---
325
+ <!--section:docs-->
327
326
 
328
- | Without Blades <hr> | With Blades' `<i>` helper <hr> | Clean HTML without `<span>`ning |
329
- | --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------ |
330
- | [🥷 Link with emoji](#) | [<i>🥷</i> Link with emoji](#) | `<a><i>🥷</i> Text</a>` |
331
- | [![](https://www.google.com/s2/favicons?domain=any.digital&sz=64) Longer link <br> with favicon](#) | [<i>![](https://www.google.com/s2/favicons?domain=any.digital&sz=64)</i> Longer link <br> with favicon](#) | `<a><i><img src="..."></i> Text</a>` |
332
- | [<b class="fa-brands fa-github fa-lg"></b> Link with Font Awesome icon](#) | [<i class="fa-brands fa-github fa-lg"></i> Link with Font Awesome icon](#) | `<a><i class="fa-..."></i> Text</a>` |
327
+ Compare:
328
+
329
+ | Without Blades <hr class="lg"> | With Blades' `<i>`-helper <hr class="lg"> | Clean HTML without `<span>ning` <hr class="x2"> |
330
+ | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
331
+ | [🥷 Link with emoji](#) | [<i>🥷</i> Link with emoji](#) | `<a><i>🥷</i> Text</a>` |
332
+ | [![](https://www.google.com/s2/favicons?domain=any.digital&sz=64) Multi-line link <br> with favicon](#) | [<i>![](https://www.google.com/s2/favicons?domain=any.digital&sz=64)</i> Multi-line link <br> with favicon](#) | `<a><i><img src="..."></i> Text</a>` |
333
+ | [<b class="fa-brands fa-github fa-lg"></b> Link with Font Awesome icon](#) | [<i class="fa-brands fa-github fa-lg"></i> Link with Font Awesome icon](#) | `<a><i class="fa-..."></i> Text</a>` |
333
334
 
334
335
  ---
335
336
 
@@ -373,6 +374,9 @@ table {
373
374
  margin: 0;
374
375
  visibility: hidden;
375
376
 
377
+ &.lg {
378
+ width: 18ch;
379
+ }
376
380
  &.x2 {
377
381
  width: 24ch;
378
382
  }
@@ -381,8 +385,6 @@ table {
381
385
  }
382
386
 
383
387
  /*```
384
- ---
385
-
386
388
  ### Borderless table
387
389
 
388
390
  `<table class="borderless">` removes all default borders:
@@ -440,21 +442,24 @@ Soft-increase selector specificity trick:
440
442
 
441
443
  `table:not(.does-not-exist)` (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
442
444
 
443
- <!--section:docs-->
445
+ <!--section:docs,summary-->
444
446
 
445
- `<table class="responsive">` allows a table to full-bleed and scroll on mobile:
446
- <hr><div>
447
+ `<table class="responsive">` allows a table to full-bleed and scroll on mobile.
447
448
 
448
- | Term | Description <hr class="x2"> | Link |
449
- | --- | --- | --- |
449
+ <!--section:docs-->
450
+
451
+ | Term | Description <hr class="x2"> | Link |
452
+ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
450
453
  | 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 |
451
454
 
452
455
  {.responsive}
453
- </div><hr>
456
+
457
+ ---
454
458
 
455
459
  Tables inside https://blades.ninja/css/breakout/ are responsive by default.
456
460
 
457
461
  Living examples:
462
+
458
463
  - https://any.digital/insights/ai-ide/
459
464
  - https://any.digital/insights/css-frameworks/
460
465
  - https://any.digital/insights/ssg/
@@ -1,5 +1,13 @@
1
1
  /* <!--section:code-->
2
2
  ```css */
3
+ body {
4
+ /* 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. */
5
+ display: flex;
6
+ flex-direction: column;
7
+ > main {
8
+ flex-grow: 1;
9
+ }
10
+ }
3
11
  a {
4
12
  &:not([href^="#"]) {
5
13
  text-decoration-thickness: 1px;
@@ -57,7 +65,7 @@ table {
57
65
  [data-jump-to="top"] {
58
66
  > i {
59
67
  display: inline-block;
60
- padding: 0.25rem;
68
+ padding: 0.25rem 0.375rem;
61
69
  margin: 0.5rem;
62
70
  font-size: 0.75rem;
63
71
  color: black;
@@ -78,10 +78,14 @@
78
78
  }
79
79
  }
80
80
  }
81
- /*```<!--section:docs-->
81
+ /*```
82
+ <!--section:docs,summary-->
83
+
82
84
  Framework-agnostic utilities for breaking out images and figures beyond their container width.
83
85
 
84
- Use the `.breakout` class to allow elements to extend beyond their parent container:
86
+ Use the `.breakout` class to allow elements to extend beyond their parent container.
87
+
88
+ <!--section:docs-->
85
89
 
86
90
  ```html
87
91
  <div class="breakout">
@@ -90,4 +94,5 @@ Use the `.breakout` class to allow elements to extend beyond their parent contai
90
94
  ```
91
95
 
92
96
  The breakout container has `10%` inline padding and a max-width of `calc(10% + 65ch + 10%)`. The breakout utilities support images, pictures, figures, canvas, audio, video, tables, pre, iframe, and other media elements. Tables inside `.breakout` are specifically enhanced for horizontal scrolling and full-bleed mobile display. This is automatically included when you import the stylesheet.
97
+
93
98
  <!--section--> */
@@ -2,18 +2,16 @@
2
2
  <!--section:code-->
3
3
  ```css */
4
4
  a {
5
- /* If link contains an icon, use inline flex */
5
+ /* Use inline flex only if link contains an icon */
6
6
  &:has(> i) {
7
7
  display: inline-flex;
8
8
  gap: 0.375ch; /* =3/8 */
9
9
  text-wrap: balance;
10
10
  overflow-y: clip; /* to work in pair with text-underline-offset in Safari */
11
11
  }
12
-
13
- /* Helper to handle [fav]icons in links */
14
12
  > i {
15
13
  font-style: normal;
16
- float: left; /* ✅ Chrome ❌ Safari */
14
+ float: left; /* ✅ Chrome ❌ Safari */
17
15
  text-underline-offset: -2em; /* ❌ Chrome ✅ Safari - to clip it with overflow-y */
18
16
 
19
17
  /* Favicons */
@@ -27,8 +25,7 @@ a {
27
25
  &[class^="fa-"],
28
26
  &[class*=" fa-"] {
29
27
  line-height: inherit;
30
- margin-inline-start: -0.25ch;
31
- margin-inline-end: -0.125ch; /* =1/8 */
28
+ --fa-width: auto;
32
29
  }
33
30
  &.fa-lg {
34
31
  line-height: normal;
@@ -38,17 +35,19 @@ a {
38
35
  /*```
39
36
  > **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
40
37
 
41
- <!--section:docs-->
38
+ <!--section:docs,summary-->
42
39
 
43
- Wrap emojis, favicons, or simply drop Font Awesome icons inside links using the Blades' `<i>` helper. It automatically handles sizing and alignment while preventing underlines. Compare:
40
+ Use Blades' `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links. It automatically handles sizing and alignment while preventing underline on icons.
44
41
 
45
- ---
42
+ <!--section:docs-->
43
+
44
+ Compare:
46
45
 
47
- | Without Blades <hr> | With Blades' `<i>` helper <hr> | Clean HTML without `<span>`ning |
48
- | --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------ |
49
- | [🥷 Link with emoji](#) | [<i>🥷</i> Link with emoji](#) | `<a><i>🥷</i> Text</a>` |
50
- | [![](https://www.google.com/s2/favicons?domain=any.digital&sz=64) Longer link <br> with favicon](#) | [<i>![](https://www.google.com/s2/favicons?domain=any.digital&sz=64)</i> Longer link <br> with favicon](#) | `<a><i><img src="..."></i> Text</a>` |
51
- | [<b class="fa-brands fa-github fa-lg"></b> Link with Font Awesome icon](#) | [<i class="fa-brands fa-github fa-lg"></i> Link with Font Awesome icon](#) | `<a><i class="fa-..."></i> Text</a>` |
46
+ | Without Blades <hr class="lg"> | With Blades' `<i>`-helper <hr class="lg"> | Clean HTML without `<span>ning` <hr class="x2"> |
47
+ | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
48
+ | [🥷 Link with emoji](#) | [<i>🥷</i> Link with emoji](#) | `<a><i>🥷</i> Text</a>` |
49
+ | [![](https://www.google.com/s2/favicons?domain=any.digital&sz=64) Multi-line link <br> with favicon](#) | [<i>![](https://www.google.com/s2/favicons?domain=any.digital&sz=64)</i> Multi-line link <br> with favicon](#) | `<a><i><img src="..."></i> Text</a>` |
50
+ | [<b class="fa-brands fa-github fa-lg"></b> Link with Font Awesome icon](#) | [<i class="fa-brands fa-github fa-lg"></i> Link with Font Awesome icon](#) | `<a><i class="fa-..."></i> Text</a>` |
52
51
 
53
52
  ---
54
53
 
@@ -29,21 +29,24 @@ Soft-increase selector specificity trick:
29
29
 
30
30
  `table:not(.does-not-exist)` (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
31
31
 
32
- <!--section:docs-->
32
+ <!--section:docs,summary-->
33
+
34
+ `<table class="responsive">` allows a table to full-bleed and scroll on mobile.
33
35
 
34
- `<table class="responsive">` allows a table to full-bleed and scroll on mobile:
35
- <hr><div>
36
+ <!--section:docs-->
36
37
 
37
- | Term | Description <hr class="x2"> | Link |
38
- | --- | --- | --- |
38
+ | Term | Description <hr class="x2"> | Link |
39
+ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
39
40
  | 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 |
40
41
 
41
42
  {.responsive}
42
- </div><hr>
43
+
44
+ ---
43
45
 
44
46
  Tables inside https://blades.ninja/css/breakout/ are responsive by default.
45
47
 
46
48
  Living examples:
49
+
47
50
  - https://any.digital/insights/ai-ide/
48
51
  - https://any.digital/insights/css-frameworks/
49
52
  - https://any.digital/insights/ssg/
package/blades.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "blades"
5
- spec.version = "0.27.0-beta.14"
5
+ spec.version = "0.27.0-beta.16"
6
6
  spec.authors = ["Anton Staroverov"]
7
7
 
8
8
  spec.summary = "Framework-agnostic CSS utilities and single-file Liquid 'blades' for modern web development."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anydigital/blades",
3
- "version": "0.27.0-beta.14",
3
+ "version": "0.27.0-beta.16",
4
4
  "description": "Framework-agnostic CSS utilities and single-file Liquid 'blades' for modern web development.",
5
5
  "style": "./assets/blades.css",
6
6
  "exports": {
package/src/_layout.css CHANGED
@@ -1,28 +1,18 @@
1
1
  /* Extends https://github.com/picocss/pico/blob/main/scss/layout/
2
- <!--section:docs-->
2
+ <!--section:docs-intro-->
3
3
 
4
4
  Global styles:
5
- - Prevent horizontal overflow and scrolling, modern way.
6
5
  ```css */
7
6
  html {
7
+ /* Prevent horizontal overflow and scrolling, modern way. */
8
8
  overflow-x: clip;
9
9
  }
10
- /*```
11
-
12
- ### Landmarks
13
- - Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support).
14
- - 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.
15
- ```css */
16
10
  body {
11
+ /* Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support). */
17
12
  min-height: 100dvh;
18
-
19
- display: flex;
20
- flex-direction: column;
21
- > main {
22
- flex-grow: 1;
23
- }
24
13
  }
25
14
  /*```
15
+ <!--section:docs-->
26
16
 
27
17
  ### Auto-columns
28
18
  ```css */
package/src/_table.css CHANGED
@@ -33,6 +33,9 @@ table {
33
33
  margin: 0;
34
34
  visibility: hidden;
35
35
 
36
+ &.lg {
37
+ width: 18ch;
38
+ }
36
39
  &.x2 {
37
40
  width: 24ch;
38
41
  }
@@ -40,8 +43,6 @@ table {
40
43
  }
41
44
  }
42
45
  /*```
43
- ---
44
-
45
46
  ### Borderless table
46
47
 
47
48
  `<table class="borderless">` removes all default borders:
@@ -1,5 +1,5 @@
1
1
  /* Extends https://github.com/picocss/pico/blob/main/scss/content/_typography.scss
2
- <!--section:docs-->
2
+ <!--section:docs-intro-->
3
3
 
4
4
  Global styles:
5
5
  ```css */
@@ -19,6 +19,7 @@ body {
19
19
  }
20
20
  }
21
21
  /*```
22
+ <!--section:docs-->
22
23
 
23
24
  ### Heading anchors
24
25
 
@@ -37,13 +38,14 @@ h6 {
37
38
  position: relative;
38
39
 
39
40
  [data-is-anchor] {
40
- visibility: hidden;
41
41
  position: absolute;
42
- top: 0;
43
42
  right: 100%;
43
+ top: 50%;
44
+ transform: translateY(-50%);
44
45
  padding-right: 0.2ch;
45
46
  color: silver;
46
47
  text-decoration: none;
48
+ visibility: hidden;
47
49
  }
48
50
  /* Avoid double-tap on touch devices */
49
51
  @media (hover: hover) {
@@ -89,14 +91,18 @@ ol {
89
91
  /* ⚠️ `data-marker` works only in Chrome and Firefox */
90
92
  content: attr(data-marker) " ";
91
93
  }
94
+ }
95
+ /*```
92
96
 
93
- /* Helper class to remove list styling at all */
94
- &.unlist {
95
- padding-inline-start: 0;
97
+ ### Unlist
96
98
 
97
- > li {
98
- list-style: none;
99
- }
99
+ Helper class to remove list styling at all:
100
+ ```css */
101
+ .unlist {
102
+ padding-inline-start: 0;
103
+
104
+ > li {
105
+ list-style: none;
100
106
  }
101
107
  }
102
108
  /*```
@@ -1,5 +1,14 @@
1
1
  /* <!--section:code-->
2
2
  ```css */
3
+ body {
4
+ /* 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. */
5
+ display: flex;
6
+ flex-direction: column;
7
+ > main {
8
+ flex-grow: 1;
9
+ }
10
+ }
11
+
3
12
  a {
4
13
  &:not([href^="#"]) {
5
14
  text-decoration-thickness: 1px;
@@ -64,7 +73,7 @@ table {
64
73
  [data-jump-to="top"] {
65
74
  > i {
66
75
  display: inline-block;
67
- padding: 0.25rem;
76
+ padding: 0.25rem 0.375rem;
68
77
  margin: 0.5rem;
69
78
  font-size: 0.75rem;
70
79
  color: black;
package/src/breakout.css CHANGED
@@ -79,10 +79,14 @@
79
79
  }
80
80
  }
81
81
  }
82
- /*```<!--section:docs-->
82
+ /*```
83
+ <!--section:docs,summary-->
84
+
83
85
  Framework-agnostic utilities for breaking out images and figures beyond their container width.
84
86
 
85
- Use the `.breakout` class to allow elements to extend beyond their parent container:
87
+ Use the `.breakout` class to allow elements to extend beyond their parent container.
88
+
89
+ <!--section:docs-->
86
90
 
87
91
  ```html
88
92
  <div class="breakout">
@@ -91,4 +95,5 @@ Use the `.breakout` class to allow elements to extend beyond their parent contai
91
95
  ```
92
96
 
93
97
  The breakout container has `10%` inline padding and a max-width of `calc(10% + 65ch + 10%)`. The breakout utilities support images, pictures, figures, canvas, audio, video, tables, pre, iframe, and other media elements. Tables inside `.breakout` are specifically enhanced for horizontal scrolling and full-bleed mobile display. This is automatically included when you import the stylesheet.
98
+
94
99
  <!--section--> */
package/src/link-icon.css CHANGED
@@ -2,18 +2,16 @@
2
2
  <!--section:code-->
3
3
  ```css */
4
4
  a {
5
- /* If link contains an icon, use inline flex */
5
+ /* Use inline flex only if link contains an icon */
6
6
  &:has(> i) {
7
7
  display: inline-flex;
8
8
  gap: 0.375ch; /* =3/8 */
9
9
  text-wrap: balance;
10
10
  overflow-y: clip; /* to work in pair with text-underline-offset in Safari */
11
11
  }
12
-
13
- /* Helper to handle [fav]icons in links */
14
12
  > i {
15
13
  font-style: normal;
16
- float: left; /* ✅ Chrome ❌ Safari */
14
+ float: left; /* ✅ Chrome ❌ Safari */
17
15
  text-underline-offset: -2em; /* ❌ Chrome ✅ Safari - to clip it with overflow-y */
18
16
 
19
17
  /* Favicons */
@@ -27,8 +25,7 @@ a {
27
25
  &[class^="fa-"],
28
26
  &[class*=" fa-"] {
29
27
  line-height: inherit;
30
- margin-inline-start: -0.25ch;
31
- margin-inline-end: -0.125ch; /* =1/8 */
28
+ --fa-width: auto;
32
29
  }
33
30
  &.fa-lg {
34
31
  line-height: normal;
@@ -38,17 +35,19 @@ a {
38
35
  /*```
39
36
  > **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
40
37
 
41
- <!--section:docs-->
38
+ <!--section:docs,summary-->
42
39
 
43
- Wrap emojis, favicons, or simply drop Font Awesome icons inside links using the Blades' `<i>` helper. It automatically handles sizing and alignment while preventing underlines. Compare:
40
+ Use Blades' `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links. It automatically handles sizing and alignment while preventing underline on icons.
44
41
 
45
- ---
42
+ <!--section:docs-->
43
+
44
+ Compare:
46
45
 
47
- | Without Blades <hr> | With Blades' `<i>` helper <hr> | Clean HTML without `<span>`ning |
48
- | --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------ |
49
- | [🥷 Link with emoji](#) | [<i>🥷</i> Link with emoji](#) | `<a><i>🥷</i> Text</a>` |
50
- | [![](https://www.google.com/s2/favicons?domain=any.digital&sz=64) Longer link <br> with favicon](#) | [<i>![](https://www.google.com/s2/favicons?domain=any.digital&sz=64)</i> Longer link <br> with favicon](#) | `<a><i><img src="..."></i> Text</a>` |
51
- | [<b class="fa-brands fa-github fa-lg"></b> Link with Font Awesome icon](#) | [<i class="fa-brands fa-github fa-lg"></i> Link with Font Awesome icon](#) | `<a><i class="fa-..."></i> Text</a>` |
46
+ | Without Blades <hr class="lg"> | With Blades' `<i>`-helper <hr class="lg"> | Clean HTML without `<span>ning` <hr class="x2"> |
47
+ | ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
48
+ | [🥷 Link with emoji](#) | [<i>🥷</i> Link with emoji](#) | `<a><i>🥷</i> Text</a>` |
49
+ | [![](https://www.google.com/s2/favicons?domain=any.digital&sz=64) Multi-line link <br> with favicon](#) | [<i>![](https://www.google.com/s2/favicons?domain=any.digital&sz=64)</i> Multi-line link <br> with favicon](#) | `<a><i><img src="..."></i> Text</a>` |
50
+ | [<b class="fa-brands fa-github fa-lg"></b> Link with Font Awesome icon](#) | [<i class="fa-brands fa-github fa-lg"></i> Link with Font Awesome icon](#) | `<a><i class="fa-..."></i> Text</a>` |
52
51
 
53
52
  ---
54
53
 
@@ -29,21 +29,24 @@ Soft-increase selector specificity trick:
29
29
 
30
30
  `table:not(.does-not-exist)` (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
31
31
 
32
- <!--section:docs-->
32
+ <!--section:docs,summary-->
33
+
34
+ `<table class="responsive">` allows a table to full-bleed and scroll on mobile.
33
35
 
34
- `<table class="responsive">` allows a table to full-bleed and scroll on mobile:
35
- <hr><div>
36
+ <!--section:docs-->
36
37
 
37
- | Term | Description <hr class="x2"> | Link |
38
- | --- | --- | --- |
38
+ | Term | Description <hr class="x2"> | Link |
39
+ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
39
40
  | 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 |
40
41
 
41
42
  {.responsive}
42
- </div><hr>
43
+
44
+ ---
43
45
 
44
46
  Tables inside https://blades.ninja/css/breakout/ are responsive by default.
45
47
 
46
48
  Living examples:
49
+
47
50
  - https://any.digital/insights/ai-ide/
48
51
  - https://any.digital/insights/css-frameworks/
49
52
  - https://any.digital/insights/ssg/