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,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@stillwind-css-template"
|
|
3
|
+
description: "Define where style.css() places its utilities, theme values, and other supporting CSS."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @stillwind-css-template
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@stillwind-css-template name {
|
|
10
|
+
...
|
|
11
|
+
@stillwind-slot utilities;
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`@stillwind-css-template` defines a template for the string that
|
|
16
|
+
[style.css()](../macros/css.md) returns. The `template` option of the call
|
|
17
|
+
selects the template by name, and `default` applies when the call names none.
|
|
18
|
+
Write it at the top level of the stylesheet.
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
### Stylesheet
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
@stillwind-css-template layered {
|
|
26
|
+
@layer component {
|
|
27
|
+
:host {
|
|
28
|
+
@stillwind-slot theme;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@stillwind-slot utilities;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Source
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { style } from "stillwind/react";
|
|
40
|
+
|
|
41
|
+
export const css = style.css("p-4 text-blue-600", {
|
|
42
|
+
selector: ":host",
|
|
43
|
+
template: "layered",
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Compiled code
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
export const css = "/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer component{:host{--color-blue-600:oklch(54.6% 0.245 262.881);--spacing:0.25rem;}:host{padding:calc(var(--spacing) * 4);}:host{color:var(--color-blue-600);}}";
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The string contains the template's own CSS, and each slot receives the output of
|
|
54
|
+
the call. The string never contains the preflight reset or the other rules of
|
|
55
|
+
your stylesheet.
|
|
56
|
+
|
|
57
|
+
## Leave out supporting CSS
|
|
58
|
+
|
|
59
|
+
A slot that the template omits drops its output. This template places only the
|
|
60
|
+
utilities, so the string uses `--spacing` and `--color-blue-600` without
|
|
61
|
+
declaring them. The page or the shadow root must declare them in another way.
|
|
62
|
+
|
|
63
|
+
### Stylesheet
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
@stillwind-css-template bare {
|
|
67
|
+
@stillwind-slot utilities;
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Source
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { style } from "stillwind/react";
|
|
75
|
+
|
|
76
|
+
export const css = style.css("p-4 text-blue-600", {
|
|
77
|
+
selector: ":host",
|
|
78
|
+
template: "bare",
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Compiled code
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
export const css = "/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n:host{padding:calc(var(--spacing) * 4);}:host{color:var(--color-blue-600);}";
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## The default template
|
|
89
|
+
|
|
90
|
+
`@import "stillwind"` defines `default`:
|
|
91
|
+
|
|
92
|
+
```css
|
|
93
|
+
@stillwind-css-template default {
|
|
94
|
+
:where(:root, :host) {
|
|
95
|
+
@stillwind-slot theme;
|
|
96
|
+
@stillwind-slot property-initials inherited;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:where(*, :host),
|
|
100
|
+
::before,
|
|
101
|
+
::after,
|
|
102
|
+
::backdrop {
|
|
103
|
+
@stillwind-slot property-initials non-inherited;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@stillwind-slot keyframes;
|
|
107
|
+
@stillwind-slot utilities;
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
It places the theme values on the root of the tree that adopts the string. It
|
|
112
|
+
emits no `@property` rules, because a registration inside a shadow root has no
|
|
113
|
+
effect. No rule is in a layer.
|
|
114
|
+
|
|
115
|
+
A later template with the same name replaces an earlier one, so your stylesheet
|
|
116
|
+
can redefine `default` after `@import "stillwind"`.
|
|
117
|
+
|
|
118
|
+
## Rules
|
|
119
|
+
|
|
120
|
+
- A template must contain a `utilities` slot.
|
|
121
|
+
- A template cannot contain definitions, such as `@theme` or `@utility`.
|
|
122
|
+
- The loader skips a template that breaks these rules, and
|
|
123
|
+
[invalid-css-directive](../lints/invalid-css-directive.md) reports it.
|
|
124
|
+
- A template name that the stylesheet does not define reports
|
|
125
|
+
[invalid-css-input](../lints/invalid-css-input.md) at the call. The call then
|
|
126
|
+
uses no template, and its string contains only the rules.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@stillwind-property"
|
|
3
|
+
description: "Register a custom property that the stylesheet declares with @property only when generated CSS needs it."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @stillwind-property
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@stillwind-property --name {
|
|
10
|
+
syntax: "<angle>";
|
|
11
|
+
inherits: false;
|
|
12
|
+
initial-value: 0deg;
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`@stillwind-property` registers a custom property. The compiler emits a
|
|
17
|
+
standard `@property` rule, and an initial value for each element, only when the
|
|
18
|
+
generated CSS needs the property. Write it at the top level of the stylesheet.
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
### Stylesheet
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
@stillwind-property --spin-angle {
|
|
26
|
+
syntax: "<angle>";
|
|
27
|
+
inherits: false;
|
|
28
|
+
initial-value: 0deg;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@utility spin-* {
|
|
32
|
+
--spin-angle: --value([angle]);
|
|
33
|
+
rotate: var(--spin-angle);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Source
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { style } from "stillwind/react";
|
|
41
|
+
|
|
42
|
+
export const icon = style("spin-[45deg]");
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Compiled code
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
export const icon = {className:"sw_7ic77"};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Generated stylesheet without preflight
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
55
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
56
|
+
@layer properties, theme, base, components, utilities;
|
|
57
|
+
|
|
58
|
+
@layer utilities {
|
|
59
|
+
.sw_7ic77 {
|
|
60
|
+
--spin-angle: 45deg;
|
|
61
|
+
rotate: var(--spin-angle);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@layer properties {
|
|
66
|
+
@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
|
|
67
|
+
*, :before, :after, ::backdrop {
|
|
68
|
+
--spin-angle: 0deg;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@property --spin-angle {
|
|
74
|
+
syntax: "<angle>";
|
|
75
|
+
inherits: false;
|
|
76
|
+
initial-value: 0deg;
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The `properties` slot places the `@property` rule. The `property-initials` slot
|
|
81
|
+
places the initial values, for browsers that ignore `@property`. See
|
|
82
|
+
[@stillwind-slot](stillwind-slot.md).
|
|
83
|
+
|
|
84
|
+
## Descriptors
|
|
85
|
+
|
|
86
|
+
The standard `@property` descriptors, `syntax`, `inherits`, and `initial-value`,
|
|
87
|
+
go into the emitted rule as written. The compiler reads the other descriptors and
|
|
88
|
+
removes them from the output:
|
|
89
|
+
|
|
90
|
+
| Descriptor | Value |
|
|
91
|
+
| ------------- | ------------------------------------------------------------------------------------------ |
|
|
92
|
+
| `activation` | When to emit: `referenced` (default), `declared`, `either`, or `dependency` |
|
|
93
|
+
| `depends-on` | Space-separated custom properties that are emitted with this one |
|
|
94
|
+
| `group` | Space-separated group names. The registrations of a group are emitted together. |
|
|
95
|
+
| `activate-on` | Space-separated ordinary properties. A declaration of one of them emits this registration. |
|
|
96
|
+
| `value-for` | Comma-separated ordinary properties whose value rules check the values of this property |
|
|
97
|
+
|
|
98
|
+
`referenced` emits the registration when a rule reads the property through
|
|
99
|
+
`var()`. `declared` emits it when a rule sets the property. `either` emits it in
|
|
100
|
+
both cases. `dependency` emits it only through `depends-on` or `group`.
|
|
101
|
+
|
|
102
|
+
A utility can also require a registration with
|
|
103
|
+
[@stillwind-require-properties](stillwind-require-properties.md).
|
|
104
|
+
|
|
105
|
+
## Value checks
|
|
106
|
+
|
|
107
|
+
`value-for` makes lint rules check the value of the custom property as a value
|
|
108
|
+
of the listed properties:
|
|
109
|
+
|
|
110
|
+
```css
|
|
111
|
+
@stillwind-property --box-size {
|
|
112
|
+
syntax: "*";
|
|
113
|
+
inherits: false;
|
|
114
|
+
value-for: width, height;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@utility box-* {
|
|
118
|
+
--box-size: --value([length]);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
[no-arbitrary-spacing](../lints/no-arbitrary-spacing.md),
|
|
123
|
+
[no-arbitrary-colors](../lints/no-arbitrary-colors.md), and
|
|
124
|
+
[no-restricted-length-units](../lints/no-restricted-length-units.md) check
|
|
125
|
+
`box-[13px]` as a `width` and a `height` value. Each listed property uses its own
|
|
126
|
+
rule settings.
|
|
127
|
+
|
|
128
|
+
## Registrations with the same name
|
|
129
|
+
|
|
130
|
+
The last registration of a name decides. A registration in your stylesheet
|
|
131
|
+
replaces the registration of a package. An ordinary `@property` rule in your
|
|
132
|
+
stylesheet stays as written, and the compiler does not emit a registration with
|
|
133
|
+
the same name.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@stillwind-registry"
|
|
3
|
+
description: "Define or remove utilities only for style(), keyframes, animation options, or view transitions."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @stillwind-registry
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@stillwind-registry default, keyframe, animation, view-transition {
|
|
10
|
+
...
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Each place where utilities are written resolves them with its own set of
|
|
15
|
+
definitions, called a registry. `@stillwind-registry` selects the registries
|
|
16
|
+
that the definitions inside the block change. Write it at the top level of the
|
|
17
|
+
stylesheet, or inside another `@stillwind-registry` block.
|
|
18
|
+
|
|
19
|
+
| Registry | Resolves the utilities of |
|
|
20
|
+
| ----------------- | ----------------------------------------------------------------------------- |
|
|
21
|
+
| `default` | `style()`, `style.cva()`, `style.css()`, and `@apply` |
|
|
22
|
+
| `keyframe` | The frames of `style.keyframes()` |
|
|
23
|
+
| `animation` | The options of a keyframes use, such as `enter("both")` |
|
|
24
|
+
| `view-transition` | The `group`, `old`, `new`, and `imagePair` fields of `style.viewTransition()` |
|
|
25
|
+
|
|
26
|
+
A definition outside every block changes `default`, `keyframe`, and
|
|
27
|
+
`view-transition`. `animation` starts empty and changes only through blocks that
|
|
28
|
+
name it.
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
The built-in `keyframe` and `view-transition` registries replace `duration-*`
|
|
33
|
+
with definitions that set animation properties. A top-level `@utility` with a
|
|
34
|
+
name that they replace also reaches those registries, and
|
|
35
|
+
[bypassed-undefinition](../lints/bypassed-undefinition.md) reports it. A
|
|
36
|
+
`default` block keeps the definition out of them:
|
|
37
|
+
|
|
38
|
+
### Stylesheet
|
|
39
|
+
|
|
40
|
+
```css
|
|
41
|
+
@stillwind-registry default {
|
|
42
|
+
@utility duration-slow {
|
|
43
|
+
transition-duration: 600ms;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Source
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
import { style } from "stillwind/react";
|
|
52
|
+
|
|
53
|
+
export const panel = style("transition duration-slow");
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Compiled code
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
export const panel = {className:"sw_2wahw"};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Generated stylesheet without preflight
|
|
63
|
+
|
|
64
|
+
```css
|
|
65
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
66
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
67
|
+
@layer properties, theme, base, components, utilities;
|
|
68
|
+
|
|
69
|
+
@layer theme {
|
|
70
|
+
:root, :host {
|
|
71
|
+
--default-transition-duration: .15s;
|
|
72
|
+
--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@layer utilities {
|
|
77
|
+
.sw_2wahw {
|
|
78
|
+
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
|
|
79
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
80
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
81
|
+
transition-duration: .6s;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
A block that names `animation` and `view-transition` defines the utility for
|
|
87
|
+
animations instead:
|
|
88
|
+
|
|
89
|
+
```css
|
|
90
|
+
@stillwind-registry animation, view-transition {
|
|
91
|
+
@utility duration-slow {
|
|
92
|
+
animation-duration: 600ms;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Contents
|
|
98
|
+
|
|
99
|
+
A block contains only these statements. Another statement is an error.
|
|
100
|
+
|
|
101
|
+
- `@utility`, `@custom-variant`, and `@variant` definitions
|
|
102
|
+
- [@stillwind-undef-utility](stillwind-undef-utility.md),
|
|
103
|
+
[@stillwind-undef-variant](stillwind-undef-variant.md), and
|
|
104
|
+
[@stillwind-undef-arbitrary-property](stillwind-undef-arbitrary-property.md)
|
|
105
|
+
- `@stillwind-arbitrary-property`, `@stillwind-utility`, and
|
|
106
|
+
`@stillwind-variant` from the [registry directives](registry-directives.md)
|
|
107
|
+
- A nested `@stillwind-registry` block. The innermost block decides.
|
|
108
|
+
|
|
109
|
+
The header names one or more registries, separated by commas. An unknown or
|
|
110
|
+
missing name is an error, and
|
|
111
|
+
[invalid-css-directive](../lints/invalid-css-directive.md) reports it.
|
|
112
|
+
|
|
113
|
+
[Animations](../guides/animations.md) and
|
|
114
|
+
[View transitions](../guides/view-transitions.md) show how utilities such as
|
|
115
|
+
`duration-300` set animation properties in those registries.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@stillwind-require-properties"
|
|
3
|
+
description: "Make a utility emit the registrations of custom properties that it needs."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @stillwind-require-properties
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@utility name {
|
|
10
|
+
@stillwind-require-properties --name --other;
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`@stillwind-require-properties` adds registrations to the requirements of a
|
|
15
|
+
utility. When a module uses the utility, the stylesheet emits each listed
|
|
16
|
+
registration. Write it in the body of a utility definition. Separate several
|
|
17
|
+
names with spaces.
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
`spin-*` only sets `--spin-angle`, and another rule reads it. Without the
|
|
22
|
+
requirement, the stylesheet would not emit the registration, because the default
|
|
23
|
+
activation waits for a `var()` reference.
|
|
24
|
+
|
|
25
|
+
### Stylesheet
|
|
26
|
+
|
|
27
|
+
```css
|
|
28
|
+
@stillwind-property --spin-angle {
|
|
29
|
+
syntax: "<angle>";
|
|
30
|
+
inherits: false;
|
|
31
|
+
initial-value: 0deg;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@utility spin-* {
|
|
35
|
+
@stillwind-require-properties --spin-angle;
|
|
36
|
+
--spin-angle: --value([angle]);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Source
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { style } from "stillwind/react";
|
|
44
|
+
|
|
45
|
+
export const icon = style("spin-[45deg]");
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Compiled code
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
export const icon = {className:"sw_7ic77"};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Generated stylesheet without preflight
|
|
55
|
+
|
|
56
|
+
```css
|
|
57
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
58
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
59
|
+
@layer properties, theme, base, components, utilities;
|
|
60
|
+
|
|
61
|
+
@layer utilities {
|
|
62
|
+
.sw_7ic77 {
|
|
63
|
+
--spin-angle: 45deg;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@layer properties {
|
|
68
|
+
@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
|
|
69
|
+
*, :before, :after, ::backdrop {
|
|
70
|
+
--spin-angle: 0deg;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@property --spin-angle {
|
|
76
|
+
syntax: "<angle>";
|
|
77
|
+
inherits: false;
|
|
78
|
+
initial-value: 0deg;
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Errors
|
|
83
|
+
|
|
84
|
+
Each name must be a complete custom property name that starts with `--`. The
|
|
85
|
+
compiler reports an invalid name as [SW14003](../errors/SW14003.md) in your
|
|
86
|
+
stylesheet. When a module uses a utility with an invalid name, the compiler
|
|
87
|
+
reports [SW14004](../errors/SW14004.md), including for plugin utilities.
|
|
88
|
+
|
|
89
|
+
A required name needs a [@stillwind-property](stillwind-property.md)
|
|
90
|
+
registration in the loaded stylesheets. A missing registration is
|
|
91
|
+
[SW14005](../errors/SW14005.md).
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@stillwind-slot"
|
|
3
|
+
description: "Place generated utilities, theme values, keyframes, and property registrations in your stylesheet."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @stillwind-slot
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@stillwind-slot name;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`@stillwind-slot` marks where the compiler writes one kind of generated CSS.
|
|
13
|
+
`@import "stillwind"` already places every slot, so you need this at-rule only
|
|
14
|
+
when you write your own entry stylesheet or a
|
|
15
|
+
[CSS template](stillwind-css-template.md).
|
|
16
|
+
|
|
17
|
+
## Slots
|
|
18
|
+
|
|
19
|
+
These slots insert complete rules. Write them outside style rules:
|
|
20
|
+
|
|
21
|
+
| Slot | Inserts |
|
|
22
|
+
| ------------ | --------------------------------------------------- |
|
|
23
|
+
| `utilities` | The rules of the utilities that modules use |
|
|
24
|
+
| `keyframes` | The `@keyframes` rules that the used utilities need |
|
|
25
|
+
| `properties` | The `@property` rules of the needed registrations |
|
|
26
|
+
|
|
27
|
+
These slots insert declarations. Write them inside a style rule, which supplies
|
|
28
|
+
the selector:
|
|
29
|
+
|
|
30
|
+
| Slot | Inserts |
|
|
31
|
+
| --------------------------------- | -------------------------------------------------------------------------- |
|
|
32
|
+
| `theme` | The theme values that the generated CSS uses, and `@theme static` values |
|
|
33
|
+
| `property-initials` | The initial values of the needed registrations |
|
|
34
|
+
| `property-initials inherited` | The initial values of the needed registrations with `inherits: true` only |
|
|
35
|
+
| `property-initials non-inherited` | The initial values of the needed registrations with `inherits: false` only |
|
|
36
|
+
|
|
37
|
+
## Example
|
|
38
|
+
|
|
39
|
+
`@import "stillwind"` places the slots like this, in simplified form:
|
|
40
|
+
|
|
41
|
+
```css
|
|
42
|
+
@layer properties, theme, base, components, utilities;
|
|
43
|
+
|
|
44
|
+
@layer theme {
|
|
45
|
+
:root,
|
|
46
|
+
:host {
|
|
47
|
+
@stillwind-slot theme;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@stillwind-slot keyframes;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@layer utilities {
|
|
54
|
+
@stillwind-slot utilities;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@layer properties {
|
|
58
|
+
*,
|
|
59
|
+
::before,
|
|
60
|
+
::after,
|
|
61
|
+
::backdrop {
|
|
62
|
+
@stillwind-slot property-initials;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@stillwind-slot properties;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The position of a slot decides the cascade order of its output. An enclosing
|
|
70
|
+
`@layer` or conditional at-rule also applies to the output. Moving
|
|
71
|
+
`utilities` before your own rules, or into another layer, can change which
|
|
72
|
+
declarations win.
|
|
73
|
+
|
|
74
|
+
## Rules
|
|
75
|
+
|
|
76
|
+
- A slot with an unknown name, or in a position that cannot contain its output,
|
|
77
|
+
is skipped. [invalid-css-directive](../lints/invalid-css-directive.md) reports
|
|
78
|
+
it.
|
|
79
|
+
- A stylesheet without a `utilities` slot is [SW14001](../errors/SW14001.md).
|
|
80
|
+
A missing slot for other generated CSS that a module needs, such as
|
|
81
|
+
`keyframes`, is [SW14002](../errors/SW14002.md).
|
|
82
|
+
- A repeated slot repeats its output at every position.
|
|
83
|
+
|
|
84
|
+
`@stillwind-slot` places generated CSS. [@slot](slot.md) is a
|
|
85
|
+
different at-rule for variant definitions.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@stillwind-undef-arbitrary-property"
|
|
3
|
+
description: "Reject arbitrary-property utilities such as [color:red] for the properties that match a pattern."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @stillwind-undef-arbitrary-property
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@stillwind-undef-arbitrary-property property;
|
|
10
|
+
@stillwind-undef-arbitrary-property prefix-*;
|
|
11
|
+
@stillwind-undef-arbitrary-property *;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
An arbitrary property is a utility that writes a declaration directly, such as
|
|
15
|
+
`[color:red]`. `@stillwind-undef-arbitrary-property` rejects arbitrary
|
|
16
|
+
properties for the matching CSS properties. A rejected candidate produces no
|
|
17
|
+
CSS. Write the statement at the 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-arbitrary-property *;
|
|
26
|
+
@stillwind-arbitrary-property --*;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Source
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { style } from "stillwind/react";
|
|
33
|
+
|
|
34
|
+
export const rejected = style("[color:red]");
|
|
35
|
+
export const accepted = style("[--gutter:1rem]");
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Compiled code
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
export const rejected = {};
|
|
42
|
+
export const accepted = {className:"sw_obysi"};
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Generated stylesheet without preflight
|
|
46
|
+
|
|
47
|
+
```css
|
|
48
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
49
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
50
|
+
@layer properties, theme, base, components, utilities;
|
|
51
|
+
|
|
52
|
+
@layer utilities {
|
|
53
|
+
.sw_obysi {
|
|
54
|
+
--gutter: 1rem;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The first statement rejects every property. The second statement accepts custom
|
|
60
|
+
properties again, so components can still set variables.
|
|
61
|
+
|
|
62
|
+
## Rules
|
|
63
|
+
|
|
64
|
+
- The last matching statement decides for each property. A property that no
|
|
65
|
+
statement matches is accepted.
|
|
66
|
+
- `@stillwind-arbitrary-property pattern;` accepts the matching properties
|
|
67
|
+
again. The [registry directives](registry-directives.md) describe
|
|
68
|
+
its other role.
|
|
69
|
+
- Patterns use the same forms as
|
|
70
|
+
[@stillwind-undef-utility](stillwind-undef-utility.md), with
|
|
71
|
+
property names instead of utility names.
|
|
72
|
+
|
|
73
|
+
To report arbitrary values without rejecting them, use lint rules such as
|
|
74
|
+
[no-arbitrary-colors](../lints/no-arbitrary-colors.md) or
|
|
75
|
+
[no-restricted-declarations](../lints/no-restricted-declarations.md) instead.
|