@anydigital/blades 0.27.0-beta.6 → 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,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,18 +211,25 @@ 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 `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:
216
233
  ```css */
217
234
 
218
235
  ul,
@@ -230,10 +247,12 @@ ol {
230
247
  }
231
248
  }
232
249
 
233
- /*``` <!--section--> */
250
+ /*```
251
+ <!--section--> */
234
252
 
235
253
  /* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
236
- <!--section:code-->```css */
254
+ <!--section:code-->
255
+ ```css */
237
256
 
238
257
  a {
239
258
  /* Helper to handle icons in links */
@@ -259,8 +278,26 @@ a {
259
278
  }
260
279
 
261
280
  /*```
281
+ > **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
282
+
262
283
  <!--section:docs-->
284
+
263
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
+
264
301
  <!--section--> */
265
302
 
266
303
  /* Extends https://github.com/picocss/pico/blob/main/scss/content/_table.scss
@@ -272,17 +309,23 @@ Simply insert `<hr>` inside `<th>` to forcibly widen too narrow columns (especia
272
309
  ```html
273
310
  <th>Col <hr></th>
274
311
  ```
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
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:
286
329
  ```css */
287
330
 
288
331
  table {
@@ -302,16 +345,22 @@ table {
302
345
 
303
346
  /*```
304
347
  ---
348
+
305
349
  ### Borderless table
306
350
 
307
351
  `<table class="borderless">` removes all default borders:
308
- | Less | | Borders |
309
- | ---- | --- | ------- |
310
- | More | | Fun |
352
+
353
+ <article>
354
+
355
+ | Less | borders |
356
+ | ---- | ------- |
357
+ | more | fun |
311
358
 
312
359
  {.borderless}
360
+ </article>
313
361
 
314
362
  Living example: https://bladeswitch.com/#minimal-dependencies table
363
+
315
364
  <!--section--> */
316
365
 
317
366
  table.borderless {
@@ -353,18 +402,27 @@ table.responsive,
353
402
  Soft-increase selector specificity trick:
354
403
 
355
404
  `table:not(.does-not-exist)` (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
405
+
356
406
  <!--section:docs-->
407
+
357
408
  `<table class="responsive">` allows a table to full-bleed and scroll on mobile:
358
- <div>
409
+ <hr><div>
359
410
 
360
411
  | Term | Description <hr class="x2"> | Link |
361
412
  | --- | --- | --- |
362
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 |
363
414
 
364
415
  {.responsive}
365
- </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
366
425
 
367
- Tables inside `.breakout[-all]` are responsive by default.
368
426
  <!--section--> */
369
427
 
370
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.6"
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.6",
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,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,17 +53,24 @@ 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 `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:
57
74
  ```css */
58
75
  ul,
59
76
  ol {
@@ -69,4 +86,5 @@ ol {
69
86
  }
70
87
  }
71
88
  }
72
- /*``` <!--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--> */