@vttforge/styles 0.3.2 → 0.4.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/index.css CHANGED
@@ -1,16 +1,33 @@
1
1
  /*!
2
2
  * @vttforge/styles
3
3
  *
4
- * One-line import for consumers that want everything VTTForge ships, in the right
5
- * cascade-layer order.
4
+ * One-line import for consumers that want everything VTTForge ships:
6
5
  *
7
6
  * @import '@vttforge/styles';
8
7
  *
9
- * Layer order matches Foundry v13's outer layer: tokens reset base → components themes.
10
- * Foundry's own runtime wraps system CSS in its top-level `system` layer.
8
+ * Only tokens and the reset sit in a cascade layer. Base, components and the
9
+ * theme are deliberately unlayered.
10
+ *
11
+ * Foundry has already put this file in a layer by the time you see it. A
12
+ * system's stylesheet goes in `@layer system` and a module's in
13
+ * `@layer modules`; the manifest's `styles` entry takes an optional `layer`,
14
+ * and leaving it out lets the server fill one in. So the question here is
15
+ * never whether these rules are layered. It is how they sort against the rest
16
+ * of what is in that same layer, which is your own CSS.
17
+ *
18
+ * An unlayered rule beats every layered one in the same layer, whatever the
19
+ * specificity. Sub-layer the components and a bare `button { }` of yours beats
20
+ * `.vttf-btn`, and nothing you write can lose. That sounds convenient until a
21
+ * broad selector meant for one corner restyles every component. Leaving them
22
+ * unlayered puts the two on the same footing, where specificity decides.
23
+ *
24
+ * Tokens and the reset stay layered on purpose, and lose on purpose. Tokens are
25
+ * custom properties a consumer must be able to override with one plain
26
+ * declaration. The reset touches bare elements inside `.vttf-app`, so keeping it
27
+ * layered means it never outranks a real rule from the system around it.
11
28
  */
12
29
 
13
- @layer vttforge.tokens, vttforge.reset, vttforge.base, vttforge.components, vttforge.themes;
30
+ @layer vttforge.tokens, vttforge.reset;
14
31
 
15
32
  @import "./dist/tokens.css";
16
33
  @import "./reset.css";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vttforge/styles",
3
- "version": "0.3.2",
4
- "description": "VTTForge base CSS layer: design tokens, reset, base, components, opt-in themes (CSS Cascade Layers).",
3
+ "version": "0.4.0",
4
+ "description": "VTTForge design system as CSS: tokens, reset, base, components and opt-in themes over cascade layers.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/vttforge/vttforge#readme",
package/styles.layer.css CHANGED
@@ -1,13 +1,20 @@
1
1
  /*!
2
2
  * @vttforge/styles — styles.layer.css
3
3
  *
4
- * Mantine-style variant: wraps `index.css` inside an explicit `@layer vttforge`
5
- * for consumers that want a single namespaced layer instead of the five
6
- * sub-layers (`vttforge.tokens`, `vttforge.reset`, `vttforge.base`,
7
- * `vttforge.components`, `vttforge.themes`).
4
+ * The opt-in variant: everything VTTForge ships, wrapped in one `@layer
5
+ * vttforge` you can order against layers of your own.
8
6
  *
9
- * Use this entry when you need to control VTTForge's cascade position relative
10
- * to your own layers; use the default `index.css` otherwise.
7
+ * @layer vttforge, my-system;
8
+ * @import '@vttforge/styles/layer';
9
+ *
10
+ * Foundry has already placed this file in `@layer system` (or `modules`), so
11
+ * this nests a layer inside that one. The effect is that every rule here loses
12
+ * to your own CSS in the same layer, whatever the specificity, which is the
13
+ * behaviour the default entry deliberately does not have.
14
+ *
15
+ * That is the trade the variant exists to make: you give up composing on
16
+ * specificity in exchange for being able to order these styles as a block.
17
+ * Reach for `index.css` unless you need that.
11
18
  */
12
19
 
13
20
  @layer vttforge {
package/themes/forge.css CHANGED
@@ -6,26 +6,24 @@
6
6
  * preference takes over. Explicit `data-theme="light"` and
7
7
  * `data-theme="foundry"` are handled by tokens.css.
8
8
  *
9
- * Imported by `index.css` and `styles.layer.css` after components, so theme
10
- * overrides win cleanly inside `@layer vttforge.themes`.
9
+ * Imported after components and, like them, unlayered, so theme overrides win
10
+ * on source order.
11
11
  */
12
12
 
13
- @layer vttforge.themes {
14
- @media (prefers-color-scheme: light) {
15
- :where([data-theme="auto"]) {
16
- --vttf-bg: oklch(0.985 0.004 80);
17
- --vttf-bg-elevated: oklch(0.972 0.006 78);
18
- --vttf-bg-sunken: oklch(0.945 0.01 72);
19
- --vttf-surface: oklch(0.962 0.008 75);
20
- --vttf-surface-2: oklch(0.928 0.012 68);
21
- --vttf-border: oklch(0.88 0.014 62);
22
- --vttf-border-strong: oklch(0.76 0.016 58);
23
- --vttf-text: oklch(0.215 0.02 42);
24
- --vttf-text-muted: oklch(0.43 0.018 48);
25
- --vttf-text-faint: oklch(0.595 0.014 55);
26
- --vttf-ember: oklch(0.565 0.18 36);
27
- --vttf-ember-deep: oklch(0.43 0.16 30);
28
- --vttf-ember-glow: oklch(0.67 0.17 42);
29
- }
13
+ @media (prefers-color-scheme: light) {
14
+ :where([data-theme="auto"]) {
15
+ --vttf-bg: oklch(0.985 0.004 80);
16
+ --vttf-bg-elevated: oklch(0.972 0.006 78);
17
+ --vttf-bg-sunken: oklch(0.945 0.01 72);
18
+ --vttf-surface: oklch(0.962 0.008 75);
19
+ --vttf-surface-2: oklch(0.928 0.012 68);
20
+ --vttf-border: oklch(0.88 0.014 62);
21
+ --vttf-border-strong: oklch(0.76 0.016 58);
22
+ --vttf-text: oklch(0.215 0.02 42);
23
+ --vttf-text-muted: oklch(0.43 0.018 48);
24
+ --vttf-text-faint: oklch(0.595 0.014 55);
25
+ --vttf-ember: oklch(0.565 0.18 36);
26
+ --vttf-ember-deep: oklch(0.43 0.16 30);
27
+ --vttf-ember-glow: oklch(0.67 0.17 42);
30
28
  }
31
29
  }