@eagami/ui 4.1.1 → 4.3.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagami/ui",
3
- "version": "4.1.1",
3
+ "version": "4.3.0",
4
4
  "description": "Lightweight, accessible Angular UI component library built on CSS custom properties",
5
5
  "author": "Michal Wiraszka <michal@eagami.com>",
6
6
  "license": "MIT",
@@ -1,4 +1,10 @@
1
- :root {
1
+ // Every token-declaring selector is wrapped in :where() so it contributes zero
2
+ // specificity. A consumer's own root-level token override (specificity 0,1,0)
3
+ // then wins in light mode, OS-dark, and forced dark alike, independent of
4
+ // stylesheet load order. The library's own light-to-dark switching still
5
+ // resolves correctly by source order, since the dark blocks come after the
6
+ // light ones at equal (zero) specificity.
7
+ :where(:root) {
2
8
  --color-primary-50: #ecf3f9;
3
9
  --color-primary-100: #d1e3f0;
4
10
  --color-primary-200: #abcbe3;
@@ -248,12 +254,12 @@
248
254
  }
249
255
 
250
256
  @media (prefers-color-scheme: dark) {
251
- :root:not([data-theme='light']) {
257
+ :where(:root:not([data-theme='light'])) {
252
258
  @include dark-color-tokens;
253
259
  }
254
260
  }
255
261
 
256
- :root[data-theme='dark'] {
262
+ :where(:root[data-theme='dark']) {
257
263
  @include dark-color-tokens;
258
264
  color-scheme: dark;
259
265
  }
@@ -1,4 +1,6 @@
1
- :root {
1
+ // :where() keeps these at zero specificity so consumer overrides win in every
2
+ // theme; see the note in _colors.scss.
3
+ :where(:root) {
2
4
  --shadow-none: none;
3
5
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
4
6
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
@@ -75,11 +77,11 @@
75
77
  }
76
78
 
77
79
  @media (prefers-color-scheme: dark) {
78
- :root:not([data-theme='light']) {
80
+ :where(:root:not([data-theme='light'])) {
79
81
  @include dark-elevation-tokens;
80
82
  }
81
83
  }
82
84
 
83
- :root[data-theme='dark'] {
85
+ :where(:root[data-theme='dark']) {
84
86
  @include dark-elevation-tokens;
85
87
  }
@@ -1,4 +1,5 @@
1
- :root {
1
+ // :where() keeps tokens at zero specificity so consumer overrides win; see _colors.scss.
2
+ :where(:root) {
2
3
  --duration-instant: 0ms;
3
4
  --duration-fast: 100ms;
4
5
  --duration-normal: 200ms;
@@ -27,7 +28,7 @@
27
28
  }
28
29
 
29
30
  @media (prefers-reduced-motion: reduce) {
30
- :root {
31
+ :where(:root) {
31
32
  --duration-fast: 0ms;
32
33
  --duration-normal: 0ms;
33
34
  --duration-slow: 0ms;
@@ -1,4 +1,5 @@
1
- :root {
1
+ // :where() keeps tokens at zero specificity so consumer overrides win; see _colors.scss.
2
+ :where(:root) {
2
3
  --radius-none: 0;
3
4
  --radius-xs: 0.125rem; // 2px
4
5
  --radius-sm: 0.25rem; // 4px
@@ -1,4 +1,5 @@
1
- :root {
1
+ // :where() keeps tokens at zero specificity so consumer overrides win; see _colors.scss.
2
+ :where(:root) {
2
3
  --space-0: 0;
3
4
  --space-px: 1px;
4
5
  --space-0-5: 0.125rem; // 2px
@@ -1,4 +1,5 @@
1
- :root {
1
+ // :where() keeps tokens at zero specificity so consumer overrides win; see _colors.scss.
2
+ :where(:root) {
2
3
  // The `* Fallback` faces are Arial tuned with metric overrides to match the
3
4
  // web fonts, so they must sit right after each web font in the stack: that way
4
5
  // text laid out before the font loads has the same metrics and `font-display: