@splendidlabz/styles 4.4.1 → 4.5.0

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/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@splendidlabz/styles",
3
- "version": "4.4.1",
3
+ "version": "4.5.0",
4
4
  "description": "",
5
5
  "type": "module",
6
+ "homepage": "https://splendidlabz.com/docs/styles",
6
7
  "author": "Zell Liew <zellwk@gmail.com>",
7
8
  "files": [
8
9
  "src",
@@ -5,25 +5,25 @@
5
5
  gap: 1lh;
6
6
  max-width: 100%;
7
7
 
8
- /* Using padding instead of margin, so #targets will leave some whitespace above when scrolling to the component. (We can also use scroll-margin-top + margin-top... but this is simpler). */
8
+ /* Using padding instead of margin, so #targets will leave some whitespace above when scrolling to the component. */
9
9
  > * + :where(h2),
10
10
  > * + :where(astro-island, astro-slot) > :where(h2):first-child {
11
11
  margin-top: calc(var(--spacing) * 6);
12
- scroll-margin-top: calc(var(--spacing) * 6);
12
+ scroll-margin-block: calc(var(--spacing) * 6);
13
13
  }
14
14
 
15
15
  > * + :where(h3),
16
16
  > * + :where(astro-island, astro-slot) > :where(h3):first-child {
17
17
  margin-top: calc(var(--spacing) * 4);
18
18
  margin-bottom: calc(var(--spacing) * -2);
19
- scroll-margin-top: calc(var(--spacing) * 4);
19
+ scroll-margin-block: calc(var(--spacing) * 4);
20
20
  }
21
21
 
22
22
  > * + :where(h4, h5, h6),
23
23
  > * + :where(astro-island, astro-slot) > :where(h4, h5, h6):first-child {
24
24
  margin-top: calc(var(--spacing) * 4);
25
25
  margin-bottom: calc(var(--spacing) * -4);
26
- scroll-margin-top: calc(var(--spacing) * 4);
26
+ scroll-margin-block: calc(var(--spacing) * 4);
27
27
  }
28
28
 
29
29
  :where(ul) {
@@ -59,7 +59,7 @@
59
59
  }
60
60
 
61
61
  :where(a) {
62
- text-decoration: underline;
62
+ text-decoration-line: underline;
63
63
  }
64
64
 
65
65
  :where(> img),
@@ -68,6 +68,15 @@
68
68
  border-radius: var(--radius);
69
69
  }
70
70
 
71
+ :where(> figure) {
72
+ inline-size: fit-content;
73
+ margin-inline: auto;
74
+ }
75
+
76
+ :where(> figure figcaption) {
77
+ contain: inline-size;
78
+ }
79
+
71
80
  :where(.fancylist) {
72
81
  margin-left: 1em;
73
82
  padding-left: 0;
@@ -5,6 +5,7 @@
5
5
  & {
6
6
  width: 100%;
7
7
  font-variant-numeric: lining-nums tabular-nums slashed-zero;
8
+ caption-side: bottom;
8
9
  }
9
10
  }
10
11
 
@@ -1,5 +1,5 @@
1
1
  @theme {
2
- --textarea-height: 9em;
2
+ --textarea-height: 6lh;
3
3
  }
4
4
 
5
5
  @layer base {
@@ -22,12 +22,17 @@
22
22
  white-space: nowrap;
23
23
  }
24
24
 
25
- @media (prefers-reduced-motion: reduce) {
26
- * {
27
- animation-duration: 0.01ms !important;
28
- animation-iteration-count: 1 !important;
29
- transition-duration: 0.01ms !important;
30
- scroll-behavior: auto !important;
25
+ @media (prefers-reduced-motion: no-preference) {
26
+ @view-transition {
27
+ navigation: auto;
28
+ }
29
+
30
+ html {
31
+ interpolate-size: allow-keywords;
32
+
33
+ &:focus-within {
34
+ scroll-behavior: var(--scroll-behavior, smooth);
35
+ }
31
36
  }
32
37
  }
33
38
  }
@@ -10,7 +10,7 @@
10
10
  padding: 0.125lh 0.75lh;
11
11
  font: inherit;
12
12
  font-family: var(--input-font);
13
- text-decoration: none !important;
13
+ text-decoration-line: none !important;
14
14
  cursor: pointer;
15
15
 
16
16
  &[disabled] {
@@ -45,7 +45,7 @@
45
45
  a {
46
46
  /* @apply pigment; */
47
47
  /* border-radius: 0; */
48
- text-decoration: none;
48
+ text-decoration-line: none;
49
49
  }
50
50
 
51
51
  a:where(:not(.button)) {
package/src/reset.css CHANGED
@@ -3,6 +3,9 @@
3
3
  **************/
4
4
  html {
5
5
  box-sizing: border-box;
6
+ tab-size: 2;
7
+ hanging-punctuation: first allow-end last;
8
+ overflow-wrap: break-word;
6
9
  }
7
10
 
8
11
  *,
@@ -34,18 +37,22 @@ body {
34
37
  border-style: solid;
35
38
  }
36
39
 
40
+ pre {
41
+ white-space: pre-wrap;
42
+ }
43
+
37
44
  /*********************
38
45
  * Avoid text overflows *
39
46
  *********************/
40
- p,
41
- h1,
42
- h2,
43
- h3,
44
- h4,
45
- h5,
46
- h6 {
47
- overflow-wrap: break-word;
48
- scroll-margin: 2em;
47
+ :target {
48
+ scroll-margin: 2rlh;
49
+ }
50
+
51
+ /* Chilled out text underlines */
52
+ /* https://frontendmasters.com/blog/chilled-out-text-underlines/ */
53
+ a {
54
+ text-underline-offset: 2px;
55
+ text-decoration-color: color-mix(in srgb, currentcolor, transparent 33%);
49
56
  }
50
57
 
51
58
  /*********************