@anydigital/blades 0.27.0-beta.8 → 0.27.0-beta.9

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/assets/blades.css CHANGED
@@ -2,13 +2,11 @@
2
2
 
3
3
  /* Layout */
4
4
 
5
- /*
5
+ /* Extends https://github.com/picocss/pico/blob/main/scss/layout/
6
6
  <!--section:docs-->
7
7
 
8
- ### Document
9
- Extends https://github.com/picocss/pico/blob/main/scss/layout/_document.scss
10
-
11
- Prevent horizontal overflow and scrolling, modern way:
8
+ Global styles:
9
+ - Prevent horizontal overflow and scrolling, modern way.
12
10
  ```css */
13
11
 
14
12
  html {
@@ -18,10 +16,8 @@ html {
18
16
  /*```
19
17
 
20
18
  ### Landmarks
21
- Extends https://github.com/picocss/pico/blob/main/scss/layout/_landmarks.scss
22
-
23
- 1. Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support).
24
- 2. 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.
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.
25
21
  ```css */
26
22
 
27
23
  body {
@@ -36,6 +32,24 @@ body {
36
32
 
37
33
  /*```
38
34
 
35
+ ### Auto-columns
36
+ ```css */
37
+
38
+ .columns,
39
+ [data-is-toc] > ul,
40
+ [data-is-toc] > ol {
41
+ columns: 30ch auto; /* 2 cols max for 65ch container */
42
+
43
+ /* Avoid breaking inside elements, such as nested lists */
44
+ > * {
45
+ break-inside: avoid;
46
+ }
47
+ }
48
+
49
+ /*```
50
+
51
+ Table of contents (`[data-is-toc]`) has auto-columns by default.
52
+
39
53
  ### Jump to top
40
54
  ```css */
41
55
 
@@ -268,24 +282,17 @@ ol {
268
282
  ```css */
269
283
 
270
284
  a {
271
- /* Helper to handle icons in links */
285
+ /* Helper to handle [fav]icons in links */
272
286
  > i {
273
287
  display: inline-block;
274
288
  font-style: normal;
275
- }
276
-
277
- /* Helper for favicons in links */
278
- &[data-has-favicon] {
279
- display: inline-block;
280
289
 
281
290
  > img {
282
- max-height: 1.25em;
283
- margin-top: calc(-0.25em / 2);
284
- margin-inline-end: 0.375ch; /* =3/8 */
291
+ height: 1.25em;
292
+ margin-block: calc(-0.25em / 2);
285
293
 
286
294
  /* for tw-typography (.prose) */
287
295
  display: inline-block;
288
- margin-bottom: 0;
289
296
  }
290
297
  }
291
298
  }
@@ -297,18 +304,24 @@ a {
297
304
 
298
305
  ### Link [fav]icons
299
306
 
300
- Wrap icons inside links using `<i>...&nbsp;</i>` helper to avoid underline. Compare:
307
+ Wrap [fav]icons inside links using `<i>...&nbsp;</i>` helper to size automatically and avoid underline. Compare:
301
308
 
302
309
  <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>
310
+ <article><a href="https://github.com/anydigital/blades">
311
+ 🥷 Blades
312
+ </a></article>
313
+ <article><a href="https://github.com/anydigital/blades">
314
+ <i>🥷&nbsp;</i>Blades
315
+ </a></article>
305
316
  </big>
306
317
 
307
- Use `data-has-favicon` helper attribute on plain-text links containing `<img>`-favicon for better alignment. Compare:
308
-
309
318
  <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>
319
+ <article><a href="https://github.com/anydigital/blades">
320
+ <img src="https://www.google.com/s2/favicons?domain=github.com&amp;sz=64" >/anydigital/blades
321
+ </a></article>
322
+ <article><a href="https://github.com/anydigital/blades">
323
+ <i><img src="https://www.google.com/s2/favicons?domain=github.com&amp;sz=64">&nbsp;</i>/anydigital/blades
324
+ </a></article>
312
325
  </big>
313
326
 
314
327
  <!--section--> */
@@ -492,24 +505,6 @@ code {
492
505
  /*
493
506
  <!--section:docs-->
494
507
 
495
- ### Auto-columns
496
- ```css */
497
-
498
- .columns,
499
- [data-is-toc] > ul,
500
- [data-is-toc] > ol {
501
- columns: 30ch auto; /* 2 cols max for 65ch container */
502
-
503
- /* Avoid breaking inside elements, such as nested lists */
504
- > * {
505
- break-inside: avoid;
506
- }
507
- }
508
-
509
- /*```
510
-
511
- Table of contents (`[data-is-toc]`) has auto-columns by default.
512
-
513
508
  ### Auto-dark
514
509
  ```css */
515
510
 
@@ -523,7 +518,7 @@ Table of contents (`[data-is-toc]`) has auto-columns by default.
523
518
 
524
519
  /*```
525
520
 
526
- ### Misc
521
+ ### Faded
527
522
  ```css */
528
523
 
529
524
  .faded {
@@ -533,6 +528,11 @@ Table of contents (`[data-is-toc]`) has auto-columns by default.
533
528
  }
534
529
  }
535
530
 
531
+ /*```
532
+
533
+ ### Invert
534
+ ```css */
535
+
536
536
  /* Extends https://tailwindcss.com/docs/filter-invert */
537
537
 
538
538
  .invert {
@@ -1,3 +1,5 @@
1
+ /* <!--section:code-->
2
+ ```css */
1
3
  a {
2
4
  &:not([href^="#"]) {
3
5
  text-decoration-thickness: 1px;
@@ -6,29 +8,39 @@ a {
6
8
  }
7
9
  }
8
10
  }
9
-
10
11
  h1 {
11
12
  font-size: 2.5em; /* for pico.css & tw-typography */
12
13
  margin-bottom: 1rem; /* for tw-typography */
13
14
  }
14
-
15
+ /* Fix https://github.com/picocss/pico/blob/main/css/pico.css for the very first headings
16
+ :where(article, address, blockquote, dl, figure, form, ol, p, pre, table, ul) ~ :is(h1, h2, h3, h4, h5, h6) {
17
+ margin-top: var(--pico-typography-spacing-top);
18
+ }
19
+ */
20
+ h1,
21
+ h2,
22
+ h3,
23
+ h4,
24
+ h5,
25
+ h6 {
26
+ & ~ & {
27
+ margin-top: 2rem;
28
+ }
29
+ }
15
30
  hr {
16
31
  margin-block: 2em; /* for pico.css & tw-typography */
17
32
  }
18
-
19
33
  ul {
20
34
  ul {
21
35
  font-size: 87.5%;
22
36
  }
23
37
  }
24
-
25
38
  pre {
26
39
  small {
27
40
  opacity: 75%;
28
41
  font-weight: lighter;
29
42
  }
30
43
  }
31
-
32
44
  table {
33
45
  th {
34
46
  vertical-align: bottom;
@@ -41,7 +53,6 @@ table {
41
53
  margin-bottom: 0.25rem;
42
54
  }
43
55
  }
44
-
45
56
  [data-jump-to="top"] {
46
57
  > i {
47
58
  display: inline-block;
@@ -52,7 +63,6 @@ table {
52
63
  border-color: black;
53
64
  }
54
65
  }
55
-
56
66
  [data-is-toc] {
57
67
  font-size: 87.5%;
58
68
 
@@ -63,7 +73,6 @@ table {
63
73
  font-weight: 500;
64
74
  }
65
75
  }
66
-
67
76
  .breakout,
68
77
  .breakout-all {
69
78
  > img,
@@ -71,9 +80,10 @@ table {
71
80
  margin-bottom: 1rem;
72
81
  }
73
82
  }
74
-
75
83
  .faded {
76
84
  a {
77
85
  text-decoration-style: dotted;
78
86
  }
79
87
  }
88
+ /*```
89
+ <!--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.8"
5
+ spec.version = "0.27.0-beta.9"
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.8",
3
+ "version": "0.27.0-beta.9",
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,10 +1,8 @@
1
- /*
1
+ /* Extends https://github.com/picocss/pico/blob/main/scss/layout/
2
2
  <!--section:docs-->
3
3
 
4
- ### Document
5
- Extends https://github.com/picocss/pico/blob/main/scss/layout/_document.scss
6
-
7
- Prevent horizontal overflow and scrolling, modern way:
4
+ Global styles:
5
+ - Prevent horizontal overflow and scrolling, modern way.
8
6
  ```css */
9
7
  html {
10
8
  overflow-x: clip;
@@ -12,10 +10,8 @@ html {
12
10
  /*```
13
11
 
14
12
  ### Landmarks
15
- Extends https://github.com/picocss/pico/blob/main/scss/layout/_landmarks.scss
16
-
17
- 1. Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support).
18
- 2. 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.
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.
19
15
  ```css */
20
16
  body {
21
17
  min-height: 100dvh;
@@ -28,6 +24,22 @@ body {
28
24
  }
29
25
  /*```
30
26
 
27
+ ### Auto-columns
28
+ ```css */
29
+ .columns,
30
+ [data-is-toc] > ul,
31
+ [data-is-toc] > ol {
32
+ columns: 30ch auto; /* 2 cols max for 65ch container */
33
+
34
+ /* Avoid breaking inside elements, such as nested lists */
35
+ > * {
36
+ break-inside: avoid;
37
+ }
38
+ }
39
+ /*```
40
+
41
+ Table of contents (`[data-is-toc]`) has auto-columns by default.
42
+
31
43
  ### Jump to top
32
44
  ```css */
33
45
  [data-jump-to="top"] {
package/src/_link.css CHANGED
@@ -2,24 +2,17 @@
2
2
  <!--section:code-->
3
3
  ```css */
4
4
  a {
5
- /* Helper to handle icons in links */
5
+ /* Helper to handle [fav]icons in links */
6
6
  > i {
7
7
  display: inline-block;
8
8
  font-style: normal;
9
- }
10
-
11
- /* Helper for favicons in links */
12
- &[data-has-favicon] {
13
- display: inline-block;
14
9
 
15
10
  > img {
16
- max-height: 1.25em;
17
- margin-top: calc(-0.25em / 2);
18
- margin-inline-end: 0.375ch; /* =3/8 */
11
+ height: 1.25em;
12
+ margin-block: calc(-0.25em / 2);
19
13
 
20
14
  /* for tw-typography (.prose) */
21
15
  display: inline-block;
22
- margin-bottom: 0;
23
16
  }
24
17
  }
25
18
  }
@@ -30,18 +23,24 @@ a {
30
23
 
31
24
  ### Link [fav]icons
32
25
 
33
- Wrap icons inside links using `<i>...&nbsp;</i>` helper to avoid underline. Compare:
26
+ Wrap [fav]icons inside links using `<i>...&nbsp;</i>` helper to size automatically and avoid underline. Compare:
34
27
 
35
28
  <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>
29
+ <article><a href="https://github.com/anydigital/blades">
30
+ 🥷 Blades
31
+ </a></article>
32
+ <article><a href="https://github.com/anydigital/blades">
33
+ <i>🥷&nbsp;</i>Blades
34
+ </a></article>
38
35
  </big>
39
36
 
40
- Use `data-has-favicon` helper attribute on plain-text links containing `<img>`-favicon for better alignment. Compare:
41
-
42
37
  <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>
38
+ <article><a href="https://github.com/anydigital/blades">
39
+ <img src="https://www.google.com/s2/favicons?domain=github.com&amp;sz=64" >/anydigital/blades
40
+ </a></article>
41
+ <article><a href="https://github.com/anydigital/blades">
42
+ <i><img src="https://www.google.com/s2/favicons?domain=github.com&amp;sz=64">&nbsp;</i>/anydigital/blades
43
+ </a></article>
45
44
  </big>
46
45
 
47
46
  <!--section--> */
@@ -1,5 +1,7 @@
1
- /* <!--section:docs-->
2
- Overrides for https://github.com/picocss/pico/blob/main/scss/utilities/_reduce-motion.scss
1
+ /* Overrides https://github.com/picocss/pico/blob/main/scss/utilities/_reduce-motion.scss
2
+ <!--section:docs-->
3
+
4
+ ### Unreduce motion
3
5
  ```css */
4
6
  @utility unreduce-animation-* {
5
7
  @media (prefers-reduced-motion: reduce) {
@@ -10,4 +12,5 @@ Overrides for https://github.com/picocss/pico/blob/main/scss/utilities/_reduce-m
10
12
  }
11
13
  }
12
14
  }
13
- /*``` <!--section--> */
15
+ /*```
16
+ <!--section--> */
@@ -1,22 +1,6 @@
1
1
  /*
2
2
  <!--section:docs-->
3
3
 
4
- ### Auto-columns
5
- ```css */
6
- .columns,
7
- [data-is-toc] > ul,
8
- [data-is-toc] > ol {
9
- columns: 30ch auto; /* 2 cols max for 65ch container */
10
-
11
- /* Avoid breaking inside elements, such as nested lists */
12
- > * {
13
- break-inside: avoid;
14
- }
15
- }
16
- /*```
17
-
18
- Table of contents (`[data-is-toc]`) has auto-columns by default.
19
-
20
4
  ### Auto-dark
21
5
  ```css */
22
6
  @media (prefers-color-scheme: dark) {
@@ -28,7 +12,7 @@ Table of contents (`[data-is-toc]`) has auto-columns by default.
28
12
  }
29
13
  /*```
30
14
 
31
- ### Misc
15
+ ### Faded
32
16
  ```css */
33
17
  .faded {
34
18
  opacity: 50%;
@@ -36,7 +20,10 @@ Table of contents (`[data-is-toc]`) has auto-columns by default.
36
20
  opacity: 87.5%;
37
21
  }
38
22
  }
23
+ /*```
39
24
 
25
+ ### Invert
26
+ ```css */
40
27
  /* Extends https://tailwindcss.com/docs/filter-invert */
41
28
  .invert {
42
29
  /* Fix the scrollbar color when inverted */
@@ -1,3 +1,5 @@
1
+ /* <!--section:code-->
2
+ ```css */
1
3
  a {
2
4
  &:not([href^="#"]) {
3
5
  text-decoration-thickness: 1px;
@@ -12,6 +14,22 @@ h1 {
12
14
  margin-bottom: 1rem; /* for tw-typography */
13
15
  }
14
16
 
17
+ /* Fix https://github.com/picocss/pico/blob/main/css/pico.css for the very first headings
18
+ :where(article, address, blockquote, dl, figure, form, ol, p, pre, table, ul) ~ :is(h1, h2, h3, h4, h5, h6) {
19
+ margin-top: var(--pico-typography-spacing-top);
20
+ }
21
+ */
22
+ h1,
23
+ h2,
24
+ h3,
25
+ h4,
26
+ h5,
27
+ h6 {
28
+ & ~ & {
29
+ margin-top: 2rem;
30
+ }
31
+ }
32
+
15
33
  hr {
16
34
  margin-block: 2em; /* for pico.css & tw-typography */
17
35
  }
@@ -77,3 +95,5 @@ table {
77
95
  text-decoration-style: dotted;
78
96
  }
79
97
  }
98
+ /*```
99
+ <!--section--> */