@astra-spec/ui 0.0.1 → 0.0.2
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/README.md +10 -2
- package/TOKENS.md +2 -2
- package/package.json +1 -1
- package/styles/tokens.css +10 -8
package/README.md
CHANGED
|
@@ -233,9 +233,17 @@ the same `.astra-ui` scope:
|
|
|
233
233
|
}
|
|
234
234
|
```
|
|
235
235
|
|
|
236
|
+
The bundled light and dark values are independent, brand-neutral fallbacks so
|
|
237
|
+
the package remains usable on its own. An external theme should map its own
|
|
238
|
+
primitives onto these semantic roles under an explicit opt-in scope; it should
|
|
239
|
+
not duplicate component selectors or make `@astra-spec/ui` depend on the brand.
|
|
240
|
+
|
|
236
241
|
The complete token list and default values are in [TOKENS.md](./TOKENS.md).
|
|
237
|
-
Set `data-astra-color-scheme="dark"` on `.astra-ui`
|
|
238
|
-
|
|
242
|
+
Set `data-astra-color-scheme="light"` or `"dark"` on `.astra-ui`; `"dark"`
|
|
243
|
+
selects the built-in dark palette and `"light"` uses the base palette. Leaving
|
|
244
|
+
the attribute unset also uses the base palette. The package deliberately does
|
|
245
|
+
not inspect host-specific theme state. An integration maps its host theme to
|
|
246
|
+
this attribute and updates it when that theme changes.
|
|
239
247
|
|
|
240
248
|
Styled roots and internal parts expose `data-slot` attributes. Kinds and
|
|
241
249
|
variants use attributes including `data-kind`, `data-mode`, `data-layout`,
|
package/TOKENS.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Generated from `styles/tokens.css` by `scripts/tokens-doc.mjs`; do not edit by hand.
|
|
4
4
|
|
|
5
|
-
Every token is declared on `:where(.astra-ui)` at zero specificity, so
|
|
5
|
+
Every token is declared on `:where(.astra-ui)` at zero specificity in the `astra.tokens` layer. The bundled values are independent, brand-neutral fallbacks so the package remains usable on its own; external themes map their primitives onto these semantic roles under an explicit opt-in scope. Override tokens on the `.astra-ui` root with a later or unlayered rule, or on a descendant for a narrower scope; normal cascade and inheritance rules apply. Set `data-astra-color-scheme="light"` or `"dark"` on `.astra-ui`; `"dark"` selects the built-in dark palette and `"light"` uses the base palette. Leaving the attribute unset also uses the base palette. The package does not inspect host theme state: integrations map their host theme to this attribute and update it when that theme changes.
|
|
6
6
|
|
|
7
7
|
## Surfaces
|
|
8
8
|
|
|
@@ -22,7 +22,7 @@ Every token is declared on `:where(.astra-ui)` at zero specificity, so a theme r
|
|
|
22
22
|
| --- | --- | --- |
|
|
23
23
|
| `--astra-color-text` | `#221f20` | `#f2eee7` |
|
|
24
24
|
| `--astra-color-text-muted` | `#4e5a70` | `#c4bdb2` |
|
|
25
|
-
| `--astra-color-text-subtle` | `#
|
|
25
|
+
| `--astra-color-text-subtle` | `#796d61` | `#a39b90` |
|
|
26
26
|
| `--astra-color-text-faint` | `#b8b0a8` | `#777168` |
|
|
27
27
|
| `--astra-color-eyebrow` | `#3f7280` | `#86adb7` |
|
|
28
28
|
|
package/package.json
CHANGED
package/styles/tokens.css
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* astra-ui token contract.
|
|
3
3
|
*
|
|
4
4
|
* Every custom property the components consume is declared here with a
|
|
5
|
-
* literal default, at zero specificity
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* literal default, at zero specificity. Override tokens on the `.astra-ui`
|
|
6
|
+
* root with a later or unlayered rule, or on a descendant for a narrower
|
|
7
|
+
* scope; normal cascade and inheritance rules apply. Themes only set values;
|
|
8
|
+
* they never need to know component internals. Host integrations own theme
|
|
9
|
+
* detection and select a built-in palette with
|
|
10
|
+
* `data-astra-color-scheme="light|dark"`.
|
|
9
11
|
*/
|
|
10
12
|
@layer astra.tokens, astra.base, astra.components, astra.views;
|
|
11
13
|
|
|
@@ -23,7 +25,8 @@
|
|
|
23
25
|
/* Text */
|
|
24
26
|
--astra-color-text: #221f20;
|
|
25
27
|
--astra-color-text-muted: #4e5a70;
|
|
26
|
-
--astra-color-text-subtle: #
|
|
28
|
+
--astra-color-text-subtle: #796d61;
|
|
29
|
+
/* Decorative glyphs only; this intentionally is not a text colour. */
|
|
27
30
|
--astra-color-text-faint: #b8b0a8;
|
|
28
31
|
--astra-color-eyebrow: #3f7280;
|
|
29
32
|
|
|
@@ -77,9 +80,8 @@
|
|
|
77
80
|
--astra-z-fullscreen: 10000;
|
|
78
81
|
}
|
|
79
82
|
|
|
80
|
-
/* Dark palette: explicit opt-in
|
|
81
|
-
:where(.astra-ui[data-astra-color-scheme="dark"])
|
|
82
|
-
:where([data-jp-theme-light="false"], .vscode-dark, .vscode-high-contrast) :where(.astra-ui:not([data-astra-color-scheme="light"])) {
|
|
83
|
+
/* Dark palette: explicit opt-in by the integrating host. */
|
|
84
|
+
:where(.astra-ui[data-astra-color-scheme="dark"]) {
|
|
83
85
|
--astra-color-canvas: #171614;
|
|
84
86
|
--astra-color-surface: #1e1d1a;
|
|
85
87
|
--astra-color-surface-raised: #272520;
|