@anydigital/blades 0.27.0-beta.5 → 0.27.0-beta.7

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,11 +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
+ - [Sitemap](https://blades.ninja/html/#sitemap)
89
90
  - [Google Tag Manager](https://blades.ninja/html/#gtm)
90
91
 
91
- {.columns}
92
+ <!--{.columns}-->
92
93
 
93
94
  <!--section:index,install-html-->
94
95
  <details><summary role="button" class="outline"><b>Install HTML blades</b></summary>
@@ -140,7 +141,7 @@ Living example: https://github.com/anydigital/bladeswitch/blob/main/_config.yml
140
141
 
141
142
  Or use a preconfigured template:
142
143
 
143
- [🥷 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}-->
144
145
 
145
146
  ---
146
147
 
@@ -152,4 +153,4 @@ Or use a preconfigured template:
152
153
  - https://picocss.com/ for inspiration
153
154
  - https://11ty.dev/ for build power
154
155
 
155
- {.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,16 +203,33 @@ h6 {
193
203
  color: silver;
194
204
  text-decoration: none;
195
205
  }
196
- &:hover {
197
- [data-is-anchor] {
198
- visibility: visible;
206
+ /* Avoid double-tap on touch devices */
207
+ @media (hover: hover) {
208
+ &:hover {
209
+ [data-is-anchor] {
210
+ visibility: visible;
211
+ }
199
212
  }
200
213
  }
201
214
  }
202
215
 
203
216
  /*```
217
+ > **PRO-TIP** for 11ty + markdown-it-anchor: https://github.com/anydigital/eleventy-blades/blob/main/src/eleventy.config.js
204
218
 
205
219
  ### List markers
220
+
221
+ Use `data-marker="🥷"` helper attribute to customize list markers:
222
+ <article>
223
+
224
+ - You can make
225
+ - really {data-marker=❄️}
226
+ - cool {data-marker=🥶}
227
+ - markers {data-marker=🧊}
228
+ - with Blades CSS {data-marker=🥷}
229
+ - using `data-marker` helper attribute.
230
+ </article>
231
+
232
+ How it works:
206
233
  ```css */
207
234
 
208
235
  ul,
@@ -220,10 +247,12 @@ ol {
220
247
  }
221
248
  }
222
249
 
223
- /*``` <!--section--> */
250
+ /*```
251
+ <!--section--> */
224
252
 
225
253
  /* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
226
- <!--section:code-->```css */
254
+ <!--section:code-->
255
+ ```css */
227
256
 
228
257
  a {
229
258
  /* Helper to handle icons in links */
@@ -249,8 +278,26 @@ a {
249
278
  }
250
279
 
251
280
  /*```
281
+ > **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
282
+
252
283
  <!--section:docs-->
284
+
253
285
  ### Link [fav]icons
286
+
287
+ Wrap icons inside links using `<i>...&nbsp;</i>` helper to avoid underline. Compare:
288
+
289
+ <big class="grid">
290
+ <article><a href="https://github.com/anydigital/blades"> 🥷 Blades</a></article>
291
+ <article><a href="https://github.com/anydigital/blades"><i>🥷&nbsp;</i>Blades</a></article>
292
+ </big>
293
+
294
+ Use `data-has-favicon` helper attribute on plain-text links containing `<img>`-favicon for better alignment. Compare:
295
+
296
+ <big class="grid">
297
+ <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>
298
+ <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>
299
+ </big>
300
+
254
301
  <!--section--> */
255
302
 
256
303
  /* Extends https://github.com/picocss/pico/blob/main/scss/content/_table.scss
@@ -262,17 +309,23 @@ Simply insert `<hr>` inside `<th>` to forcibly widen too narrow columns (especia
262
309
  ```html
263
310
  <th>Col <hr></th>
264
311
  ```
265
- Example table:
266
- | SSG <hr> | Description |
267
- | --- | --- |
268
- | 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. |
269
-
270
- Same table without `<hr>`-expander would render as:
271
- | SSG | Description |
272
- | --- | --- |
273
- | 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. |
274
-
275
- ###### How it works
312
+ Example table before:
313
+ <article class="overflow-auto"><table>
314
+ <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>
315
+ </table></article>
316
+
317
+ Same table after adding `<hr>`-expanders:
318
+ <article class="overflow-auto"><table>
319
+ <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>
320
+ </table></article>
321
+
322
+ Living examples of big tables with `<hr>`-expanders:
323
+ - https://any.digital/insights/ai-ide/
324
+ - https://any.digital/insights/css-frameworks/
325
+ - https://any.digital/insights/ssg/
326
+ - https://blades.ninja/build-awesome-11ty/#min-starters
327
+
328
+ How it works:
276
329
  ```css */
277
330
 
278
331
  table {
@@ -292,16 +345,22 @@ table {
292
345
 
293
346
  /*```
294
347
  ---
348
+
295
349
  ### Borderless table
296
350
 
297
351
  `<table class="borderless">` removes all default borders:
298
- | Less | | Borders |
299
- | ---- | --- | ------- |
300
- | More | | Fun |
352
+
353
+ <article>
354
+
355
+ | Less | borders |
356
+ | ---- | ------- |
357
+ | more | fun |
301
358
 
302
359
  {.borderless}
360
+ </article>
303
361
 
304
362
  Living example: https://bladeswitch.com/#minimal-dependencies table
363
+
305
364
  <!--section--> */
306
365
 
307
366
  table.borderless {
@@ -343,18 +402,27 @@ table.responsive,
343
402
  Soft-increase selector specificity trick:
344
403
 
345
404
  `table:not(.does-not-exist)` (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
405
+
346
406
  <!--section:docs-->
407
+
347
408
  `<table class="responsive">` allows a table to full-bleed and scroll on mobile:
348
- <div>
409
+ <hr><div>
349
410
 
350
411
  | Term | Description <hr class="x2"> | Link |
351
412
  | --- | --- | --- |
352
413
  | 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 |
353
414
 
354
415
  {.responsive}
355
- </div>
416
+ </div><hr>
417
+
418
+ Tables inside https://blades.ninja/css/breakout/ are responsive by default.
419
+
420
+ Living examples:
421
+ - https://any.digital/insights/ai-ide/
422
+ - https://any.digital/insights/css-frameworks/
423
+ - https://any.digital/insights/ssg/
424
+ - https://blades.ninja/build-awesome-11ty/#min-starters
356
425
 
357
- Tables inside `.breakout[-all]` are responsive by default.
358
426
  <!--section--> */
359
427
 
360
428
  /* <!--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.5"
5
+ spec.version = "0.27.0-beta.7"
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.5",
3
+ "version": "0.27.0-beta.7",
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,15 +45,32 @@ h6 {
35
45
  color: silver;
36
46
  text-decoration: none;
37
47
  }
38
- &:hover {
39
- [data-is-anchor] {
40
- visibility: visible;
48
+ /* Avoid double-tap on touch devices */
49
+ @media (hover: hover) {
50
+ &:hover {
51
+ [data-is-anchor] {
52
+ visibility: visible;
53
+ }
41
54
  }
42
55
  }
43
56
  }
44
57
  /*```
58
+ > **PRO-TIP** for 11ty + markdown-it-anchor: https://github.com/anydigital/eleventy-blades/blob/main/src/eleventy.config.js
45
59
 
46
60
  ### List markers
61
+
62
+ Use `data-marker="🥷"` helper attribute to customize list markers:
63
+ <article>
64
+
65
+ - You can make
66
+ - really {data-marker=❄️}
67
+ - cool {data-marker=🥶}
68
+ - markers {data-marker=🧊}
69
+ - with Blades CSS {data-marker=🥷}
70
+ - using `data-marker` helper attribute.
71
+ </article>
72
+
73
+ How it works:
47
74
  ```css */
48
75
  ul,
49
76
  ol {
@@ -59,4 +86,5 @@ ol {
59
86
  }
60
87
  }
61
88
  }
62
- /*``` <!--section--> */
89
+ /*```
90
+ <!--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--> */