stillwind 0.0.0 → 0.1.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/AGENTS_TEMPLATE.md +5 -0
- package/LICENSE +21 -0
- package/README.md +166 -0
- package/TAILWINDCSS-MIT-LICENSE +21 -0
- package/css/builtin-metadata/sw-motion-properties.css +186 -0
- package/css/builtin-metadata/tw-legacy-metadata.css +36 -0
- package/css/builtin-metadata/tw-properties.css +944 -0
- package/css/builtin-metadata/tw-registry-metadata.css +52 -0
- package/css/builtin-metadata/tw-relationship-metadata.css +10 -0
- package/css/builtin-utilities/sw-motion-contexts.css +1043 -0
- package/css/builtin-utilities/tw-backgrounds.css +606 -0
- package/css/builtin-utilities/tw-borders.css +954 -0
- package/css/builtin-utilities/tw-effects.css +1209 -0
- package/css/builtin-utilities/tw-flex-grid.css +749 -0
- package/css/builtin-utilities/tw-interactivity.css +680 -0
- package/css/builtin-utilities/tw-layout.css +943 -0
- package/css/builtin-utilities/tw-masks.css +1268 -0
- package/css/builtin-utilities/tw-motion.css +142 -0
- package/css/builtin-utilities/tw-spacing-sizing.css +621 -0
- package/css/builtin-utilities/tw-svg.css +50 -0
- package/css/builtin-utilities/tw-transforms.css +652 -0
- package/css/builtin-utilities/tw-typography.css +720 -0
- package/css/builtin-variants/sw-conditional.css +5 -0
- package/css/builtin-variants/sw-document.css +13 -0
- package/css/builtin-variants/tw-conditional.css +187 -0
- package/css/builtin-variants/tw-dynamic-selector.css +49 -0
- package/css/builtin-variants/tw-relationship.css +41 -0
- package/css/builtin-variants/tw-state.css +159 -0
- package/css/builtin-variants/tw-structural.css +121 -0
- package/css/builtins.css +111 -0
- package/css/preflight.css +401 -0
- package/css/templates.css +40 -0
- package/css/theme.css +546 -0
- package/css/utilities.css +9 -0
- package/dist/class-object-D24FFYqO.js +6 -0
- package/dist/class-object-D24FFYqO.js.map +1 -0
- package/dist/class-object-D7ZGJOf_.d.ts +9 -0
- package/dist/class-string-CQHnc9GN.d.ts +9 -0
- package/dist/class-string-Db8-oI4q.js +6 -0
- package/dist/class-string-Db8-oI4q.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +2 -0
- package/dist/css.d.ts +100 -0
- package/dist/css.js +143 -0
- package/dist/css.js.map +1 -0
- package/dist/cva-BwX07CFw.js +204 -0
- package/dist/cva-BwX07CFw.js.map +1 -0
- package/dist/cva-DSpDNBYi.d.ts +9 -0
- package/dist/development-DttPQc71.d.ts +27 -0
- package/dist/development-J-JCSIm0.js +111 -0
- package/dist/development-J-JCSIm0.js.map +1 -0
- package/dist/frameworks/alpine.d.ts +20 -0
- package/dist/frameworks/alpine.js +18 -0
- package/dist/frameworks/alpine.js.map +1 -0
- package/dist/frameworks/astro.d.ts +3 -0
- package/dist/frameworks/astro.js +1 -0
- package/dist/frameworks/lit.d.ts +21 -0
- package/dist/frameworks/lit.js +38 -0
- package/dist/frameworks/lit.js.map +1 -0
- package/dist/frameworks/preact.d.ts +3 -0
- package/dist/frameworks/preact.js +1 -0
- package/dist/frameworks/qwik.d.ts +3 -0
- package/dist/frameworks/qwik.js +1 -0
- package/dist/frameworks/react.d.ts +10 -0
- package/dist/frameworks/react.js +6 -0
- package/dist/frameworks/react.js.map +1 -0
- package/dist/frameworks/solid.d.ts +3 -0
- package/dist/frameworks/solid.js +1 -0
- package/dist/frameworks/svelte.d.ts +3 -0
- package/dist/frameworks/svelte.js +1 -0
- package/dist/frameworks/vanilla.d.ts +27 -0
- package/dist/frameworks/vanilla.js +3 -0
- package/dist/frameworks/vue.d.ts +3 -0
- package/dist/frameworks/vue.js +1 -0
- package/dist/index-RwVFpxhE.d.ts +815 -0
- package/dist/macro/index.d.ts +2 -0
- package/dist/macro/index.js +1 -0
- package/dist/module-css.d.ts +30 -0
- package/dist/module-css.js +23 -0
- package/dist/module-css.js.map +1 -0
- package/dist/runtime/class-name-object-development.d.ts +10 -0
- package/dist/runtime/class-name-object-development.js +18 -0
- package/dist/runtime/class-name-object-development.js.map +1 -0
- package/dist/runtime/class-name-object.d.ts +16 -0
- package/dist/runtime/class-name-object.js +31 -0
- package/dist/runtime/class-name-object.js.map +1 -0
- package/dist/runtime/class-object-development.d.ts +10 -0
- package/dist/runtime/class-object-development.js +18 -0
- package/dist/runtime/class-object-development.js.map +1 -0
- package/dist/runtime/class-object.d.ts +16 -0
- package/dist/runtime/class-object.js +31 -0
- package/dist/runtime/class-object.js.map +1 -0
- package/dist/runtime/class-string-development.d.ts +10 -0
- package/dist/runtime/class-string-development.js +18 -0
- package/dist/runtime/class-string-development.js.map +1 -0
- package/dist/runtime/class-string.d.ts +16 -0
- package/dist/runtime/class-string.js +31 -0
- package/dist/runtime/class-string.js.map +1 -0
- package/dist/shared-B9IQXU6P.d.ts +32 -0
- package/dist/style-BV4ctkni.js +78 -0
- package/dist/style-BV4ctkni.js.map +1 -0
- package/dist/style-fTQbsVWZ.js +41 -0
- package/dist/style-fTQbsVWZ.js.map +1 -0
- package/docs/agents.md +76 -0
- package/docs/at-rules/apply.md +93 -0
- package/docs/at-rules/custom-variant.md +127 -0
- package/docs/at-rules/index.md +75 -0
- package/docs/at-rules/plugin.md +71 -0
- package/docs/at-rules/registry-directives.md +181 -0
- package/docs/at-rules/slot.md +58 -0
- package/docs/at-rules/stillwind-css-template.md +126 -0
- package/docs/at-rules/stillwind-property.md +133 -0
- package/docs/at-rules/stillwind-registry.md +115 -0
- package/docs/at-rules/stillwind-require-properties.md +91 -0
- package/docs/at-rules/stillwind-slot.md +85 -0
- package/docs/at-rules/stillwind-undef-arbitrary-property.md +75 -0
- package/docs/at-rules/stillwind-undef-utility.md +87 -0
- package/docs/at-rules/stillwind-undef-variant.md +55 -0
- package/docs/at-rules/theme.md +304 -0
- package/docs/at-rules/utility.md +286 -0
- package/docs/at-rules/variant.md +91 -0
- package/docs/concepts/css-ordering.md +245 -0
- package/docs/concepts/how-styles-compile.md +132 -0
- package/docs/configuration.md +298 -0
- package/docs/errors/SW01001.md +51 -0
- package/docs/errors/SW01002.md +52 -0
- package/docs/errors/SW01003.md +69 -0
- package/docs/errors/SW02001.md +23 -0
- package/docs/errors/SW02002.md +51 -0
- package/docs/errors/SW03001.md +71 -0
- package/docs/errors/SW03002.md +79 -0
- package/docs/errors/SW03003.md +36 -0
- package/docs/errors/SW10001.md +34 -0
- package/docs/errors/SW10002.md +36 -0
- package/docs/errors/SW10003.md +30 -0
- package/docs/errors/SW10004.md +39 -0
- package/docs/errors/SW10005.md +35 -0
- package/docs/errors/SW11001.md +37 -0
- package/docs/errors/SW11002.md +65 -0
- package/docs/errors/SW11003.md +20 -0
- package/docs/errors/SW12001.md +43 -0
- package/docs/errors/SW12002.md +42 -0
- package/docs/errors/SW13001.md +35 -0
- package/docs/errors/SW13002.md +33 -0
- package/docs/errors/SW13003.md +18 -0
- package/docs/errors/SW13004.md +45 -0
- package/docs/errors/SW14001.md +44 -0
- package/docs/errors/SW14002.md +47 -0
- package/docs/errors/SW14003.md +38 -0
- package/docs/errors/SW14004.md +48 -0
- package/docs/errors/SW14005.md +51 -0
- package/docs/errors/SW14006.md +19 -0
- package/docs/errors/SW14007.md +35 -0
- package/docs/errors/SW14008.md +41 -0
- package/docs/errors/SW15001.md +18 -0
- package/docs/errors/SW15002.md +19 -0
- package/docs/errors/SW15003.md +16 -0
- package/docs/errors/SW30001.md +21 -0
- package/docs/errors/SW30002.md +18 -0
- package/docs/errors/SW30003.md +17 -0
- package/docs/errors/SW30004.md +18 -0
- package/docs/errors/SW31001.md +20 -0
- package/docs/errors/SW31002.md +17 -0
- package/docs/errors/SW31003.md +18 -0
- package/docs/errors/SW31004.md +20 -0
- package/docs/errors/SW31005.md +18 -0
- package/docs/errors/SW31006.md +17 -0
- package/docs/errors/SW31007.md +18 -0
- package/docs/errors/SW31008.md +16 -0
- package/docs/errors/SW31009.md +18 -0
- package/docs/errors/SW31010.md +16 -0
- package/docs/errors/SW31011.md +17 -0
- package/docs/errors/SW32001.md +18 -0
- package/docs/errors/SW32002.md +45 -0
- package/docs/errors/SW32003.md +43 -0
- package/docs/errors/SW32004.md +17 -0
- package/docs/errors/SW32005.md +40 -0
- package/docs/errors/SW32006.md +18 -0
- package/docs/errors/SW32007.md +20 -0
- package/docs/errors/SW33001.md +17 -0
- package/docs/errors/SW33002.md +17 -0
- package/docs/errors/SW33003.md +17 -0
- package/docs/errors/SW33004.md +17 -0
- package/docs/errors/SW33005.md +20 -0
- package/docs/errors/SW34001.md +18 -0
- package/docs/errors/SW34002.md +17 -0
- package/docs/errors/SW34003.md +18 -0
- package/docs/errors/SW90001.md +17 -0
- package/docs/errors/SW90002.md +18 -0
- package/docs/errors/SW90003.md +17 -0
- package/docs/errors/SW90004.md +17 -0
- package/docs/errors/SW90005.md +16 -0
- package/docs/errors/SW90006.md +17 -0
- package/docs/errors/SW90007.md +17 -0
- package/docs/errors/SW90008.md +17 -0
- package/docs/errors/index.md +125 -0
- package/docs/guides/animations.md +73 -0
- package/docs/guides/design-systems.md +119 -0
- package/docs/guides/element-relationships.md +136 -0
- package/docs/guides/lint-adoption.md +128 -0
- package/docs/guides/migrating-from-css.md +126 -0
- package/docs/guides/migrating-from-tailwind.md +179 -0
- package/docs/guides/recommended-practices.md +338 -0
- package/docs/guides/responsive-styles.md +103 -0
- package/docs/guides/reusable-styles.md +110 -0
- package/docs/guides/style.md +181 -0
- package/docs/guides/tailwind-compatibility.md +126 -0
- package/docs/guides/view-transitions.md +84 -0
- package/docs/guides/web-components.md +216 -0
- package/docs/index.md +136 -0
- package/docs/integrations.md +190 -0
- package/docs/lints/ambiguous-style-base-order.md +50 -0
- package/docs/lints/bypassed-undefinition.md +50 -0
- package/docs/lints/clamped-value.md +44 -0
- package/docs/lints/conflicting-provider-properties.md +47 -0
- package/docs/lints/conflicting-utilities.md +55 -0
- package/docs/lints/document-scoped-selector.md +45 -0
- package/docs/lints/duplicate-definition.md +44 -0
- package/docs/lints/duplicate-utility.md +44 -0
- package/docs/lints/duplicate-view-transition-name.md +45 -0
- package/docs/lints/ignored-definition-condition.md +51 -0
- package/docs/lints/ignored-tailwind-feature.md +62 -0
- package/docs/lints/incompatible-property-value.md +60 -0
- package/docs/lints/incompatible-theme-value.md +46 -0
- package/docs/lints/index.md +140 -0
- package/docs/lints/ineffective-anchor-scope.md +46 -0
- package/docs/lints/interfering-imported-style-base.md +57 -0
- package/docs/lints/invalid-animation-option.md +47 -0
- package/docs/lints/invalid-css-directive.md +43 -0
- package/docs/lints/invalid-css-import.md +43 -0
- package/docs/lints/invalid-css-input.md +45 -0
- package/docs/lints/invalid-cva-config.md +46 -0
- package/docs/lints/invalid-cva-input.md +50 -0
- package/docs/lints/invalid-keyframes-definition.md +47 -0
- package/docs/lints/invalid-keyframes-use.md +47 -0
- package/docs/lints/invalid-keyframes-variant.md +48 -0
- package/docs/lints/invalid-lint-suppression.md +47 -0
- package/docs/lints/invalid-marker-use.md +53 -0
- package/docs/lints/invalid-media-query.md +52 -0
- package/docs/lints/invalid-ref-input.md +49 -0
- package/docs/lints/invalid-rule-group-input.md +58 -0
- package/docs/lints/invalid-runtime-condition.md +67 -0
- package/docs/lints/invalid-style-composition.md +52 -0
- package/docs/lints/invalid-style-input.md +47 -0
- package/docs/lints/invalid-theme-reference.md +52 -0
- package/docs/lints/invalid-utility.md +44 -0
- package/docs/lints/invalid-variant.md +45 -0
- package/docs/lints/invalid-view-transition-definition.md +46 -0
- package/docs/lints/invalid-view-transition-use.md +46 -0
- package/docs/lints/invalid-view-transition-variant.md +51 -0
- package/docs/lints/mismatched-framework-import.md +47 -0
- package/docs/lints/missing-document-target.md +44 -0
- package/docs/lints/missing-ref-attachment.md +44 -0
- package/docs/lints/missing-view-transition-name.md +46 -0
- package/docs/lints/mutating-macro-argument.md +48 -0
- package/docs/lints/no-arbitrary-breakpoints.md +50 -0
- package/docs/lints/no-arbitrary-colors.md +51 -0
- package/docs/lints/no-arbitrary-spacing.md +57 -0
- package/docs/lints/no-class-property.md +58 -0
- package/docs/lints/no-important.md +50 -0
- package/docs/lints/no-restricted-declarations.md +76 -0
- package/docs/lints/no-restricted-length-units.md +73 -0
- package/docs/lints/no-restricted-theme-tokens.md +73 -0
- package/docs/lints/no-restricted-utilities.md +73 -0
- package/docs/lints/prefer-canonical-utilities.md +69 -0
- package/docs/lints/prefer-direct-styling.md +47 -0
- package/docs/lints/prefer-explicit-nesting-selector.md +42 -0
- package/docs/lints/prefer-logical-properties.md +49 -0
- package/docs/lints/prefer-sorted-utilities.md +46 -0
- package/docs/lints/prefer-typed-relationships.md +48 -0
- package/docs/lints/prefer-typed-variables.md +43 -0
- package/docs/lints/prefer-variant-directive.md +59 -0
- package/docs/lints/redundant-variant.md +50 -0
- package/docs/lints/repeated-nesting-selector.md +59 -0
- package/docs/lints/runtime-condition-requires-css-if.md +59 -0
- package/docs/lints/split-view-transition-class.md +47 -0
- package/docs/lints/suspending-macro-argument.md +46 -0
- package/docs/lints/unknown-utility.md +47 -0
- package/docs/lints/unknown-variant.md +42 -0
- package/docs/lints/unsatisfiable-variants.md +42 -0
- package/docs/lints/unused-lint-suppression.md +57 -0
- package/docs/lints/unverified-style-base.md +64 -0
- package/docs/macros/anchor-scope.md +90 -0
- package/docs/macros/css.md +68 -0
- package/docs/macros/cva.md +153 -0
- package/docs/macros/index.md +30 -0
- package/docs/macros/keyframes.md +98 -0
- package/docs/macros/media.md +65 -0
- package/docs/macros/ref/as-anchor.md +70 -0
- package/docs/macros/ref/as-container.md +64 -0
- package/docs/macros/ref/at.md +68 -0
- package/docs/macros/ref/condition.md +86 -0
- package/docs/macros/ref/in.md +81 -0
- package/docs/macros/ref/index.md +115 -0
- package/docs/macros/ref/position-anchor.md +64 -0
- package/docs/macros/style.md +185 -0
- package/docs/macros/view-transition.md +159 -0
- package/docs/utilities.md +35 -0
- package/docs/why.md +144 -0
- package/index.css +7 -0
- package/package.json +135 -8
- package/skills/migrate-to-stillwind/SKILL.md +81 -0
- package/skills/setup-stillwind/SKILL.md +51 -0
- package/skills/stillwind/SKILL.md +54 -0
- package/index.js +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@stillwind-undef-utility"
|
|
3
|
+
description: "Remove built-in or plugin utility definitions that match a name or a prefix."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @stillwind-undef-utility
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@stillwind-undef-utility name;
|
|
10
|
+
@stillwind-undef-utility prefix-*;
|
|
11
|
+
@stillwind-undef-utility *;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`@stillwind-undef-utility` removes the matching utility definitions that
|
|
15
|
+
register before it. A removed utility becomes unknown, and
|
|
16
|
+
[unknown-utility](../lints/unknown-utility.md) reports its uses. Write it at the
|
|
17
|
+
top level of the stylesheet or in a
|
|
18
|
+
[@stillwind-registry](stillwind-registry.md) block.
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
### Stylesheet
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
@stillwind-undef-utility float-*;
|
|
26
|
+
|
|
27
|
+
@utility float-start {
|
|
28
|
+
float: inline-start;
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Source
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { style } from "stillwind/react";
|
|
36
|
+
|
|
37
|
+
export const removed = style("float-left");
|
|
38
|
+
export const replaced = style("float-start");
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Compiled code
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
export const removed = {};
|
|
45
|
+
export const replaced = {className:"sw_vofby"};
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Generated stylesheet without preflight
|
|
49
|
+
|
|
50
|
+
```css
|
|
51
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
52
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
53
|
+
@layer properties, theme, base, components, utilities;
|
|
54
|
+
|
|
55
|
+
@layer utilities {
|
|
56
|
+
.sw_vofby {
|
|
57
|
+
float: inline-start;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The statement removes every built-in `float-*` utility. `float-left` produces no
|
|
63
|
+
class, and `float-start` uses only the new definition.
|
|
64
|
+
|
|
65
|
+
## Patterns
|
|
66
|
+
|
|
67
|
+
A pattern is `*`, an exact name, or a prefix followed by `*`. `duration-*`
|
|
68
|
+
matches the definition `duration-*` and the exact names that start with
|
|
69
|
+
`duration-`, such as `duration-initial`. It does not match `-duration-*`: a
|
|
70
|
+
pattern for negative names starts with `-`.
|
|
71
|
+
|
|
72
|
+
## Order
|
|
73
|
+
|
|
74
|
+
The statements that `@plugin` generates register first. The other statements,
|
|
75
|
+
including the built-in definitions that `@import "stillwind"` loads, follow in
|
|
76
|
+
source order. An undefinition removes only definitions that register before it:
|
|
77
|
+
|
|
78
|
+
- It removes plugin utilities, wherever the `@plugin` statement stands.
|
|
79
|
+
- It removes the built-in utilities that `@import "stillwind"` loads before it.
|
|
80
|
+
- It does not remove a `@utility` that comes after it, so you can remove a
|
|
81
|
+
built-in utility and define your own utility with the same name.
|
|
82
|
+
|
|
83
|
+
Outside a block, the statement changes the `default`, `keyframe`, and
|
|
84
|
+
`view-transition` registries.
|
|
85
|
+
|
|
86
|
+
To report uses of a utility without removing it, use
|
|
87
|
+
[no-restricted-utilities](../lints/no-restricted-utilities.md) instead.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@stillwind-undef-variant"
|
|
3
|
+
description: "Remove built-in or plugin variant definitions that match a name or a prefix."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @stillwind-undef-variant
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@stillwind-undef-variant name;
|
|
10
|
+
@stillwind-undef-variant prefix-*;
|
|
11
|
+
@stillwind-undef-variant *;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`@stillwind-undef-variant` removes the matching variant definitions that
|
|
15
|
+
register before it. A removed variant becomes unknown, and
|
|
16
|
+
[unknown-variant](../lints/unknown-variant.md) reports its uses. Write it at the
|
|
17
|
+
top level of the stylesheet or in a
|
|
18
|
+
[@stillwind-registry](stillwind-registry.md) block.
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
### Stylesheet
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
@stillwind-undef-variant print;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Source
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { style } from "stillwind/react";
|
|
32
|
+
|
|
33
|
+
export const toolbar = style("print:hidden");
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Compiled code
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
export const toolbar = {};
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Generated stylesheet without preflight
|
|
43
|
+
|
|
44
|
+
```css
|
|
45
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
46
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
47
|
+
@layer properties, theme, base, components, utilities;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`print:hidden` produces no class, because `print` is unknown.
|
|
51
|
+
|
|
52
|
+
Patterns and registration order work as in
|
|
53
|
+
[@stillwind-undef-utility](stillwind-undef-utility.md). A
|
|
54
|
+
[@custom-variant](custom-variant.md) after the statement can define
|
|
55
|
+
a variant with the removed name again.
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@theme"
|
|
3
|
+
description: "Define design tokens that add utilities, and shared values such as images."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @theme
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@theme [default] [asset] [inline | static] {
|
|
10
|
+
--name: value;
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`@theme` defines design tokens as custom properties. A token in a known
|
|
15
|
+
namespace adds utilities: `--color-brand` adds `bg-brand`, `text-brand`, and the
|
|
16
|
+
other color utilities. Write `@theme` at the top level of the stylesheet.
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
### Stylesheet
|
|
21
|
+
|
|
22
|
+
```css
|
|
23
|
+
@theme {
|
|
24
|
+
--color-brand: oklch(0.6 0.2 250);
|
|
25
|
+
--color-brand-muted: oklch(0.8 0.08 250);
|
|
26
|
+
--radius-card: 0.75rem;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Source
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { style } from "stillwind/react";
|
|
34
|
+
|
|
35
|
+
export const card = style("rounded-card bg-brand");
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Compiled code
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
export const card = {className:"sw_j7rat"};
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Generated stylesheet without preflight
|
|
45
|
+
|
|
46
|
+
```css
|
|
47
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
48
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
49
|
+
@layer properties, theme, base, components, utilities;
|
|
50
|
+
|
|
51
|
+
@layer theme {
|
|
52
|
+
:root, :host {
|
|
53
|
+
--color-brand: oklch(60% .2 250);
|
|
54
|
+
--radius-card: .75rem;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@layer utilities {
|
|
59
|
+
.sw_j7rat {
|
|
60
|
+
background-color: var(--color-brand);
|
|
61
|
+
border-radius: var(--radius-card);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The generated stylesheet declares only the tokens that the used utilities
|
|
67
|
+
reference. `--color-brand-muted` is not used, so the stylesheet leaves it out.
|
|
68
|
+
|
|
69
|
+
## Options
|
|
70
|
+
|
|
71
|
+
| Option | Effect |
|
|
72
|
+
| --------- | ----------------------------------------------------------------------------------- |
|
|
73
|
+
| `default` | Marks the tokens as defaults. A token without `default` replaces them in any order. |
|
|
74
|
+
| `asset` | Declares shared values, such as images, that are not design tokens |
|
|
75
|
+
| `inline` | Replaces each `var()` reference to a token with the token's value |
|
|
76
|
+
| `static` | Declares the tokens even when no used utility references them |
|
|
77
|
+
|
|
78
|
+
`inline` and `static` cannot be combined. The other options can be combined
|
|
79
|
+
freely.
|
|
80
|
+
|
|
81
|
+
### Defaults
|
|
82
|
+
|
|
83
|
+
### Stylesheet
|
|
84
|
+
|
|
85
|
+
```css
|
|
86
|
+
@theme {
|
|
87
|
+
--color-brand: red;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@theme default {
|
|
91
|
+
--color-brand: blue;
|
|
92
|
+
--color-brand-muted: lightblue;
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Source
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
import { style } from "stillwind/react";
|
|
100
|
+
|
|
101
|
+
export const label = style("bg-brand text-brand-muted");
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Compiled code
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
export const label = {className:"sw_4zrwj"};
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Generated stylesheet without preflight
|
|
111
|
+
|
|
112
|
+
```css
|
|
113
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
114
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
115
|
+
@layer properties, theme, base, components, utilities;
|
|
116
|
+
|
|
117
|
+
@layer theme {
|
|
118
|
+
:root, :host {
|
|
119
|
+
--color-brand: red;
|
|
120
|
+
--color-brand-muted: lightblue;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@layer utilities {
|
|
125
|
+
.sw_4zrwj {
|
|
126
|
+
color: var(--color-brand-muted);
|
|
127
|
+
background-color: var(--color-brand);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`--color-brand` without `default` wins although it comes first. The default
|
|
133
|
+
theme of Stillwind uses `default`, so your tokens replace its values.
|
|
134
|
+
|
|
135
|
+
### Inline and static values
|
|
136
|
+
|
|
137
|
+
### Stylesheet
|
|
138
|
+
|
|
139
|
+
```css
|
|
140
|
+
@theme inline {
|
|
141
|
+
--font-display: "Inter Display", sans-serif;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@theme static {
|
|
145
|
+
--color-highlight: #fde047;
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Source
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
import { style } from "stillwind/react";
|
|
153
|
+
|
|
154
|
+
export const title = style("font-display");
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Compiled code
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
export const title = {className:"sw_mjcfr"};
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Generated stylesheet without preflight
|
|
164
|
+
|
|
165
|
+
```css
|
|
166
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
167
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
168
|
+
@layer properties, theme, base, components, utilities;
|
|
169
|
+
|
|
170
|
+
@layer theme {
|
|
171
|
+
:root, :host {
|
|
172
|
+
--color-highlight: #fde047;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@layer utilities {
|
|
177
|
+
.sw_mjcfr {
|
|
178
|
+
font-family: Inter Display, sans-serif;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
`font-display` contains the value of `--font-display` instead of a `var()`
|
|
184
|
+
reference, and the stylesheet does not declare `--font-display`. The stylesheet
|
|
185
|
+
declares `--color-highlight`, although no utility uses it, so your own CSS can
|
|
186
|
+
reference it.
|
|
187
|
+
|
|
188
|
+
### Assets
|
|
189
|
+
|
|
190
|
+
### Stylesheet
|
|
191
|
+
|
|
192
|
+
```css
|
|
193
|
+
@theme asset {
|
|
194
|
+
--image-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E");
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@utility checkmark {
|
|
198
|
+
mask-image: var(--image-check);
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Source
|
|
203
|
+
|
|
204
|
+
```tsx
|
|
205
|
+
import { style } from "stillwind/react";
|
|
206
|
+
|
|
207
|
+
export const done = style("checkmark");
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Compiled code
|
|
211
|
+
|
|
212
|
+
```ts
|
|
213
|
+
export const done = {className:"sw_j94hj"};
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Generated stylesheet without preflight
|
|
217
|
+
|
|
218
|
+
```css
|
|
219
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
220
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
221
|
+
@layer properties, theme, base, components, utilities;
|
|
222
|
+
|
|
223
|
+
@layer theme {
|
|
224
|
+
:root, :host {
|
|
225
|
+
--image-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E");
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@layer utilities {
|
|
230
|
+
.sw_j94hj {
|
|
231
|
+
mask-image: var(--image-check);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
An asset is declared when a used rule references it, like a token. An asset adds
|
|
237
|
+
no utilities. Token restrictions, `--value()` patterns, `theme()`, and
|
|
238
|
+
`--theme()` do not see assets.
|
|
239
|
+
|
|
240
|
+
## Remove tokens
|
|
241
|
+
|
|
242
|
+
Set a namespace to `initial` to remove its earlier tokens. `--*: initial`
|
|
243
|
+
removes every token.
|
|
244
|
+
|
|
245
|
+
### Stylesheet
|
|
246
|
+
|
|
247
|
+
```css
|
|
248
|
+
@theme {
|
|
249
|
+
--color-*: initial;
|
|
250
|
+
--color-ink: #1f2937;
|
|
251
|
+
--color-paper: #ffffff;
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Source
|
|
256
|
+
|
|
257
|
+
```tsx
|
|
258
|
+
import { style } from "stillwind/react";
|
|
259
|
+
|
|
260
|
+
export const page = style("bg-paper text-ink");
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Compiled code
|
|
264
|
+
|
|
265
|
+
```ts
|
|
266
|
+
export const page = {className:"sw_rjnyv"};
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Generated stylesheet without preflight
|
|
270
|
+
|
|
271
|
+
```css
|
|
272
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
273
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
274
|
+
@layer properties, theme, base, components, utilities;
|
|
275
|
+
|
|
276
|
+
@layer theme {
|
|
277
|
+
:root, :host {
|
|
278
|
+
--color-ink: #1f2937;
|
|
279
|
+
--color-paper: #fff;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@layer utilities {
|
|
284
|
+
.sw_rjnyv {
|
|
285
|
+
color: var(--color-ink);
|
|
286
|
+
background-color: var(--color-paper);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
After this block, palette utilities such as `bg-red-500` are unknown.
|
|
292
|
+
|
|
293
|
+
A reset affects only tokens of the same kind: `@theme { --*: initial; }` keeps
|
|
294
|
+
assets, and `@theme asset { --*: initial; }` keeps design tokens.
|
|
295
|
+
|
|
296
|
+
## Placement
|
|
297
|
+
|
|
298
|
+
The `theme` slot places the declarations. `@import "stillwind"` puts it on
|
|
299
|
+
`:root, :host`. See [@stillwind-slot](stillwind-slot.md).
|
|
300
|
+
|
|
301
|
+
[incompatible-theme-value](../lints/incompatible-theme-value.md) reports a token
|
|
302
|
+
with a value of the wrong type for its namespace, such as a length in
|
|
303
|
+
`--color-*`. [Design systems](../guides/design-systems.md) shows how to name
|
|
304
|
+
tokens by role and report values outside them.
|