@rowkit/tokens 0.4.0 → 1.0.0-beta.1

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/dist/css.d.ts CHANGED
@@ -5,10 +5,22 @@
5
5
  * the stylesheet from them, so the two cannot drift. `css.test.ts` asserts that
6
6
  * every token in every scale reaches the output.
7
7
  *
8
- * Dark mode works by repointing *semantic* tokens under `.dark`. Primitives are
9
- * emitted once and never change — `--color-primary-600` is the same colour in
10
- * both themes; what changes is which primitive `--color-primary-solid` points
11
- * at. That is why the theme can flip without a single hardcoded colour moving.
8
+ * Two themes. Windows 98 is the default, carried by `:root`; the modern theme
9
+ * is switched on by `data-theme="modern"` on any element, and its dark scheme
10
+ * by the system or by `data-color-scheme="dark"` on that same element. A theme
11
+ * is a set of custom property values and nothing else, so themes nest: a
12
+ * region marked `data-theme="win98"` inside a modern page is Windows 98.
13
+ *
14
+ * One thing makes that work, and it is easy to break. A custom property whose
15
+ * value contains `var()` is resolved on the element that declares it, and
16
+ * descendants inherit the result. A theme therefore re-declares every token it
17
+ * changes on its own element; repointing a primitive at `:root` would not reach
18
+ * a semantic token that has already been resolved there.
19
+ *
20
+ * Shadows take one more step. Tailwind copies a `--shadow-*` value into each
21
+ * `shadow-*` utility rather than referencing it, so a theme could never change
22
+ * one. The `@theme` entry is therefore `var(--rk-shadow-*)`, and the value
23
+ * lives in that variable.
12
24
  *
13
25
  * @returns The complete stylesheet, ready to write to disk.
14
26
  */