@leftium/nimble.css 0.10.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.
package/src/_print.scss CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  a[href]::after {
15
15
  content: " (" attr(href) ")";
16
- font-size: 0.85em;
16
+ font-size: 0.85em; // no OP match (near ~size-3)
17
17
  color: #555;
18
18
  }
19
19
 
@@ -8,81 +8,12 @@
8
8
 
9
9
  @layer nimble.base {
10
10
 
11
+ // Native system progress bars on all platforms.
12
+ // Custom styling via appearance: none is broken on iOS Safari (partial
13
+ // stripping of native chrome) and cannot be scoped away from WebKit/Blink
14
+ // via CSS alone. Native bars look fine everywhere.
11
15
  :where(progress) {
12
- -webkit-appearance: none;
13
- appearance: none;
14
- position: relative;
15
16
  width: 100%;
16
- height: 0.5rem;
17
- overflow: hidden;
18
- border: 0;
19
- border-radius: var(#{$prefix}radius);
20
- background-color: var(#{$prefix}surface-3);
21
- color: var(#{$prefix}primary); // Firefox uses color for the bar
22
- }
23
-
24
- :where(progress)::-webkit-progress-bar {
25
- border-radius: var(#{$prefix}radius);
26
- background-color: var(#{$prefix}surface-3);
27
- }
28
-
29
- :where(progress)::-webkit-progress-value {
30
- background-color: var(#{$prefix}primary);
31
- border-radius: var(#{$prefix}radius);
32
- transition: inline-size 0.3s ease;
33
- }
34
-
35
- :where(progress)::-moz-progress-bar {
36
- background-color: var(#{$prefix}primary);
37
- border-radius: var(#{$prefix}radius);
38
- }
39
-
40
- // Indeterminate: evenly-spaced blue bands travel continuously rightward.
41
- // Gradient is 200% wide with two identical 10%-wide bands at 15% and 65%.
42
- // They're 50% apart — exactly one visible width (100/200 = 50% of gradient).
43
- // Animating position by -200% = one full gradient width → seamless loop.
44
- :where(progress):not([value]) {
45
- --nc-progress-track:
46
- linear-gradient(to right,
47
- var(#{$prefix}surface-3) 0%,
48
- var(#{$prefix}primary) 25%,
49
- var(#{$prefix}primary) 25%,
50
- var(#{$prefix}surface-3) 50%,
51
- var(#{$prefix}surface-3) 50%,
52
- var(#{$prefix}primary) 75%,
53
- var(#{$prefix}primary) 75%,
54
- var(#{$prefix}surface-3) 100%);
55
- --nc-progress-track-size: 200% 100%;
56
- }
57
-
58
- @media (prefers-reduced-motion: no-preference) {
59
- @supports selector(progress::after) {
60
- :where(progress):not([value])::after {
61
- content: "";
62
- position: absolute;
63
- inset: 0;
64
- background: var(--nc-progress-track);
65
- background-size: var(--nc-progress-track-size);
66
- animation: nc-progress-indeterminate 12s linear infinite;
67
- }
68
- }
69
-
70
- :where(progress):not([value])::-webkit-progress-bar {
71
- background: var(--nc-progress-track);
72
- background-size: var(--nc-progress-track-size);
73
- animation: nc-progress-indeterminate 12s linear infinite;
74
- }
75
-
76
- :where(progress):not([value])::-moz-progress-bar {
77
- background: var(--nc-progress-track);
78
- background-size: var(--nc-progress-track-size);
79
- animation: nc-progress-indeterminate 12s linear infinite;
80
- }
81
- }
82
-
83
- @keyframes nc-progress-indeterminate {
84
- from { background-position: 0% 0%; }
85
- to { background-position: -200% 0%; }
86
17
  }
87
18
 
88
19
  }
package/src/_reset.scss CHANGED
@@ -81,11 +81,11 @@
81
81
  }
82
82
 
83
83
  :where(sub) {
84
- bottom: -0.25em;
84
+ bottom: -0.25em; // OP ~size-1 (em-relative, negative)
85
85
  }
86
86
 
87
87
  :where(sup) {
88
- top: -0.5em;
88
+ top: -0.5em; // OP ~size-2 (em-relative, negative)
89
89
  }
90
90
 
91
91
  // --- Embedded content ---
package/src/_select.scss CHANGED
@@ -32,7 +32,7 @@
32
32
  border: 1px solid var(#{$prefix}border);
33
33
  border-radius: var(#{$prefix}radius);
34
34
  background-color: var(#{$prefix}surface-1);
35
- padding: 0.25em;
35
+ padding: 0.25em; // OP ~size-1 (em-relative)
36
36
  // Fade in/out animation
37
37
  opacity: 0;
38
38
  transition: opacity 0.2s, overlay 0.2s allow-discrete, display 0.2s allow-discrete;
@@ -50,7 +50,8 @@
50
50
 
51
51
  // Options inside the picker
52
52
  :where(select) option {
53
- padding: 0.5em 0.75em;
53
+ padding: 0.5em 0.75em; // 0.5em: OP ~size-2; 0.75em: no OP match
54
+ // OP normalize: select uses 0.75ch block, --size-relative-4 inline
54
55
  border-radius: var(#{$prefix}radius);
55
56
  transition: background-color 0.15s;
56
57
  }
package/src/_tables.scss CHANGED
@@ -14,13 +14,14 @@
14
14
  }
15
15
 
16
16
  :where(th, td) {
17
- padding: 0.5em 0.75em;
17
+ padding: 0.5em 0.75em; // 0.5em: OP ~size-2; 0.75em: no OP match
18
+ // OP normalize: --size-2 (0.5rem) both axes
18
19
  border-bottom: 1px solid #{string.unquote('color-mix(in oklch, var(#{$prefix}border), transparent 40%)')};
19
20
  text-align: start;
20
21
  }
21
22
 
22
23
  :where(thead th, thead td) {
23
- font-weight: 600;
24
+ font-weight: 600; // OP --font-weight-6
24
25
  border-bottom-width: 2px;
25
26
  background-color: var(#{$prefix}surface-2);
26
27
  text-wrap: balance;
@@ -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;