stillwind 0.4.1 → 0.6.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/docs/at-rules/apply.md +3 -3
- package/docs/at-rules/custom-variant.md +7 -5
- package/docs/at-rules/index.md +28 -28
- package/docs/at-rules/plugin.md +5 -5
- package/docs/at-rules/registry-directives.md +13 -12
- package/docs/at-rules/slot.md +3 -3
- package/docs/at-rules/stillwind-css-template.md +8 -7
- package/docs/at-rules/stillwind-property.md +7 -6
- package/docs/at-rules/stillwind-registry.md +13 -12
- package/docs/at-rules/stillwind-require-properties.md +2 -2
- package/docs/at-rules/stillwind-slot.md +12 -12
- package/docs/at-rules/stillwind-undef-arbitrary-property.md +3 -3
- package/docs/at-rules/stillwind-undef-utility.md +10 -9
- package/docs/at-rules/stillwind-undef-variant.md +5 -5
- package/docs/at-rules/theme.md +6 -6
- package/docs/at-rules/utility.md +17 -12
- package/docs/at-rules/variant.md +11 -7
- package/docs/cli.md +5 -5
- package/docs/concepts/how-styles-compile.md +3 -3
- package/docs/concepts/stylesheets.md +30 -1
- package/docs/configuration.md +8 -8
- package/docs/editors.md +2 -2
- package/docs/errors/SW10004.md +8 -7
- package/docs/errors/SW10005.md +4 -4
- package/docs/errors/SW14002.md +3 -2
- package/docs/errors/SW14003.md +5 -3
- package/docs/errors/SW14004.md +3 -3
- package/docs/errors/SW14005.md +5 -4
- package/docs/errors/SW14008.md +6 -4
- package/docs/errors/SW90001.md +1 -1
- package/docs/errors/SW90006.md +3 -1
- package/docs/errors/index.md +6 -6
- package/docs/guides/animations.md +10 -8
- package/docs/guides/design-systems.md +2 -1
- package/docs/guides/element-relationships.md +17 -15
- package/docs/guides/lint-adoption.md +2 -1
- package/docs/guides/migrating-from-css.md +8 -5
- package/docs/guides/migrating-from-tailwind.md +101 -13
- package/docs/guides/recommended-practices.md +20 -17
- package/docs/guides/responsive-styles.md +9 -6
- package/docs/guides/reusable-styles.md +3 -3
- package/docs/guides/runtime-conditions.md +10 -5
- package/docs/guides/style.md +3 -3
- package/docs/guides/tailwind-compatibility.md +15 -15
- package/docs/guides/view-transitions.md +17 -15
- package/docs/guides/web-components.md +4 -4
- package/docs/index.md +4 -2
- package/docs/integrations.md +64 -0
- package/docs/lints/ambiguous-style-base-order.md +3 -3
- package/docs/lints/bypassed-undefinition.md +4 -4
- package/docs/lints/conflicting-provider-properties.md +4 -3
- package/docs/lints/duplicate-definition.md +2 -1
- package/docs/lints/duplicate-view-transition-name.md +4 -2
- package/docs/lints/ignored-definition-condition.md +4 -3
- package/docs/lints/ignored-tailwind-feature.md +1 -1
- package/docs/lints/implicit-nesting-selector.md +4 -3
- package/docs/lints/index.md +38 -38
- package/docs/lints/ineffective-anchor-scope.md +4 -2
- package/docs/lints/invalid-animation-option.md +3 -3
- package/docs/lints/invalid-css-directive.md +10 -2
- package/docs/lints/invalid-css-import.md +8 -0
- package/docs/lints/invalid-css-input.md +5 -4
- package/docs/lints/invalid-cva-config.md +16 -4
- package/docs/lints/invalid-cva-input.md +11 -6
- package/docs/lints/invalid-keyframes-definition.md +1 -1
- package/docs/lints/invalid-keyframes-variant.md +17 -9
- package/docs/lints/invalid-marker-use.md +1 -1
- package/docs/lints/invalid-media-query.md +8 -6
- package/docs/lints/invalid-ref-input.md +6 -5
- package/docs/lints/invalid-rule-group-input.md +13 -6
- package/docs/lints/invalid-style-input.md +1 -1
- package/docs/lints/invalid-theme-reference.md +2 -2
- package/docs/lints/invalid-view-transition-definition.md +1 -1
- package/docs/lints/invalid-view-transition-use.md +1 -1
- package/docs/lints/invalid-view-transition-variant.md +3 -3
- package/docs/lints/mismatched-framework-import.md +4 -4
- package/docs/lints/missing-document-target.md +1 -1
- package/docs/lints/missing-ref-attachment.md +6 -4
- package/docs/lints/missing-view-transition-name.md +7 -5
- package/docs/lints/no-arbitrary-breakpoints.md +1 -1
- package/docs/lints/no-class-property.md +4 -3
- package/docs/lints/prefer-canonical-utilities.md +3 -2
- package/docs/lints/prefer-direct-styling.md +2 -2
- package/docs/lints/prefer-variant-directive.md +8 -8
- package/docs/lints/split-view-transition-class.md +5 -4
- package/docs/lints/suspending-macro-argument.md +2 -2
- package/docs/lints/unknown-utility.md +2 -1
- package/docs/lints/unknown-variant.md +2 -2
- package/docs/lints/unverified-style-base.md +4 -3
- package/docs/macros/anchor-scope.md +13 -10
- package/docs/macros/css.md +11 -9
- package/docs/macros/cva.md +9 -8
- package/docs/macros/index.md +10 -10
- package/docs/macros/keyframes.md +5 -4
- package/docs/macros/media.md +6 -5
- package/docs/macros/ref/as-anchor.md +12 -7
- package/docs/macros/ref/as-container.md +7 -4
- package/docs/macros/ref/at.md +10 -9
- package/docs/macros/ref/condition.md +1 -1
- package/docs/macros/ref/in.md +6 -6
- package/docs/macros/ref/index.md +11 -11
- package/docs/macros/ref/position-anchor.md +7 -4
- package/docs/macros/style.md +3 -3
- package/docs/macros/view-transition.md +13 -12
- package/docs/plugins/iconify.md +95 -85
- package/docs/plugins/index.md +3 -3
- package/docs/utilities-and-variants.md +4 -4
- package/docs/why.md +2 -2
- package/package.json +29 -5
- package/skills/migrate-to-stillwind/SKILL.md +7 -2
package/docs/at-rules/apply.md
CHANGED
|
@@ -27,7 +27,7 @@ inside a style rule or a utility definition. Whitespace separates the utilities.
|
|
|
27
27
|
### Generated stylesheet without preflight
|
|
28
28
|
|
|
29
29
|
```css
|
|
30
|
-
/*! stillwind v0.
|
|
30
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
31
31
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
32
32
|
@layer properties, theme, base, components, utilities;
|
|
33
33
|
|
|
@@ -76,7 +76,7 @@ rule takes the place of the generated class. Utilities without variants come
|
|
|
76
76
|
first in utility order. Utilities with variants follow in variant order.
|
|
77
77
|
|
|
78
78
|
The stylesheet declares the theme values and registered properties that the
|
|
79
|
-
applied utilities need, as it does for `style()
|
|
79
|
+
applied utilities need, as it does for [`style()`](../macros/style.md).
|
|
80
80
|
|
|
81
81
|
## Rules
|
|
82
82
|
|
|
@@ -90,4 +90,4 @@ applied utilities need, as it does for `style()`.
|
|
|
90
90
|
element a `group` for `group-hover:`.
|
|
91
91
|
|
|
92
92
|
To apply a condition to your own declarations, use
|
|
93
|
-
[
|
|
93
|
+
[`@variant`](variant.md) instead.
|
|
@@ -21,7 +21,8 @@ stylesheet.
|
|
|
21
21
|
## Example
|
|
22
22
|
|
|
23
23
|
The short form takes a selector in parentheses. The block form wraps the
|
|
24
|
-
content with any rules, and `@slot` marks where the
|
|
24
|
+
content with any rules, and [`@slot`](slot.md) marks where the
|
|
25
|
+
content goes.
|
|
25
26
|
|
|
26
27
|
### Stylesheet
|
|
27
28
|
|
|
@@ -53,7 +54,7 @@ export const link = {className:"sw_r7v8w"};
|
|
|
53
54
|
### Generated stylesheet without preflight
|
|
54
55
|
|
|
55
56
|
```css
|
|
56
|
-
/*! stillwind v0.
|
|
57
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
57
58
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
58
59
|
@layer properties, theme, base, components, utilities;
|
|
59
60
|
|
|
@@ -109,11 +110,12 @@ export const css = style.css("shell:block shell:p-4 [button]:rounded-md");
|
|
|
109
110
|
### Compiled code
|
|
110
111
|
|
|
111
112
|
```ts
|
|
112
|
-
export const css = "/*! stillwind v0.
|
|
113
|
+
export const css = "/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n:where(:root, :host){--spacing:0.25rem;--radius-md:0.375rem;}:host{display:block;}:host{padding:calc(var(--spacing) * 4);}button{border-radius:var(--radius-md);}";
|
|
113
114
|
```
|
|
114
115
|
|
|
115
|
-
In `style.css()
|
|
116
|
-
styles. In `style()
|
|
116
|
+
In [`style.css()`](../macros/css.md), the first such variant selects the
|
|
117
|
+
element that the utility styles. In [`style()`](../macros/style.md), the rule
|
|
118
|
+
stays document-wide, and
|
|
117
119
|
[document-scoped-selector](../lints/document-scoped-selector.md) reports it.
|
|
118
120
|
|
|
119
121
|
## Definitions with the same name
|
package/docs/at-rules/index.md
CHANGED
|
@@ -5,11 +5,11 @@ description: "Find the at-rules that define tokens, utilities, and variants in y
|
|
|
5
5
|
|
|
6
6
|
# At-rule reference
|
|
7
7
|
|
|
8
|
-
Your stylesheet defines the design system that `style()`
|
|
9
|
-
CSS, it can contain at-rules that define tokens,
|
|
10
|
-
at-rules that control where the generated CSS goes.
|
|
11
|
-
Tailwind CSS v4, and Stillwind evaluates them with its
|
|
12
|
-
start with `@stillwind-`.
|
|
8
|
+
Your stylesheet defines the design system that [`style()`](../macros/style.md)
|
|
9
|
+
uses. Besides ordinary CSS, it can contain at-rules that define tokens,
|
|
10
|
+
utilities, and variants, and at-rules that control where the generated CSS goes.
|
|
11
|
+
Some of them come from Tailwind CSS v4, and Stillwind evaluates them with its
|
|
12
|
+
own rules. The others start with `@stillwind-`.
|
|
13
13
|
|
|
14
14
|
Each page shows the syntax of an at-rule and examples. An example shows the
|
|
15
15
|
stylesheet, the source that uses it, and the complete generated stylesheet. The
|
|
@@ -17,41 +17,41 @@ generated stylesheet on these pages leaves out the preflight reset.
|
|
|
17
17
|
|
|
18
18
|
## Define the design system
|
|
19
19
|
|
|
20
|
-
| At-rule
|
|
21
|
-
|
|
|
22
|
-
| [
|
|
23
|
-
| [
|
|
24
|
-
| [
|
|
25
|
-
| [
|
|
26
|
-
| [
|
|
27
|
-
| [
|
|
28
|
-
| [
|
|
20
|
+
| At-rule | Use it to | Origin |
|
|
21
|
+
| ------------------------------------------------------------------------------ | ------------------------------------------------------------- | --------- |
|
|
22
|
+
| [`@theme`](theme.md) | Define design tokens and shared values | Tailwind |
|
|
23
|
+
| [`@utility`](utility.md) | Define a utility or add declarations to an existing one | Tailwind |
|
|
24
|
+
| [`@custom-variant`](custom-variant.md) | Define a variant | Tailwind |
|
|
25
|
+
| [`@slot`](slot.md) | Mark where a variant definition inserts the styled content | Tailwind |
|
|
26
|
+
| [`@plugin`](plugin.md) | Load a Stillwind or Tailwind CSS v4 plugin | Tailwind |
|
|
27
|
+
| [`@stillwind-property`](stillwind-property.md) | Register a custom property that utilities need | Stillwind |
|
|
28
|
+
| [`@stillwind-require-properties`](stillwind-require-properties.md) | Declare the registered custom properties that a utility needs | Stillwind |
|
|
29
29
|
|
|
30
30
|
## Use utilities in your own rules
|
|
31
31
|
|
|
32
|
-
| At-rule
|
|
33
|
-
|
|
|
34
|
-
| [
|
|
35
|
-
| [
|
|
32
|
+
| At-rule | Use it to | Origin |
|
|
33
|
+
| ------------------------------------ | ----------------------------------------------------- | -------- |
|
|
34
|
+
| [`@apply`](apply.md) | Insert the declarations of utilities into a rule | Tailwind |
|
|
35
|
+
| [`@variant`](variant.md) | Apply variants, such as `hover` or `dark`, to a block | Tailwind |
|
|
36
36
|
|
|
37
37
|
## Place the generated CSS
|
|
38
38
|
|
|
39
|
-
| At-rule
|
|
40
|
-
|
|
|
41
|
-
| [
|
|
42
|
-
| [
|
|
39
|
+
| At-rule | Use it to | Origin |
|
|
40
|
+
| ------------------------------------------------------------------ | ------------------------------------------------------ | --------- |
|
|
41
|
+
| [`@stillwind-slot`](stillwind-slot.md) | Place generated utilities, theme values, and other CSS | Stillwind |
|
|
42
|
+
| [`@stillwind-css-template`](stillwind-css-template.md) | Define the output of [`style.css()`](../macros/css.md) | Stillwind |
|
|
43
43
|
|
|
44
44
|
`@import "stillwind"` already places every slot. Use these at-rules when you
|
|
45
45
|
write your own entry stylesheet or change the output of `style.css()`.
|
|
46
46
|
|
|
47
47
|
## Remove or limit definitions
|
|
48
48
|
|
|
49
|
-
| At-rule
|
|
50
|
-
|
|
|
51
|
-
| [
|
|
52
|
-
| [
|
|
53
|
-
| [
|
|
54
|
-
| [
|
|
49
|
+
| At-rule | Use it to | Origin |
|
|
50
|
+
| ------------------------------------------------------------------------------------------ | -------------------------------------------------------- | --------- |
|
|
51
|
+
| [`@stillwind-undef-utility`](stillwind-undef-utility.md) | Remove built-in or plugin utilities | Stillwind |
|
|
52
|
+
| [`@stillwind-undef-variant`](stillwind-undef-variant.md) | Remove built-in or plugin variants | Stillwind |
|
|
53
|
+
| [`@stillwind-undef-arbitrary-property`](stillwind-undef-arbitrary-property.md) | Reject arbitrary properties such as `[color:red]` | Stillwind |
|
|
54
|
+
| [`@stillwind-registry`](stillwind-registry.md) | Change definitions only in keyframes or view transitions | Stillwind |
|
|
55
55
|
|
|
56
56
|
## Write a utility library
|
|
57
57
|
|
package/docs/at-rules/plugin.md
CHANGED
|
@@ -52,13 +52,13 @@ numeric text become those values. A quoted string loses its quotes, other text s
|
|
|
52
52
|
a string, and a comma-separated list becomes an array.
|
|
53
53
|
|
|
54
54
|
Definitions from a plugin register before the definitions of your stylesheet,
|
|
55
|
-
wherever the `@plugin` statement stands. A `@utility` in your
|
|
56
|
-
therefore adds to a plugin utility with the same name, and
|
|
57
|
-
[
|
|
55
|
+
wherever the `@plugin` statement stands. A [`@utility`](utility.md) in your
|
|
56
|
+
stylesheet therefore adds to a plugin utility with the same name, and
|
|
57
|
+
[`@stillwind-undef-utility`](stillwind-undef-utility.md) can remove
|
|
58
58
|
plugin utilities.
|
|
59
59
|
|
|
60
|
-
A plugin can select elements by fixed class names, such as `not-prose`.
|
|
61
|
-
keeps these class names, as
|
|
60
|
+
A plugin can select elements by fixed class names, such as `not-prose`.
|
|
61
|
+
[`style()`](../macros/style.md) keeps these class names, as
|
|
62
62
|
[Tailwind CSS compatibility](../guides/tailwind-compatibility.md#class-names-that-a-plugins-selectors-use)
|
|
63
63
|
describes. That page also lists the tested plugins.
|
|
64
64
|
|
|
@@ -9,8 +9,8 @@ Stillwind defines its built-in utilities and variants in CSS, in the files that
|
|
|
9
9
|
`@import "stillwind"` loads. These files use registry directives, which describe
|
|
10
10
|
cascade order, theme metadata, and other information that ordinary definitions
|
|
11
11
|
cannot express. Use them when you write a utility library. An application
|
|
12
|
-
stylesheet normally uses [
|
|
13
|
-
[
|
|
12
|
+
stylesheet normally uses [`@utility`](utility.md) and
|
|
13
|
+
[`@custom-variant`](custom-variant.md) instead.
|
|
14
14
|
|
|
15
15
|
Editors suggest these directives inside definitions and registry blocks. The
|
|
16
16
|
[built-in definitions](https://github.com/SegaraRai/stillwind/tree/main/packages/core/css)
|
|
@@ -24,11 +24,12 @@ show complete examples.
|
|
|
24
24
|
@stillwind-utility name-* (tw-sort: property) { ... }
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Defines a utility with the same body language as
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
property
|
|
31
|
-
header also
|
|
27
|
+
Defines a utility with the same body language as
|
|
28
|
+
[`@utility`](utility.md). The position of the definition decides
|
|
29
|
+
its cascade order: a later definition wins over an earlier one when both set
|
|
30
|
+
the same property. The optional `tw-sort` descriptor names the property that
|
|
31
|
+
Tailwind-compatible class sorting uses for the definition. The header also
|
|
32
|
+
accepts `implementation`.
|
|
32
33
|
|
|
33
34
|
All `@stillwind-utility` definitions of a name register before plugin
|
|
34
35
|
definitions and the `@utility` definitions of the stylesheet.
|
|
@@ -39,9 +40,9 @@ definitions and the `@utility` definitions of the stylesheet.
|
|
|
39
40
|
@stillwind-variant name (descriptors) { ... }
|
|
40
41
|
```
|
|
41
42
|
|
|
42
|
-
Defines a variant with the body language of
|
|
43
|
-
|
|
44
|
-
comma-separated list:
|
|
43
|
+
Defines a variant with the body language of
|
|
44
|
+
[`@custom-variant`](custom-variant.md). Its position decides the
|
|
45
|
+
output order of variant rules. The optional header is a comma-separated list:
|
|
45
46
|
|
|
46
47
|
| Descriptor | Value |
|
|
47
48
|
| ----------- | ----------------------------------------------------------------------------------------- |
|
|
@@ -81,7 +82,7 @@ Places arbitrary-property candidates for the matching properties, such as
|
|
|
81
82
|
definitions end with `@stillwind-arbitrary-property *;`, so other arbitrary
|
|
82
83
|
properties come after every built-in utility. The statement also accepts the
|
|
83
84
|
matching properties again after
|
|
84
|
-
[
|
|
85
|
+
[`@stillwind-undef-arbitrary-property`](stillwind-undef-arbitrary-property.md).
|
|
85
86
|
|
|
86
87
|
## Theme metadata
|
|
87
88
|
|
|
@@ -177,5 +178,5 @@ that their dynamic utilities use.
|
|
|
177
178
|
Registers a pattern of utility or variant names that relate an element to
|
|
178
179
|
another element, such as `group-*` and `peer-*`.
|
|
179
180
|
[prefer-typed-relationships](../lints/prefer-typed-relationships.md) reports
|
|
180
|
-
candidates that match a pattern, because [style.ref()](../macros/ref/index.md) can
|
|
181
|
+
candidates that match a pattern, because [`style.ref()`](../macros/ref/index.md) can
|
|
181
182
|
express the same relationship. The patterns do not change the generated CSS.
|
package/docs/at-rules/slot.md
CHANGED
|
@@ -11,7 +11,7 @@ description: "Mark where a variant definition inserts the styled content."
|
|
|
11
11
|
|
|
12
12
|
`@slot` marks where the block form of a variant definition inserts the
|
|
13
13
|
declarations of the utility. Write it in the body of
|
|
14
|
-
[
|
|
14
|
+
[`@custom-variant`](custom-variant.md), or of a registry variant
|
|
15
15
|
definition.
|
|
16
16
|
|
|
17
17
|
### Stylesheet
|
|
@@ -42,7 +42,7 @@ export const link = {className:"sw_4x5c3"};
|
|
|
42
42
|
### Generated stylesheet without preflight
|
|
43
43
|
|
|
44
44
|
```css
|
|
45
|
-
/*! stillwind v0.
|
|
45
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
46
46
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
47
47
|
@layer properties, theme, base, components, utilities;
|
|
48
48
|
|
|
@@ -54,5 +54,5 @@ export const link = {className:"sw_4x5c3"};
|
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
`@slot` belongs to variant definitions only.
|
|
57
|
-
[
|
|
57
|
+
[`@stillwind-slot`](stillwind-slot.md) is a different at-rule: it
|
|
58
58
|
places generated CSS in your stylesheet.
|
|
@@ -13,7 +13,7 @@ description: "Define where style.css() places its utilities, theme values, and o
|
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
`@stillwind-css-template` defines a template for the string that
|
|
16
|
-
[style.css()](../macros/css.md) returns. The `template` option of the call
|
|
16
|
+
[`style.css()`](../macros/css.md) returns. The `template` option of the call
|
|
17
17
|
selects the template by name, and `default` applies when the call names none.
|
|
18
18
|
Write it at the top level of the stylesheet.
|
|
19
19
|
|
|
@@ -47,7 +47,7 @@ export const css = style.css("p-4 text-blue-600", {
|
|
|
47
47
|
### Compiled code
|
|
48
48
|
|
|
49
49
|
```ts
|
|
50
|
-
export const css = "/*! stillwind v0.
|
|
50
|
+
export const css = "/*! stillwind v0.6.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
51
|
```
|
|
52
52
|
|
|
53
53
|
The string contains the template's own CSS, and each slot receives the output of
|
|
@@ -82,7 +82,7 @@ export const css = style.css("p-4 text-blue-600", {
|
|
|
82
82
|
### Compiled code
|
|
83
83
|
|
|
84
84
|
```ts
|
|
85
|
-
export const css = "/*! stillwind v0.
|
|
85
|
+
export const css = "/*! stillwind v0.6.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
86
|
```
|
|
87
87
|
|
|
88
88
|
## The default template
|
|
@@ -108,9 +108,9 @@ export const css = "/*! stillwind v0.4.1 | MIT License | https://stillwind.dev *
|
|
|
108
108
|
}
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
It places the theme values on the root of the tree that adopts the string. It
|
|
112
|
-
|
|
113
|
-
effect. No rule is in a layer.
|
|
111
|
+
It places the theme values on the root of the tree that adopts the string. It emits no
|
|
112
|
+
[`@property`](https://developer.mozilla.org/docs/Web/CSS/Reference/At-rules/@property)
|
|
113
|
+
rules, because a registration inside a shadow root has no effect. No rule is in a layer.
|
|
114
114
|
|
|
115
115
|
A later template with the same name replaces an earlier one, so your stylesheet
|
|
116
116
|
can redefine `default` after `@import "stillwind"`.
|
|
@@ -118,7 +118,8 @@ can redefine `default` after `@import "stillwind"`.
|
|
|
118
118
|
## Rules
|
|
119
119
|
|
|
120
120
|
- A template must contain a `utilities` slot.
|
|
121
|
-
- A template cannot contain definitions, such as `@theme`
|
|
121
|
+
- A template cannot contain definitions, such as [`@theme`](theme.md)
|
|
122
|
+
or [`@utility`](utility.md).
|
|
122
123
|
- The loader skips a template that breaks these rules, and
|
|
123
124
|
[invalid-css-directive](../lints/invalid-css-directive.md) reports it.
|
|
124
125
|
- A template name that the stylesheet does not define reports
|
|
@@ -13,9 +13,10 @@ description: "Register a custom property that the stylesheet declares with @prop
|
|
|
13
13
|
}
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
`@stillwind-property` registers a custom property. The compiler emits a
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
`@stillwind-property` registers a custom property. The compiler emits a standard
|
|
17
|
+
[`@property`](https://developer.mozilla.org/docs/Web/CSS/Reference/At-rules/@property)
|
|
18
|
+
rule, and an initial value for each element, only when the generated CSS needs
|
|
19
|
+
the property. Write it at the top level of the stylesheet.
|
|
19
20
|
|
|
20
21
|
## Example
|
|
21
22
|
|
|
@@ -51,7 +52,7 @@ export const icon = {className:"sw_7ic77"};
|
|
|
51
52
|
### Generated stylesheet without preflight
|
|
52
53
|
|
|
53
54
|
```css
|
|
54
|
-
/*! stillwind v0.
|
|
55
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
55
56
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
56
57
|
@layer properties, theme, base, components, utilities;
|
|
57
58
|
|
|
@@ -79,7 +80,7 @@ export const icon = {className:"sw_7ic77"};
|
|
|
79
80
|
|
|
80
81
|
The `properties` slot places the `@property` rule. The `property-initials` slot
|
|
81
82
|
places the initial values, for browsers that ignore `@property`. See
|
|
82
|
-
[
|
|
83
|
+
[`@stillwind-slot`](stillwind-slot.md).
|
|
83
84
|
|
|
84
85
|
## Descriptors
|
|
85
86
|
|
|
@@ -100,7 +101,7 @@ removes them from the output:
|
|
|
100
101
|
both cases. `dependency` emits it only through `depends-on` or `group`.
|
|
101
102
|
|
|
102
103
|
A utility can also require a registration with
|
|
103
|
-
[
|
|
104
|
+
[`@stillwind-require-properties`](stillwind-require-properties.md).
|
|
104
105
|
|
|
105
106
|
## Value checks
|
|
106
107
|
|
|
@@ -16,12 +16,12 @@ definitions, called a registry. `@stillwind-registry` selects the registries
|
|
|
16
16
|
that the definitions inside the block change. Write it at the top level of the
|
|
17
17
|
stylesheet, or inside another `@stillwind-registry` block.
|
|
18
18
|
|
|
19
|
-
| Registry | Resolves the utilities of
|
|
20
|
-
| ----------------- |
|
|
21
|
-
| `default` | `style()
|
|
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()`
|
|
19
|
+
| Registry | Resolves the utilities of |
|
|
20
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| `default` | [`style()`](../macros/style.md), [`style.cva()`](../macros/cva.md), [`style.css()`](../macros/css.md), and [`@apply`](apply.md) |
|
|
22
|
+
| `keyframe` | The frames of [`style.keyframes()`](../macros/keyframes.md) |
|
|
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()`](../macros/view-transition.md) |
|
|
25
25
|
|
|
26
26
|
A definition outside every block changes `default`, `keyframe`, and
|
|
27
27
|
`view-transition`. `animation` starts empty and changes only through blocks that
|
|
@@ -30,7 +30,7 @@ name it.
|
|
|
30
30
|
## Example
|
|
31
31
|
|
|
32
32
|
The built-in `keyframe` and `view-transition` registries replace `duration-*`
|
|
33
|
-
with definitions that set animation properties. A top-level `@utility` with a
|
|
33
|
+
with definitions that set animation properties. A top-level [`@utility`](utility.md) with a
|
|
34
34
|
name that they replace also reaches those registries, and
|
|
35
35
|
[bypassed-undefinition](../lints/bypassed-undefinition.md) reports it. A
|
|
36
36
|
`default` block keeps the definition out of them:
|
|
@@ -62,7 +62,7 @@ export const panel = {className:"sw_2wahw"};
|
|
|
62
62
|
### Generated stylesheet without preflight
|
|
63
63
|
|
|
64
64
|
```css
|
|
65
|
-
/*! stillwind v0.
|
|
65
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
66
66
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
67
67
|
@layer properties, theme, base, components, utilities;
|
|
68
68
|
|
|
@@ -98,10 +98,11 @@ animations instead:
|
|
|
98
98
|
|
|
99
99
|
A block contains only these statements. Another statement is an error.
|
|
100
100
|
|
|
101
|
-
- `@utility
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
[
|
|
101
|
+
- [`@utility`](utility.md), [`@custom-variant`](custom-variant.md),
|
|
102
|
+
and [`@variant`](variant.md) definitions
|
|
103
|
+
- [`@stillwind-undef-utility`](stillwind-undef-utility.md),
|
|
104
|
+
[`@stillwind-undef-variant`](stillwind-undef-variant.md), and
|
|
105
|
+
[`@stillwind-undef-arbitrary-property`](stillwind-undef-arbitrary-property.md)
|
|
105
106
|
- `@stillwind-arbitrary-property`, `@stillwind-utility`, and
|
|
106
107
|
`@stillwind-variant` from the [registry directives](registry-directives.md)
|
|
107
108
|
- A nested `@stillwind-registry` block. The innermost block decides.
|
|
@@ -54,7 +54,7 @@ export const icon = {className:"sw_7ic77"};
|
|
|
54
54
|
### Generated stylesheet without preflight
|
|
55
55
|
|
|
56
56
|
```css
|
|
57
|
-
/*! stillwind v0.
|
|
57
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
58
58
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
59
59
|
@layer properties, theme, base, components, utilities;
|
|
60
60
|
|
|
@@ -86,6 +86,6 @@ compiler reports an invalid name as [SW14003](../errors/SW14003.md) in your
|
|
|
86
86
|
stylesheet. When a module uses a utility with an invalid name, the compiler
|
|
87
87
|
reports [SW14004](../errors/SW14004.md), including for plugin utilities.
|
|
88
88
|
|
|
89
|
-
A required name needs a [
|
|
89
|
+
A required name needs a [`@stillwind-property`](stillwind-property.md)
|
|
90
90
|
registration in the loaded stylesheets. A missing registration is
|
|
91
91
|
[SW14005](../errors/SW14005.md).
|
|
@@ -18,21 +18,21 @@ when you write your own entry stylesheet or a
|
|
|
18
18
|
|
|
19
19
|
These slots insert complete rules. Write them outside style rules:
|
|
20
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
|
|
21
|
+
| Slot | Inserts |
|
|
22
|
+
| ------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| `utilities` | The rules of the utilities that modules use |
|
|
24
|
+
| `keyframes` | The [`@keyframes`](https://developer.mozilla.org/docs/Web/CSS/Reference/At-rules/@keyframes) rules that the used utilities need |
|
|
25
|
+
| `properties` | The [`@property`](https://developer.mozilla.org/docs/Web/CSS/Reference/At-rules/@property) rules of the needed registrations |
|
|
26
26
|
|
|
27
27
|
These slots insert declarations. Write them inside a style rule, which supplies
|
|
28
28
|
the selector:
|
|
29
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
|
|
30
|
+
| Slot | Inserts |
|
|
31
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
32
|
+
| `theme` | The theme values that the generated CSS uses, and [`@theme static`](theme.md) 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
36
|
|
|
37
37
|
## Example
|
|
38
38
|
|
|
@@ -81,5 +81,5 @@ declarations win.
|
|
|
81
81
|
`keyframes`, is [SW14002](../errors/SW14002.md).
|
|
82
82
|
- A repeated slot repeats its output at every position.
|
|
83
83
|
|
|
84
|
-
`@stillwind-slot` places generated CSS. [
|
|
84
|
+
`@stillwind-slot` places generated CSS. [`@slot`](slot.md) is a
|
|
85
85
|
different at-rule for variant definitions.
|
|
@@ -15,7 +15,7 @@ An arbitrary property is a utility that writes a declaration directly, such as
|
|
|
15
15
|
`[color:red]`. `@stillwind-undef-arbitrary-property` rejects arbitrary
|
|
16
16
|
properties for the matching CSS properties. A rejected candidate produces no
|
|
17
17
|
CSS. Write the statement at the top level of the stylesheet or in a
|
|
18
|
-
[
|
|
18
|
+
[`@stillwind-registry`](stillwind-registry.md) block.
|
|
19
19
|
|
|
20
20
|
## Example
|
|
21
21
|
|
|
@@ -45,7 +45,7 @@ export const accepted = {className:"sw_obysi"};
|
|
|
45
45
|
### Generated stylesheet without preflight
|
|
46
46
|
|
|
47
47
|
```css
|
|
48
|
-
/*! stillwind v0.
|
|
48
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
49
49
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
50
50
|
@layer properties, theme, base, components, utilities;
|
|
51
51
|
|
|
@@ -67,7 +67,7 @@ properties again, so components can still set variables.
|
|
|
67
67
|
again. The [registry directives](registry-directives.md) describe
|
|
68
68
|
its other role.
|
|
69
69
|
- Patterns use the same forms as
|
|
70
|
-
[
|
|
70
|
+
[`@stillwind-undef-utility`](stillwind-undef-utility.md), with
|
|
71
71
|
property names instead of utility names.
|
|
72
72
|
|
|
73
73
|
To report arbitrary values without rejecting them, use lint rules such as
|
|
@@ -15,7 +15,7 @@ description: "Remove built-in or plugin utility definitions that match a name or
|
|
|
15
15
|
register before it. A removed utility becomes unknown, and
|
|
16
16
|
[unknown-utility](../lints/unknown-utility.md) reports its uses. Write it at the
|
|
17
17
|
top level of the stylesheet or in a
|
|
18
|
-
[
|
|
18
|
+
[`@stillwind-registry`](stillwind-registry.md) block.
|
|
19
19
|
|
|
20
20
|
## Example
|
|
21
21
|
|
|
@@ -48,7 +48,7 @@ export const replaced = {className:"sw_vofby"};
|
|
|
48
48
|
### Generated stylesheet without preflight
|
|
49
49
|
|
|
50
50
|
```css
|
|
51
|
-
/*! stillwind v0.
|
|
51
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
52
52
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
53
53
|
@layer properties, theme, base, components, utilities;
|
|
54
54
|
|
|
@@ -71,21 +71,22 @@ pattern for negative names starts with `-`.
|
|
|
71
71
|
|
|
72
72
|
## Order
|
|
73
73
|
|
|
74
|
-
The statements that `@plugin` generates register first.
|
|
75
|
-
including the built-in definitions that `@import "stillwind"`
|
|
76
|
-
source order. An undefinition removes only definitions that
|
|
74
|
+
The statements that [`@plugin`](plugin.md) generates register first.
|
|
75
|
+
The other statements, including the built-in definitions that `@import "stillwind"`
|
|
76
|
+
loads, follow in source order. An undefinition removes only definitions that
|
|
77
|
+
register before it:
|
|
77
78
|
|
|
78
79
|
- It removes plugin utilities, wherever the `@plugin` statement stands.
|
|
79
80
|
- It removes the built-in utilities that `@import "stillwind"` loads before it.
|
|
80
|
-
- It does not remove a `@utility` that comes after it, so
|
|
81
|
-
built-in utility and define your own utility with the same name.
|
|
81
|
+
- It does not remove a [`@utility`](utility.md) that comes after it, so
|
|
82
|
+
you can remove a built-in utility and define your own utility with the same name.
|
|
82
83
|
|
|
83
84
|
A replacement with the same name keeps the cascade position of the removed
|
|
84
85
|
definition, so it wins against the same utilities as before. A definition with
|
|
85
86
|
another name takes the position where you write it. A definition without `*`
|
|
86
87
|
does not take the position of a removed `prefix-*` definition.
|
|
87
|
-
The [logical stylesheets](../concepts/stylesheets.md#logical-axis-utilities)
|
|
88
|
-
utilities in this way.
|
|
88
|
+
The [logical stylesheets](../concepts/stylesheets.md#logical-axis-utilities)
|
|
89
|
+
replace utilities in this way.
|
|
89
90
|
|
|
90
91
|
Outside a block, the statement changes the `default`, `keyframe`, and
|
|
91
92
|
`view-transition` registries.
|
|
@@ -15,7 +15,7 @@ description: "Remove built-in or plugin variant definitions that match a name or
|
|
|
15
15
|
register before it. A removed variant becomes unknown, and
|
|
16
16
|
[unknown-variant](../lints/unknown-variant.md) reports its uses. Write it at the
|
|
17
17
|
top level of the stylesheet or in a
|
|
18
|
-
[
|
|
18
|
+
[`@stillwind-registry`](stillwind-registry.md) block.
|
|
19
19
|
|
|
20
20
|
## Example
|
|
21
21
|
|
|
@@ -42,7 +42,7 @@ export const toolbar = {};
|
|
|
42
42
|
### Generated stylesheet without preflight
|
|
43
43
|
|
|
44
44
|
```css
|
|
45
|
-
/*! stillwind v0.
|
|
45
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
46
46
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
47
47
|
@layer properties, theme, base, components, utilities;
|
|
48
48
|
```
|
|
@@ -50,6 +50,6 @@ export const toolbar = {};
|
|
|
50
50
|
`print:hidden` produces no class, because `print` is unknown.
|
|
51
51
|
|
|
52
52
|
Patterns and registration order work as in
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
a variant with the removed name again.
|
|
53
|
+
[`@stillwind-undef-utility`](stillwind-undef-utility.md). A
|
|
54
|
+
[`@custom-variant`](custom-variant.md) after the statement can
|
|
55
|
+
define a variant with the removed name again.
|
package/docs/at-rules/theme.md
CHANGED
|
@@ -44,7 +44,7 @@ export const card = {className:"sw_j7rat"};
|
|
|
44
44
|
### Generated stylesheet without preflight
|
|
45
45
|
|
|
46
46
|
```css
|
|
47
|
-
/*! stillwind v0.
|
|
47
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
48
48
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
49
49
|
@layer properties, theme, base, components, utilities;
|
|
50
50
|
|
|
@@ -110,7 +110,7 @@ export const label = {className:"sw_4zrwj"};
|
|
|
110
110
|
### Generated stylesheet without preflight
|
|
111
111
|
|
|
112
112
|
```css
|
|
113
|
-
/*! stillwind v0.
|
|
113
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
114
114
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
115
115
|
@layer properties, theme, base, components, utilities;
|
|
116
116
|
|
|
@@ -163,7 +163,7 @@ export const title = {className:"sw_mjcfr"};
|
|
|
163
163
|
### Generated stylesheet without preflight
|
|
164
164
|
|
|
165
165
|
```css
|
|
166
|
-
/*! stillwind v0.
|
|
166
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
167
167
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
168
168
|
@layer properties, theme, base, components, utilities;
|
|
169
169
|
|
|
@@ -216,7 +216,7 @@ export const done = {className:"sw_j94hj"};
|
|
|
216
216
|
### Generated stylesheet without preflight
|
|
217
217
|
|
|
218
218
|
```css
|
|
219
|
-
/*! stillwind v0.
|
|
219
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
220
220
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
221
221
|
@layer properties, theme, base, components, utilities;
|
|
222
222
|
|
|
@@ -269,7 +269,7 @@ export const page = {className:"sw_rjnyv"};
|
|
|
269
269
|
### Generated stylesheet without preflight
|
|
270
270
|
|
|
271
271
|
```css
|
|
272
|
-
/*! stillwind v0.
|
|
272
|
+
/*! stillwind v0.6.0 | MIT License | https://stillwind.dev */
|
|
273
273
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
274
274
|
@layer properties, theme, base, components, utilities;
|
|
275
275
|
|
|
@@ -296,7 +296,7 @@ assets, and `@theme asset { --*: initial; }` keeps design tokens.
|
|
|
296
296
|
## Placement
|
|
297
297
|
|
|
298
298
|
The `theme` slot places the declarations. `@import "stillwind"` puts it on
|
|
299
|
-
`:root, :host`. See [
|
|
299
|
+
`:root, :host`. See [`@stillwind-slot`](stillwind-slot.md).
|
|
300
300
|
|
|
301
301
|
[incompatible-theme-value](../lints/incompatible-theme-value.md) reports a token
|
|
302
302
|
with a value of the wrong type for its namespace, such as a length in
|