@anydigital/blades 0.27.0-beta.6 → 0.27.0-beta.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 CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  Nunjucks/Liquid batteries included (for 11ty/Build Awesome, Jekyll, etc.) 🥷
15
15
 
16
- [![](https://img.shields.io/badge/Docs_&_Demos-darkslategray?style=for-the-badge)](https://blades.ninja/)
16
+ [![](https://img.shields.io/badge/Demo_&_Docs-darkslategray?style=for-the-badge)](https://blades.ninja/)
17
17
 
18
18
  ---
19
19
 
@@ -84,12 +84,12 @@ for 11ty/Build Awesome, Jekyll, etc.
84
84
 
85
85
  </hgroup>
86
86
 
87
- - [Base HTML](https://blades.ninja/html/#base) {data-marker=🥷}
87
+ - [Base HTML](https://blades.ninja/html/#base) <!--{data-marker=🥷}-->
88
88
  - [Links](https://blades.ninja/html/#links)
89
89
  - [Sitemap](https://blades.ninja/html/#sitemap)
90
90
  - [Google Tag Manager](https://blades.ninja/html/#gtm)
91
91
 
92
- {.columns}
92
+ <!--{.columns}-->
93
93
 
94
94
  <!--section:index,install-html-->
95
95
  <details><summary role="button" class="outline"><b>Install HTML blades</b></summary>
@@ -141,7 +141,7 @@ Living example: https://github.com/anydigital/bladeswitch/blob/main/_config.yml
141
141
 
142
142
  Or use a preconfigured template:
143
143
 
144
- [🥷 Bladeswitch Starter ↗ &nbsp;<small style="white-space: nowrap">Jekyll ⁺ Pico ⁺ Blades</small>](https://github.com/anydigital/bladeswitch){role=button .outline}
144
+ [🥷 Bladeswitch Starter ↗ &nbsp;<small style="white-space: nowrap">Jekyll ⁺ Pico ⁺ Blades</small>](https://github.com/anydigital/bladeswitch)<!--{role=button .outline}-->
145
145
 
146
146
  ---
147
147
 
@@ -153,4 +153,4 @@ Or use a preconfigured template:
153
153
  - https://picocss.com/ for inspiration
154
154
  - https://11ty.dev/ for build power
155
155
 
156
- {.unlist .columns}
156
+ <!--{.unlist .columns}-->
@@ -22,7 +22,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
22
22
  {% endcapture %}
23
23
  {{ _ | strip }}
24
24
  {% endif %}
25
- {% # prettier-ignore %}
25
+ <!--prettier-ignore-->
26
26
  {% comment %}```
27
27
  <!--section:docs-->
28
28
  Usage in Liquid:
package/assets/blades.css CHANGED
@@ -153,7 +153,11 @@ The breakout container has `10%` inline padding and a max-width of `calc(10% + 6
153
153
 
154
154
  /* Content */
155
155
 
156
- /*** Extends https://github.com/picocss/pico/blob/main/scss/content/_typography.scss ***/
156
+ /* Extends https://github.com/picocss/pico/blob/main/scss/content/_typography.scss
157
+ <!--section:docs-->
158
+
159
+ Global styles:
160
+ ```css */
157
161
 
158
162
  html {
159
163
  /* Enable font smoothing */
@@ -171,9 +175,15 @@ body {
171
175
  }
172
176
  }
173
177
 
174
- /*
175
- <!--section:docs-->
178
+ /*```
179
+
176
180
  ### Heading anchors
181
+
182
+ Set `data-is-anchor` attribute on anchors inside headings to position them absolutely, and show only on hover (when supported):
183
+
184
+ <article><h2>Heading with anchor <a href="#hwa" data-is-anchor>#</a></h2></article>
185
+
186
+ How it works:
177
187
  ```css */
178
188
 
179
189
  h1,
@@ -193,7 +203,7 @@ h6 {
193
203
  color: silver;
194
204
  text-decoration: none;
195
205
  }
196
- /* If hover is supported, show anchor on hover */
206
+ /* Avoid double-tap on touch devices */
197
207
  @media (hover: hover) {
198
208
  &:hover {
199
209
  [data-is-anchor] {
@@ -201,26 +211,46 @@ h6 {
201
211
  }
202
212
  }
203
213
  }
204
- /* Otherwise always show anchors, but subtle */
205
- @media (hover: none) {
206
- [data-is-anchor] {
207
- visibility: visible;
208
- opacity: 37.5%;
209
- }
210
- }
211
214
  }
212
215
 
213
216
  /*```
217
+ > **PRO-TIP** for 11ty + markdown-it-anchor: https://github.com/anydigital/eleventy-blades/blob/main/src/eleventy.config.js
214
218
 
215
219
  ### List markers
220
+
221
+ Use inline `style="--list-marker:'🥷 '"` on `<ul>/<ol>` or even individual `<li>` to customize list markers:
222
+ <article>
223
+
224
+ - Customize
225
+ - list
226
+ - markers
227
+ - with [Blades CSS](https://blades.ninja/css/) {style="--list-marker:'🥷 '"}
228
+
229
+ {style="--list-marker:'🧊 '"}
230
+ </article>
231
+
232
+ How it works:
216
233
  ```css */
217
234
 
218
235
  ul,
219
236
  ol {
237
+ &[style*="--list-marker:"] {
238
+ list-style-type: var(--list-marker);
239
+
240
+ > li {
241
+ list-style-type: inherit;
242
+ }
243
+ }
244
+
245
+ li[style*="--list-marker:"] {
246
+ list-style-type: var(--list-marker);
247
+ }
220
248
  li[data-marker]::marker {
249
+ /* ⚠️ `data-marker` works only in Chrome and Firefox */
221
250
  content: attr(data-marker) " ";
222
251
  }
223
252
 
253
+ /* Helper class to remove list styling at all */
224
254
  &.unlist {
225
255
  padding-inline-start: 0;
226
256
 
@@ -230,10 +260,12 @@ ol {
230
260
  }
231
261
  }
232
262
 
233
- /*``` <!--section--> */
263
+ /*```
264
+ <!--section--> */
234
265
 
235
266
  /* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
236
- <!--section:code-->```css */
267
+ <!--section:code-->
268
+ ```css */
237
269
 
238
270
  a {
239
271
  /* Helper to handle icons in links */
@@ -259,8 +291,26 @@ a {
259
291
  }
260
292
 
261
293
  /*```
294
+ > **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
295
+
262
296
  <!--section:docs-->
297
+
263
298
  ### Link [fav]icons
299
+
300
+ Wrap icons inside links using `<i>...&nbsp;</i>` helper to avoid underline. Compare:
301
+
302
+ <big class="grid">
303
+ <article><a href="https://github.com/anydigital/blades"> 🥷 Blades</a></article>
304
+ <article><a href="https://github.com/anydigital/blades"><i>🥷&nbsp;</i>Blades</a></article>
305
+ </big>
306
+
307
+ Use `data-has-favicon` helper attribute on plain-text links containing `<img>`-favicon for better alignment. Compare:
308
+
309
+ <big class="grid">
310
+ <article><a href="https://github.com/anydigital/blades" ><img src="https://www.google.com/s2/favicons?domain=github.com&amp;sz=64">/anydigital/blades</a></article>
311
+ <article><a href="https://github.com/anydigital/blades" data-has-favicon><img src="https://www.google.com/s2/favicons?domain=github.com&amp;sz=64">/anydigital/blades</a></article>
312
+ </big>
313
+
264
314
  <!--section--> */
265
315
 
266
316
  /* Extends https://github.com/picocss/pico/blob/main/scss/content/_table.scss
@@ -272,17 +322,23 @@ Simply insert `<hr>` inside `<th>` to forcibly widen too narrow columns (especia
272
322
  ```html
273
323
  <th>Col <hr></th>
274
324
  ```
275
- Example table:
276
- | SSG <hr> | Description |
277
- | --- | --- |
278
- | Build Awesome | Simple, flexible Static Site Generator (SSG) written in JavaScript. It is designed to be a faster, modern alternative to Jekyll, known for its "zero-config" philosophy and focus on performance. |
279
-
280
- Same table without `<hr>`-expander would render as:
281
- | SSG | Description |
282
- | --- | --- |
283
- | Build Awesome | Simple, flexible Static Site Generator (SSG) written in JavaScript. It is designed to be a faster, modern alternative to Jekyll, known for its "zero-config" philosophy and focus on performance. |
284
-
285
- ###### How it works
325
+ Example table before:
326
+ <article class="overflow-auto"><table>
327
+ <tr><th>Wide tables</th><th>with many</th><th>columns might</th><th>get collapsed</th><th>and be really</th><th>hard to read!</th></tr>
328
+ </table></article>
329
+
330
+ Same table after adding `<hr>`-expanders:
331
+ <article class="overflow-auto"><table>
332
+ <tr><th>Wide tables <hr></th><th>with many <hr></th><th>columns might <hr></th><th>get collapsed <hr></th><th>and be really <hr></th><th>hard to read! <hr></th></tr>
333
+ </table></article>
334
+
335
+ Living examples of big tables with `<hr>`-expanders:
336
+ - https://any.digital/insights/ai-ide/
337
+ - https://any.digital/insights/css-frameworks/
338
+ - https://any.digital/insights/ssg/
339
+ - https://blades.ninja/build-awesome-11ty/#min-starters
340
+
341
+ How it works:
286
342
  ```css */
287
343
 
288
344
  table {
@@ -302,16 +358,22 @@ table {
302
358
 
303
359
  /*```
304
360
  ---
361
+
305
362
  ### Borderless table
306
363
 
307
364
  `<table class="borderless">` removes all default borders:
308
- | Less | | Borders |
309
- | ---- | --- | ------- |
310
- | More | | Fun |
365
+
366
+ <article>
367
+
368
+ | Less | borders |
369
+ | ---- | ------- |
370
+ | more | fun |
311
371
 
312
372
  {.borderless}
373
+ </article>
313
374
 
314
375
  Living example: https://bladeswitch.com/#minimal-dependencies table
376
+
315
377
  <!--section--> */
316
378
 
317
379
  table.borderless {
@@ -353,18 +415,27 @@ table.responsive,
353
415
  Soft-increase selector specificity trick:
354
416
 
355
417
  `table:not(.does-not-exist)` (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
418
+
356
419
  <!--section:docs-->
420
+
357
421
  `<table class="responsive">` allows a table to full-bleed and scroll on mobile:
358
- <div>
422
+ <hr><div>
359
423
 
360
424
  | Term | Description <hr class="x2"> | Link |
361
425
  | --- | --- | --- |
362
426
  | 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 |
363
427
 
364
428
  {.responsive}
365
- </div>
429
+ </div><hr>
430
+
431
+ Tables inside https://blades.ninja/css/breakout/ are responsive by default.
432
+
433
+ Living examples:
434
+ - https://any.digital/insights/ai-ide/
435
+ - https://any.digital/insights/css-frameworks/
436
+ - https://any.digital/insights/ssg/
437
+ - https://blades.ninja/build-awesome-11ty/#min-starters
366
438
 
367
- Tables inside `.breakout[-all]` are responsive by default.
368
439
  <!--section--> */
369
440
 
370
441
  /* <!--section:docs-->
@@ -28,16 +28,25 @@ table.responsive,
28
28
  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-->
33
+
32
34
  `<table class="responsive">` allows a table to full-bleed and scroll on mobile:
33
- <div>
35
+ <hr><div>
34
36
 
35
37
  | Term | Description <hr class="x2"> | Link |
36
38
  | --- | --- | --- |
37
39
  | 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 |
38
40
 
39
41
  {.responsive}
40
- </div>
42
+ </div><hr>
43
+
44
+ Tables inside https://blades.ninja/css/breakout/ are responsive by default.
45
+
46
+ Living examples:
47
+ - https://any.digital/insights/ai-ide/
48
+ - https://any.digital/insights/css-frameworks/
49
+ - https://any.digital/insights/ssg/
50
+ - https://blades.ninja/build-awesome-11ty/#min-starters
41
51
 
42
- Tables inside `.breakout[-all]` are responsive by default.
43
52
  <!--section--> */
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.6"
5
+ spec.version = "0.27.0-beta.8"
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.6",
3
+ "version": "0.27.0-beta.8",
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/_link.css CHANGED
@@ -1,5 +1,6 @@
1
1
  /* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
2
- <!--section:code-->```css */
2
+ <!--section:code-->
3
+ ```css */
3
4
  a {
4
5
  /* Helper to handle icons in links */
5
6
  > i {
@@ -23,6 +24,24 @@ a {
23
24
  }
24
25
  }
25
26
  /*```
27
+ > **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
28
+
26
29
  <!--section:docs-->
30
+
27
31
  ### Link [fav]icons
32
+
33
+ Wrap icons inside links using `<i>...&nbsp;</i>` helper to avoid underline. Compare:
34
+
35
+ <big class="grid">
36
+ <article><a href="https://github.com/anydigital/blades"> 🥷 Blades</a></article>
37
+ <article><a href="https://github.com/anydigital/blades"><i>🥷&nbsp;</i>Blades</a></article>
38
+ </big>
39
+
40
+ Use `data-has-favicon` helper attribute on plain-text links containing `<img>`-favicon for better alignment. Compare:
41
+
42
+ <big class="grid">
43
+ <article><a href="https://github.com/anydigital/blades" ><img src="https://www.google.com/s2/favicons?domain=github.com&amp;sz=64">/anydigital/blades</a></article>
44
+ <article><a href="https://github.com/anydigital/blades" data-has-favicon><img src="https://www.google.com/s2/favicons?domain=github.com&amp;sz=64">/anydigital/blades</a></article>
45
+ </big>
46
+
28
47
  <!--section--> */
package/src/_table.css CHANGED
@@ -7,17 +7,23 @@ Simply insert `<hr>` inside `<th>` to forcibly widen too narrow columns (especia
7
7
  ```html
8
8
  <th>Col <hr></th>
9
9
  ```
10
- Example table:
11
- | SSG <hr> | Description |
12
- | --- | --- |
13
- | Build Awesome | Simple, flexible Static Site Generator (SSG) written in JavaScript. It is designed to be a faster, modern alternative to Jekyll, known for its "zero-config" philosophy and focus on performance. |
10
+ Example table before:
11
+ <article class="overflow-auto"><table>
12
+ <tr><th>Wide tables</th><th>with many</th><th>columns might</th><th>get collapsed</th><th>and be really</th><th>hard to read!</th></tr>
13
+ </table></article>
14
14
 
15
- Same table without `<hr>`-expander would render as:
16
- | SSG | Description |
17
- | --- | --- |
18
- | Build Awesome | Simple, flexible Static Site Generator (SSG) written in JavaScript. It is designed to be a faster, modern alternative to Jekyll, known for its "zero-config" philosophy and focus on performance. |
15
+ Same table after adding `<hr>`-expanders:
16
+ <article class="overflow-auto"><table>
17
+ <tr><th>Wide tables <hr></th><th>with many <hr></th><th>columns might <hr></th><th>get collapsed <hr></th><th>and be really <hr></th><th>hard to read! <hr></th></tr>
18
+ </table></article>
19
19
 
20
- ###### How it works
20
+ Living examples of big tables with `<hr>`-expanders:
21
+ - https://any.digital/insights/ai-ide/
22
+ - https://any.digital/insights/css-frameworks/
23
+ - https://any.digital/insights/ssg/
24
+ - https://blades.ninja/build-awesome-11ty/#min-starters
25
+
26
+ How it works:
21
27
  ```css */
22
28
  table {
23
29
  th {
@@ -35,16 +41,22 @@ table {
35
41
  }
36
42
  /*```
37
43
  ---
44
+
38
45
  ### Borderless table
39
46
 
40
47
  `<table class="borderless">` removes all default borders:
41
- | Less | | Borders |
42
- | ---- | --- | ------- |
43
- | More | | Fun |
48
+
49
+ <article>
50
+
51
+ | Less | borders |
52
+ | ---- | ------- |
53
+ | more | fun |
44
54
 
45
55
  {.borderless}
56
+ </article>
46
57
 
47
58
  Living example: https://bladeswitch.com/#minimal-dependencies table
59
+
48
60
  <!--section--> */
49
61
  table.borderless {
50
62
  th,
@@ -1,4 +1,8 @@
1
- /*** Extends https://github.com/picocss/pico/blob/main/scss/content/_typography.scss ***/
1
+ /* Extends https://github.com/picocss/pico/blob/main/scss/content/_typography.scss
2
+ <!--section:docs-->
3
+
4
+ Global styles:
5
+ ```css */
2
6
  html {
3
7
  /* Enable font smoothing */
4
8
  -webkit-font-smoothing: antialiased;
@@ -14,9 +18,15 @@ body {
14
18
  hyphens: none;
15
19
  }
16
20
  }
17
- /*
18
- <!--section:docs-->
21
+ /*```
22
+
19
23
  ### Heading anchors
24
+
25
+ Set `data-is-anchor` attribute on anchors inside headings to position them absolutely, and show only on hover (when supported):
26
+
27
+ <article><h2>Heading with anchor <a href="#hwa" data-is-anchor>#</a></h2></article>
28
+
29
+ How it works:
20
30
  ```css */
21
31
  h1,
22
32
  h2,
@@ -35,7 +45,7 @@ h6 {
35
45
  color: silver;
36
46
  text-decoration: none;
37
47
  }
38
- /* If hover is supported, show anchor on hover */
48
+ /* Avoid double-tap on touch devices */
39
49
  @media (hover: hover) {
40
50
  &:hover {
41
51
  [data-is-anchor] {
@@ -43,24 +53,44 @@ h6 {
43
53
  }
44
54
  }
45
55
  }
46
- /* Otherwise always show anchors, but subtle */
47
- @media (hover: none) {
48
- [data-is-anchor] {
49
- visibility: visible;
50
- opacity: 37.5%;
51
- }
52
- }
53
56
  }
54
57
  /*```
58
+ > **PRO-TIP** for 11ty + markdown-it-anchor: https://github.com/anydigital/eleventy-blades/blob/main/src/eleventy.config.js
55
59
 
56
60
  ### List markers
61
+
62
+ Use inline `style="--list-marker:'🥷 '"` on `<ul>/<ol>` or even individual `<li>` to customize list markers:
63
+ <article>
64
+
65
+ - Customize
66
+ - list
67
+ - markers
68
+ - with [Blades CSS](https://blades.ninja/css/) {style="--list-marker:'🥷 '"}
69
+
70
+ {style="--list-marker:'🧊 '"}
71
+ </article>
72
+
73
+ How it works:
57
74
  ```css */
58
75
  ul,
59
76
  ol {
77
+ &[style*="--list-marker:"] {
78
+ list-style-type: var(--list-marker);
79
+
80
+ > li {
81
+ list-style-type: inherit;
82
+ }
83
+ }
84
+
85
+ li[style*="--list-marker:"] {
86
+ list-style-type: var(--list-marker);
87
+ }
60
88
  li[data-marker]::marker {
89
+ /* ⚠️ `data-marker` works only in Chrome and Firefox */
61
90
  content: attr(data-marker) " ";
62
91
  }
63
92
 
93
+ /* Helper class to remove list styling at all */
64
94
  &.unlist {
65
95
  padding-inline-start: 0;
66
96
 
@@ -69,4 +99,5 @@ ol {
69
99
  }
70
100
  }
71
101
  }
72
- /*``` <!--section--> */
102
+ /*```
103
+ <!--section--> */
@@ -28,16 +28,25 @@ table.responsive,
28
28
  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-->
33
+
32
34
  `<table class="responsive">` allows a table to full-bleed and scroll on mobile:
33
- <div>
35
+ <hr><div>
34
36
 
35
37
  | Term | Description <hr class="x2"> | Link |
36
38
  | --- | --- | --- |
37
39
  | 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 |
38
40
 
39
41
  {.responsive}
40
- </div>
42
+ </div><hr>
43
+
44
+ Tables inside https://blades.ninja/css/breakout/ are responsive by default.
45
+
46
+ Living examples:
47
+ - https://any.digital/insights/ai-ide/
48
+ - https://any.digital/insights/css-frameworks/
49
+ - https://any.digital/insights/ssg/
50
+ - https://blades.ninja/build-awesome-11ty/#min-starters
41
51
 
42
- Tables inside `.breakout[-all]` are responsive by default.
43
52
  <!--section--> */