@leftium/nimble.css 0.11.0 → 0.12.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.
@@ -12,21 +12,24 @@
12
12
  // h2–h6 always carry top margin so they breathe above any preceding content,
13
13
  // regardless of DOM nesting (first-child of section, etc.).
14
14
  // Spec §8.3
15
+ // OP normalize uses --font-lineheight-1 (1.25) for ALL headings + --font-weight-9 (900).
16
+ // nimble uses a graduated lh scale + weight 700 (--font-weight-7).
17
+ // OP normalize heading sizes: h1=3.5rem h2=2.5rem h3=2rem h4=1.5rem h5=1.25rem h6=1.1rem
15
18
  $_heading-scale: (
16
- h1: (size: 2rem, lh: 1.1, mt: 0),
17
- h2: (size: 1.75rem, lh: 1.15, mt: 2rem),
18
- h3: (size: 1.5rem, lh: 1.2, mt: 1.5rem),
19
- h4: (size: 1.25rem, lh: 1.3, mt: 1.5rem),
20
- h5: (size: 1.125rem, lh: 1.4, mt: 1.5rem),
21
- h6: (size: 1rem, lh: 1.5, mt: 1.5rem),
19
+ h1: (size: 2rem, lh: 1.1, mt: 0), // OP --font-size-5/--size-7; lh: --font-lineheight-0
20
+ h2: (size: 1.75rem, lh: 1.15, mt: 2rem), // OP --size-6; lh: no OP match (near lh-0); mt: --size-7
21
+ h3: (size: 1.5rem, lh: 1.2, mt: 1.5rem), // OP --font-size-4/--size-5; lh: no OP match (near lh-1); mt: --size-5
22
+ h4: (size: 1.25rem, lh: 1.3, mt: 1.5rem), // OP --font-size-3/--size-4; lh: no OP match (near lh-1); mt: --size-5
23
+ h5: (size: 1.125rem, lh: 1.4, mt: 1.5rem), // no OP match (OP --font-size-2: 1.1rem); lh: no OP match; mt: --size-5
24
+ h6: (size: 1rem, lh: 1.5, mt: 1.5rem), // OP --font-size-1/--size-3; lh: --font-lineheight-3; mt: --size-5
22
25
  );
23
26
 
24
27
  // Phone breakpoint heading overrides
25
28
  // Spec §8.3
26
29
  $_heading-phone: (
27
- h1: 1.75rem,
28
- h2: 1.5rem,
29
- h3: 1.3rem,
30
+ h1: 1.75rem, // OP --size-6
31
+ h2: 1.5rem, // OP --size-5
32
+ h3: 1.3rem, // no OP match (near --size-4: 1.25rem)
30
33
  );
31
34
 
32
35
  @layer nimble.base {
@@ -38,8 +41,8 @@ $_heading-phone: (
38
41
  font-size: map.get($vals, size);
39
42
  line-height: map.get($vals, lh);
40
43
  margin-top: map.get($vals, mt);
41
- margin-bottom: var(#{$prefix}spacing);
42
- font-weight: 700;
44
+ margin-bottom: var(#{$prefix}spacing); // OP --size-3
45
+ font-weight: 700; // OP --font-weight-7 (OP normalize uses weight-9: 900)
43
46
  text-wrap: balance;
44
47
  }
45
48
  }
@@ -62,16 +65,29 @@ $_heading-phone: (
62
65
  margin-bottom: var(#{$prefix}spacing);
63
66
  }
64
67
 
68
+ // Prevent double spacing at page edges: body has padding-block,
69
+ // so strip margins that would stack with it.
70
+ // Must live inside @scope so it beats the scoped margin rules above.
71
+ // Uses :nth-child/:nth-last-child(of ...) to skip <script>/<style>.
72
+ body > :first-child,
73
+ body > :first-child > :first-child {
74
+ margin-top: 0;
75
+ }
76
+ body > :nth-last-child(1 of :not(script, style, dialog)),
77
+ body > :nth-last-child(1 of :not(script, style, dialog)) > :last-child {
78
+ margin-bottom: 0;
79
+ }
80
+
65
81
 
66
82
 
67
83
  // ----- Lists -----
68
84
 
69
85
  ul, ol {
70
- padding-inline-start: 1.5em;
86
+ padding-inline-start: 1.5em; // OP ~size-5 (em-relative); OP normalize: --size-8 (3rem)
71
87
  }
72
88
 
73
89
  :where(li) {
74
- margin-bottom: 0.25em;
90
+ margin-bottom: 0.25em; // OP ~size-1 (em-relative)
75
91
  }
76
92
 
77
93
  // Remove bottom margin on nested lists
@@ -80,12 +96,12 @@ $_heading-phone: (
80
96
  }
81
97
 
82
98
  dt {
83
- font-weight: 600;
99
+ font-weight: 600; // OP --font-weight-6 (OP normalize uses weight-7: 700)
84
100
  }
85
101
 
86
102
  dd {
87
- margin-inline-start: 1.5em;
88
- margin-bottom: 0.5em;
103
+ margin-inline-start: 1.5em; // OP ~size-5 (em-relative)
104
+ margin-bottom: 0.5em; // OP ~size-2 (em-relative)
89
105
  }
90
106
 
91
107
  // ----- Blockquote -----
@@ -94,15 +110,15 @@ $_heading-phone: (
94
110
  blockquote {
95
111
  margin-block: var(#{$prefix}spacing);
96
112
  margin-inline: 0;
97
- padding: 0.25em var(#{$prefix}spacing);
98
- border-inline-start: 0.25rem solid var(#{$prefix}border);
113
+ padding: 0.25em var(#{$prefix}spacing); // OP ~size-1 (em-relative), --size-3
114
+ border-inline-start: 0.25rem solid var(#{$prefix}border); // OP --size-1
99
115
  font-style: italic;
100
116
  }
101
117
 
102
118
  :where(blockquote) footer,
103
119
  :where(blockquote) cite {
104
120
  font-style: normal;
105
- font-size: 0.9em;
121
+ font-size: 0.9em; // no OP match (near ~size-3)
106
122
  color: color-mix(in oklch, var(#{$prefix}text), transparent 40%);
107
123
  }
108
124
 
@@ -120,7 +136,7 @@ $_heading-phone: (
120
136
  // Spec §9.10
121
137
 
122
138
  mark {
123
- padding: 0.1em 0.25em;
139
+ padding: 0.1em 0.25em; // 0.1em: no OP match (micro); 0.25em: OP ~size-1
124
140
  background-color: #{string.unquote('light-dark(#fde68a, oklch(0.55 0.12 85))')};
125
141
  color: #{string.unquote('light-dark(inherit, oklch(0.95 0.01 85))')};
126
142
  border-radius: 2px;