@vttforge/styles 0.3.3 → 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/CHANGELOG.md +23 -0
- package/README.md +29 -5
- package/base.css +58 -56
- package/components.css +731 -733
- package/index.css +22 -5
- package/package.json +1 -1
- package/styles.layer.css +13 -6
- package/themes/forge.css +17 -19
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
|
|
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
|
-
*
|
|
10
|
-
*
|
|
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
|
|
30
|
+
@layer vttforge.tokens, vttforge.reset;
|
|
14
31
|
|
|
15
32
|
@import "./dist/tokens.css";
|
|
16
33
|
@import "./reset.css";
|
package/package.json
CHANGED
package/styles.layer.css
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @vttforge/styles — styles.layer.css
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
-
*
|
|
10
|
-
*
|
|
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
|
|
10
|
-
*
|
|
9
|
+
* Imported after components and, like them, unlayered, so theme overrides win
|
|
10
|
+
* on source order.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
@
|
|
14
|
-
|
|
15
|
-
:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
}
|