stillwind 0.5.0 → 0.7.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 +12 -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 +12 -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/index.d.ts +2 -0
- package/package.json +31 -5
- package/skills/migrate-to-stillwind/SKILL.md +7 -2
|
@@ -5,7 +5,8 @@ description: "Reports a utility or variant definition that replaces an earlier o
|
|
|
5
5
|
|
|
6
6
|
# duplicate-definition
|
|
7
7
|
|
|
8
|
-
This rule reports a `@utility` or
|
|
8
|
+
This rule reports a [`@utility`](../at-rules/utility.md) or
|
|
9
|
+
[`@custom-variant`](../at-rules/custom-variant.md) definition that replaces an
|
|
9
10
|
earlier definition with the same name. The definitions do not combine, so the
|
|
10
11
|
earlier one is lost. In the example, `hocus` matches focus only, not hover.
|
|
11
12
|
|
|
@@ -5,8 +5,10 @@ description: "Reports two .for() calls in one style() call."
|
|
|
5
5
|
|
|
6
6
|
# duplicate-view-transition-name
|
|
7
7
|
|
|
8
|
-
This rule reports a `style()` call with more than one
|
|
9
|
-
`view-transition
|
|
8
|
+
This rule reports a [`style()`](../macros/style.md) call with more than one
|
|
9
|
+
[`.for()`](../macros/view-transition.md). An element has one
|
|
10
|
+
[`view-transition-name`](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/view-transition-name),
|
|
11
|
+
so only one of the names takes effect.
|
|
10
12
|
|
|
11
13
|
## Reported
|
|
12
14
|
|
|
@@ -5,9 +5,10 @@ description: "Reports a media rule around a utility definition, which the compil
|
|
|
5
5
|
|
|
6
6
|
# ignored-definition-condition
|
|
7
7
|
|
|
8
|
-
This rule reports a `@utility` definition inside a
|
|
9
|
-
The compiler registers utilities when it reads the
|
|
10
|
-
browser, so it ignores the condition. The utility then
|
|
8
|
+
This rule reports a [`@utility`](../at-rules/utility.md) definition inside a
|
|
9
|
+
condition such as `@media`. The compiler registers utilities when it reads the
|
|
10
|
+
stylesheet, not in the browser, so it ignores the condition. The utility then
|
|
11
|
+
applies at every width.
|
|
11
12
|
|
|
12
13
|
## Reported
|
|
13
14
|
|
|
@@ -8,7 +8,7 @@ description: "Reports Tailwind CSS features that Stillwind ignores in the styles
|
|
|
8
8
|
This rule reports a Tailwind CSS feature in your stylesheet that Stillwind
|
|
9
9
|
ignores, such as `@config`, `@source`, or an option on `@import`. The line has
|
|
10
10
|
no effect, because Stillwind reads its settings from `stillwind.config.ts` and
|
|
11
|
-
generates utilities only from `style()` calls.
|
|
11
|
+
generates utilities only from [`style()`](../macros/style.md) calls.
|
|
12
12
|
|
|
13
13
|
## Reported
|
|
14
14
|
|
|
@@ -5,9 +5,10 @@ description: "Reports a custom variant selector without &, which matches descend
|
|
|
5
5
|
|
|
6
6
|
# implicit-nesting-selector
|
|
7
7
|
|
|
8
|
-
This rule reports a `@custom-variant` selector
|
|
9
|
-
selector matches descendants of the element, not
|
|
10
|
-
example, `hocus:` would match hovered elements inside
|
|
8
|
+
This rule reports a [`@custom-variant`](../at-rules/custom-variant.md) selector
|
|
9
|
+
without `&`. Without `&`, the selector matches descendants of the element, not
|
|
10
|
+
the element itself. In the example, `hocus:` would match hovered elements inside
|
|
11
|
+
the element.
|
|
11
12
|
|
|
12
13
|
## Reported
|
|
13
14
|
|
package/docs/lints/index.md
CHANGED
|
@@ -31,34 +31,34 @@ A utility or variant that these rules report produces no CSS.
|
|
|
31
31
|
An argument that these rules report adds no CSS, and a condition that they
|
|
32
32
|
report never matches.
|
|
33
33
|
|
|
34
|
-
| Rule | Reports
|
|
35
|
-
| ------------------------------------------------------------------------------------ |
|
|
36
|
-
| [invalid-animation-option](invalid-animation-option.md) | A utility that is not an animation option, such as `p-4`
|
|
37
|
-
| [invalid-css-input](invalid-css-input.md) | A `style.css()` argument that is not a static utility | deny |
|
|
38
|
-
| [invalid-cva-config](invalid-cva-config.md) | An unknown or malformed field in a `style.cva()` configuration | deny |
|
|
39
|
-
| [invalid-cva-input](invalid-cva-input.md) | `&&` or a ternary inside a `style.cva()` value
|
|
40
|
-
| [invalid-keyframes-definition](invalid-keyframes-definition.md) | A frame key that is not a keyframe position, such as `middle`
|
|
41
|
-
| [invalid-keyframes-use](invalid-keyframes-use.md) | An animation applied with an argument that is not an options string
|
|
42
|
-
| [invalid-keyframes-variant](invalid-keyframes-variant.md) | A selector or container variant around a keyframes definition
|
|
43
|
-
| [invalid-media-query](invalid-media-query.md) | A condition in `style.media()` that is not a media query, such as `hover`
|
|
44
|
-
| [invalid-ref-input](invalid-ref-input.md) | A `style.ref()` label or ref method argument that is not a literal | deny |
|
|
45
|
-
| [invalid-rule-group-input](invalid-rule-group-input.md) | A `class` field or ref inside a variant key of `style()`
|
|
46
|
-
| [invalid-runtime-condition](invalid-runtime-condition.md) | A runtime CSS condition that Stillwind cannot compile
|
|
47
|
-
| [invalid-style-composition](invalid-style-composition.md) | Inline styles or custom properties in a base style, which do not carry over
|
|
48
|
-
| [invalid-style-input](invalid-style-input.md) | A `style()` argument that it cannot compile, such as a number
|
|
49
|
-
| [invalid-view-transition-definition](invalid-view-transition-definition.md) | An unknown field in a `style.viewTransition()` definition
|
|
50
|
-
| [invalid-view-transition-use](invalid-view-transition-use.md) | Extra or invalid arguments to `.for()`
|
|
51
|
-
| [invalid-view-transition-variant](invalid-view-transition-variant.md) | A state or container variant in a view transition definition
|
|
52
|
-
| [missing-document-target](missing-document-target.md) | A `style.css()` utility without a selector | deny |
|
|
53
|
-
| [runtime-condition-requires-css-if](runtime-condition-requires-css-if.md) | A runtime CSS condition that needs `useCssIf`
|
|
34
|
+
| Rule | Reports | Default |
|
|
35
|
+
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------- | ------- |
|
|
36
|
+
| [invalid-animation-option](invalid-animation-option.md) | A utility that is not an animation option, such as `p-4` | deny |
|
|
37
|
+
| [invalid-css-input](invalid-css-input.md) | A [`style.css()`](../macros/css.md) argument that is not a static utility | deny |
|
|
38
|
+
| [invalid-cva-config](invalid-cva-config.md) | An unknown or malformed field in a [`style.cva()`](../macros/cva.md) configuration | deny |
|
|
39
|
+
| [invalid-cva-input](invalid-cva-input.md) | `&&` or a ternary inside a `style.cva()` value | deny |
|
|
40
|
+
| [invalid-keyframes-definition](invalid-keyframes-definition.md) | A frame key that is not a keyframe position, such as `middle` | deny |
|
|
41
|
+
| [invalid-keyframes-use](invalid-keyframes-use.md) | An animation applied with an argument that is not an options string | deny |
|
|
42
|
+
| [invalid-keyframes-variant](invalid-keyframes-variant.md) | A selector or container variant around a keyframes definition | deny |
|
|
43
|
+
| [invalid-media-query](invalid-media-query.md) | A condition in [`style.media()`](../macros/media.md) that is not a media query, such as `hover` | deny |
|
|
44
|
+
| [invalid-ref-input](invalid-ref-input.md) | A [`style.ref()`](../macros/ref/index.md) label or ref method argument that is not a literal | deny |
|
|
45
|
+
| [invalid-rule-group-input](invalid-rule-group-input.md) | A `class` field or ref inside a variant key of [`style()`](../macros/style.md) | deny |
|
|
46
|
+
| [invalid-runtime-condition](invalid-runtime-condition.md) | A runtime CSS condition that Stillwind cannot compile | deny |
|
|
47
|
+
| [invalid-style-composition](invalid-style-composition.md) | Inline styles or custom properties in a base style, which do not carry over | deny |
|
|
48
|
+
| [invalid-style-input](invalid-style-input.md) | A [`style()`](../macros/style.md) argument that it cannot compile, such as a number | deny |
|
|
49
|
+
| [invalid-view-transition-definition](invalid-view-transition-definition.md) | An unknown field in a [`style.viewTransition()`](../macros/view-transition.md) definition | deny |
|
|
50
|
+
| [invalid-view-transition-use](invalid-view-transition-use.md) | Extra or invalid arguments to [`.for()`](../macros/view-transition.md) | deny |
|
|
51
|
+
| [invalid-view-transition-variant](invalid-view-transition-variant.md) | A state or container variant in a view transition definition | deny |
|
|
52
|
+
| [missing-document-target](missing-document-target.md) | A [`style.css()`](../macros/css.md) utility without a selector | deny |
|
|
53
|
+
| [runtime-condition-requires-css-if](runtime-condition-requires-css-if.md) | A runtime CSS condition that needs `useCssIf` | deny |
|
|
54
54
|
|
|
55
55
|
## Arguments and imports
|
|
56
56
|
|
|
57
|
-
| Rule | Reports
|
|
58
|
-
| ---------------------------------------------------------------------- |
|
|
59
|
-
| [mismatched-framework-import](mismatched-framework-import.md) | An import from the entrypoint of another framework
|
|
60
|
-
| [mutating-macro-argument](mutating-macro-argument.md) | A state update inside a `style()` argument | deny |
|
|
61
|
-
| [suspending-macro-argument](suspending-macro-argument.md) | `await`, `yield`, or `import()` inside a `style()` argument | deny |
|
|
57
|
+
| Rule | Reports | Default |
|
|
58
|
+
| ---------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------- |
|
|
59
|
+
| [mismatched-framework-import](mismatched-framework-import.md) | An import from the entrypoint of another framework | warn |
|
|
60
|
+
| [mutating-macro-argument](mutating-macro-argument.md) | A state update inside a [`style()`](../macros/style.md) argument | deny |
|
|
61
|
+
| [suspending-macro-argument](suspending-macro-argument.md) | `await`, `yield`, or `import()` inside a [`style()`](../macros/style.md) argument | deny |
|
|
62
62
|
|
|
63
63
|
## Conflicting or duplicated styles
|
|
64
64
|
|
|
@@ -73,19 +73,19 @@ report never matches.
|
|
|
73
73
|
|
|
74
74
|
## Styles that do not apply as written
|
|
75
75
|
|
|
76
|
-
| Rule | Reports
|
|
77
|
-
| ---------------------------------------------------------------------------- |
|
|
78
|
-
| [clamped-value](clamped-value.md) | A value outside the range that the browser uses, such as opacity above 1
|
|
79
|
-
| [document-scoped-selector](document-scoped-selector.md) | A selector that styles the whole document instead of the element
|
|
80
|
-
| [duplicate-view-transition-name](duplicate-view-transition-name.md) | Two `.for()` calls in one `style()` call
|
|
81
|
-
| [incompatible-property-value](incompatible-property-value.md) | A value that the browser rejects for the property
|
|
82
|
-
| [ineffective-anchor-scope](ineffective-anchor-scope.md) | An empty or repeated ref list in an anchor scope
|
|
83
|
-
| [missing-ref-attachment](missing-ref-attachment.md) | `asContainer()` or `asAnchor()` in a call that does not attach the ref
|
|
84
|
-
| [missing-view-transition-name](missing-view-transition-name.md) | A view transition applied without `.for()`
|
|
85
|
-
| [repeated-nesting-selector](repeated-nesting-selector.md) | A selector that repeats `&` to relate two elements
|
|
86
|
-
| [split-view-transition-class](split-view-transition-class.md) | View transitions split across separate `style()` calls
|
|
87
|
-
| [unmatched-host-selector](unmatched-host-selector.md) | A variant that tests a shadow host through the elements around it
|
|
88
|
-
| [unsatisfiable-variants](unsatisfiable-variants.md) | Variants that can never match together, such as `portrait:landscape:`
|
|
76
|
+
| Rule | Reports | Default |
|
|
77
|
+
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
78
|
+
| [clamped-value](clamped-value.md) | A value outside the range that the browser uses, such as opacity above 1 | warn |
|
|
79
|
+
| [document-scoped-selector](document-scoped-selector.md) | A selector that styles the whole document instead of the element | deny |
|
|
80
|
+
| [duplicate-view-transition-name](duplicate-view-transition-name.md) | Two [`.for()`](../macros/view-transition.md) calls in one [`style()`](../macros/style.md) call | warn |
|
|
81
|
+
| [incompatible-property-value](incompatible-property-value.md) | A value that the browser rejects for the property | deny |
|
|
82
|
+
| [ineffective-anchor-scope](ineffective-anchor-scope.md) | An empty or repeated ref list in an anchor scope | warn |
|
|
83
|
+
| [missing-ref-attachment](missing-ref-attachment.md) | [`asContainer()`](../macros/ref/as-container.md) or [`asAnchor()`](../macros/ref/as-anchor.md) in a call that does not attach the ref | warn |
|
|
84
|
+
| [missing-view-transition-name](missing-view-transition-name.md) | A view transition applied without [`.for()`](../macros/view-transition.md) | warn |
|
|
85
|
+
| [repeated-nesting-selector](repeated-nesting-selector.md) | A selector that repeats `&` to relate two elements | warn |
|
|
86
|
+
| [split-view-transition-class](split-view-transition-class.md) | View transitions split across separate [`style()`](../macros/style.md) calls | warn |
|
|
87
|
+
| [unmatched-host-selector](unmatched-host-selector.md) | A variant that tests a shadow host through the elements around it | warn |
|
|
88
|
+
| [unsatisfiable-variants](unsatisfiable-variants.md) | Variants that can never match together, such as `portrait:landscape:` | warn |
|
|
89
89
|
|
|
90
90
|
## Stylesheet definitions
|
|
91
91
|
|
|
@@ -6,7 +6,9 @@ description: "Reports an empty or repeated ref list in an anchor scope."
|
|
|
6
6
|
# ineffective-anchor-scope
|
|
7
7
|
|
|
8
8
|
This rule reports an anchor scope with an empty ref list, or with a ref listed
|
|
9
|
-
twice. An empty list sets no
|
|
9
|
+
twice. An empty list sets no
|
|
10
|
+
[`anchor-scope`](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/anchor-scope),
|
|
11
|
+
and a repeated ref adds nothing.
|
|
10
12
|
|
|
11
13
|
## Reported
|
|
12
14
|
|
|
@@ -33,7 +35,7 @@ Write the scope that you mean:
|
|
|
33
35
|
- Use `"all"` to limit every anchor name.
|
|
34
36
|
- Use `"none"` to set `anchor-scope: none`.
|
|
35
37
|
|
|
36
|
-
See [style.anchorScope()](../macros/anchor-scope.md#inputs).
|
|
38
|
+
See [`style.anchorScope()`](../macros/anchor-scope.md#inputs).
|
|
37
39
|
|
|
38
40
|
## Rule settings
|
|
39
41
|
|
|
@@ -30,11 +30,11 @@ style("p-4", fade(""));
|
|
|
30
30
|
|
|
31
31
|
## How to fix
|
|
32
32
|
|
|
33
|
-
- Move the utility out of the animation options and into the
|
|
34
|
-
in the example.
|
|
33
|
+
- Move the utility out of the animation options and into the
|
|
34
|
+
[`style()`](../macros/style.md) call, as in the example.
|
|
35
35
|
- Keep only animation options, such as `duration-300` or `both`, in the options.
|
|
36
36
|
|
|
37
|
-
See [style.keyframes()](../macros/keyframes.md#apply-the-animation).
|
|
37
|
+
See [`style.keyframes()`](../macros/keyframes.md#apply-the-animation).
|
|
38
38
|
|
|
39
39
|
## Rule settings
|
|
40
40
|
|
|
@@ -6,8 +6,15 @@ description: "Reports a malformed or unsupported Stillwind directive in your sty
|
|
|
6
6
|
# invalid-css-directive
|
|
7
7
|
|
|
8
8
|
This rule reports a Stillwind directive in your stylesheet that the compiler
|
|
9
|
-
cannot read, such as `@stillwind-slot`
|
|
10
|
-
skips the directive.
|
|
9
|
+
cannot read, such as [`@stillwind-slot`](../at-rules/stillwind-slot.md) with
|
|
10
|
+
an unknown slot name. The compiler skips the directive.
|
|
11
|
+
|
|
12
|
+
The rule also reports a statement that works only at the top level of a stylesheet
|
|
13
|
+
when you write it inside a style rule: a definition such as
|
|
14
|
+
[`@utility`](../at-rules/utility.md) or `@theme`, a Tailwind configuration statement
|
|
15
|
+
such as `@plugin`, or a `@layer` statement that lists layer names. The compiler
|
|
16
|
+
ignores the whole statement. `@variant`, `@apply`, `@stillwind-slot`, and
|
|
17
|
+
`@stillwind-require-properties` still work inside a style rule.
|
|
11
18
|
|
|
12
19
|
## Reported
|
|
13
20
|
|
|
@@ -29,6 +36,7 @@ skips the directive.
|
|
|
29
36
|
|
|
30
37
|
- Check the name and the arguments of the directive. For example, the slot for
|
|
31
38
|
generated utilities is `utilities`.
|
|
39
|
+
- Move a definition or a `@layer` statement out of the style rule to the top level.
|
|
32
40
|
- If you do not need the directive, remove it. `@import "stillwind"` already
|
|
33
41
|
places the slots that the default stylesheet needs.
|
|
34
42
|
|
|
@@ -9,6 +9,12 @@ This rule reports an `@import` in your stylesheet that the integration cannot
|
|
|
9
9
|
resolve, such as a misspelled package name or a missing file. The import adds
|
|
10
10
|
nothing.
|
|
11
11
|
|
|
12
|
+
The rule also reports an `@import` inside a style rule when the imported file, or a
|
|
13
|
+
file that it imports, contains a statement that works only at the top level, such
|
|
14
|
+
as `@theme`, `@utility`, `@stillwind-slot`, or a `@layer` statement. The compiler
|
|
15
|
+
leaves out the whole import. See
|
|
16
|
+
[Reset only part of the page](../concepts/stylesheets.md#reset-only-part-of-the-page).
|
|
17
|
+
|
|
12
18
|
## Reported
|
|
13
19
|
|
|
14
20
|
```css
|
|
@@ -31,6 +37,8 @@ nothing.
|
|
|
31
37
|
- Write a file path relative to the stylesheet that imports it, and check that
|
|
32
38
|
the file exists.
|
|
33
39
|
- For a package stylesheet, check that the package exports that path.
|
|
40
|
+
- Inside a style rule, import only plain CSS, such as `stillwind/preflight.css`.
|
|
41
|
+
Import other stylesheets at the top level.
|
|
34
42
|
|
|
35
43
|
## Rule settings
|
|
36
44
|
|
|
@@ -5,9 +5,10 @@ description: "Reports a style.css() argument that is not a utility known at buil
|
|
|
5
5
|
|
|
6
6
|
# invalid-css-input
|
|
7
7
|
|
|
8
|
-
This rule reports an argument of `style.css()` that the
|
|
9
|
-
CSS at build time, such as a number, a runtime
|
|
10
|
-
`style()` result. The
|
|
8
|
+
This rule reports an argument of [`style.css()`](../macros/css.md) that the
|
|
9
|
+
compiler cannot turn into CSS at build time, such as a number, a runtime
|
|
10
|
+
condition, a ref, or a stored [`style()`](../macros/style.md) result. The
|
|
11
|
+
argument adds nothing to the string.
|
|
11
12
|
|
|
12
13
|
## Reported
|
|
13
14
|
|
|
@@ -32,7 +33,7 @@ style.css("w-[42px]", { selector: ":host" });
|
|
|
32
33
|
- For a value that changes at runtime, set a custom property on the element with
|
|
33
34
|
JavaScript, and read it in a utility such as `w-(--width)`.
|
|
34
35
|
|
|
35
|
-
[style.css()](../macros/css.md#inputs) lists the accepted inputs.
|
|
36
|
+
[`style.css()`](../macros/css.md#inputs) lists the accepted inputs.
|
|
36
37
|
|
|
37
38
|
## Rule settings
|
|
38
39
|
|
|
@@ -13,17 +13,29 @@ part.
|
|
|
13
13
|
## Reported
|
|
14
14
|
|
|
15
15
|
```tsx
|
|
16
|
-
style.cva("p-4", {
|
|
16
|
+
style.cva("p-4", {
|
|
17
|
+
variant: {
|
|
18
|
+
size: {
|
|
19
|
+
small: "p-2",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
17
23
|
```
|
|
18
24
|
|
|
19
25
|
> invalid-cva-config: invalid style.cva() configuration: unknown configuration property
|
|
20
26
|
>
|
|
21
|
-
> Example:
|
|
27
|
+
> Example:2:12
|
|
22
28
|
|
|
23
29
|
## Fixed
|
|
24
30
|
|
|
25
31
|
```tsx
|
|
26
|
-
style.cva("p-4", {
|
|
32
|
+
style.cva("p-4", {
|
|
33
|
+
variants: {
|
|
34
|
+
size: {
|
|
35
|
+
small: "p-2",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
27
39
|
```
|
|
28
40
|
|
|
29
41
|
## How to fix
|
|
@@ -33,7 +45,7 @@ style.cva("p-4", { variants: { size: { small: "p-2" } } });
|
|
|
33
45
|
- In `defaultVariants` and `compoundVariants`, use only options and values that
|
|
34
46
|
`variants` declares.
|
|
35
47
|
|
|
36
|
-
See [style.cva()](../macros/cva.md#configuration).
|
|
48
|
+
See [`style.cva()`](../macros/cva.md#configuration).
|
|
37
49
|
|
|
38
50
|
## Rule settings
|
|
39
51
|
|
|
@@ -6,8 +6,8 @@ description: "Reports && or a ternary inside a style.cva() value."
|
|
|
6
6
|
# invalid-cva-input
|
|
7
7
|
|
|
8
8
|
This rule reports a runtime condition, such as `&&` or a ternary, inside the base
|
|
9
|
-
or an option value of `style.cva()
|
|
10
|
-
creates the factory, so the condition cannot choose a style.
|
|
9
|
+
or an option value of [`style.cva()`](../macros/cva.md). The compiler generates
|
|
10
|
+
every value when it creates the factory, so the condition cannot choose a style.
|
|
11
11
|
|
|
12
12
|
## Reported
|
|
13
13
|
|
|
@@ -25,7 +25,12 @@ style.cva(active && "bg-blue-500");
|
|
|
25
25
|
```tsx
|
|
26
26
|
declare const active: boolean;
|
|
27
27
|
const button = style.cva("", {
|
|
28
|
-
variants: {
|
|
28
|
+
variants: {
|
|
29
|
+
active: {
|
|
30
|
+
true: "bg-blue-500",
|
|
31
|
+
false: null,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
29
34
|
});
|
|
30
35
|
button({ active });
|
|
31
36
|
```
|
|
@@ -34,10 +39,10 @@ button({ active });
|
|
|
34
39
|
|
|
35
40
|
- Turn the condition into an option, and pass the current value when you call the
|
|
36
41
|
factory, as in the example.
|
|
37
|
-
- Stored `style()` results, refs, animations, and `class`
|
|
38
|
-
either. Use them in `style()` instead.
|
|
42
|
+
- Stored [`style()`](../macros/style.md) results, refs, animations, and `class`
|
|
43
|
+
fields are not accepted either. Use them in `style()` instead.
|
|
39
44
|
|
|
40
|
-
See [style.cva()](../macros/cva.md#style-values).
|
|
45
|
+
See [`style.cva()`](../macros/cva.md#style-values).
|
|
41
46
|
|
|
42
47
|
## Rule settings
|
|
43
48
|
|
|
@@ -34,7 +34,7 @@ style(fade("duration-300"));
|
|
|
34
34
|
condition, add a whole definition under a variant key.
|
|
35
35
|
- Write the definition as an object literal, as the initial value of a variable.
|
|
36
36
|
|
|
37
|
-
See [style.keyframes()](../macros/keyframes.md#define-the-frames).
|
|
37
|
+
See [`style.keyframes()`](../macros/keyframes.md#define-the-frames).
|
|
38
38
|
|
|
39
39
|
## Rule settings
|
|
40
40
|
|
|
@@ -6,36 +6,44 @@ description: "Reports a state or container variant around a style.keyframes() de
|
|
|
6
6
|
# invalid-keyframes-variant
|
|
7
7
|
|
|
8
8
|
This rule reports a state or container variant, such as `hover:`, around a
|
|
9
|
-
definition inside `style.keyframes()
|
|
10
|
-
element, so it cannot be hovered. Only media and
|
|
11
|
-
a definition.
|
|
9
|
+
definition inside [`style.keyframes()`](../macros/keyframes.md). A keyframes
|
|
10
|
+
definition belongs to no element, so it cannot be hovered. Only media and
|
|
11
|
+
`supports-*` variants can choose a definition.
|
|
12
12
|
|
|
13
13
|
## Reported
|
|
14
14
|
|
|
15
15
|
```tsx
|
|
16
|
-
const fade = style.keyframes({
|
|
16
|
+
const fade = style.keyframes({
|
|
17
|
+
"hover:": {
|
|
18
|
+
to: "opacity-100",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
17
21
|
style(fade("duration-300"));
|
|
18
22
|
```
|
|
19
23
|
|
|
20
24
|
> invalid-keyframes-variant: keyframes definition variants must be media or supports conditions; container queries do not condition global keyframes
|
|
21
25
|
>
|
|
22
|
-
> Example:
|
|
26
|
+
> Example:2:4
|
|
23
27
|
|
|
24
28
|
## Fixed
|
|
25
29
|
|
|
26
30
|
```tsx
|
|
27
|
-
const fade = style.keyframes({
|
|
28
|
-
|
|
31
|
+
const fade = style.keyframes({
|
|
32
|
+
to: "opacity-100",
|
|
33
|
+
});
|
|
34
|
+
style({
|
|
35
|
+
"hover:": fade("duration-300"),
|
|
36
|
+
});
|
|
29
37
|
```
|
|
30
38
|
|
|
31
39
|
## How to fix
|
|
32
40
|
|
|
33
41
|
- To animate an element while it is in a state, put the variant around the
|
|
34
|
-
animation in `style()
|
|
42
|
+
animation in [`style()`](../macros/style.md), as in the example.
|
|
35
43
|
- To use a different animation for a media condition, such as reduced motion,
|
|
36
44
|
keep the variant in the definition: `"motion-reduce:": { ... }`.
|
|
37
45
|
|
|
38
|
-
See [style.keyframes()](../macros/keyframes.md#define-the-frames).
|
|
46
|
+
See [`style.keyframes()`](../macros/keyframes.md#define-the-frames).
|
|
39
47
|
|
|
40
48
|
## Rule settings
|
|
41
49
|
|
|
@@ -31,7 +31,7 @@ const child = style("group-hover:underline");
|
|
|
31
31
|
- Add the marker without a variant, and put the condition on the utilities of the
|
|
32
32
|
element that reacts, such as `group-hover:underline`.
|
|
33
33
|
- To connect elements with names that TypeScript checks, use
|
|
34
|
-
[style.ref()](../macros/ref/index.md) instead of `group` and `peer`.
|
|
34
|
+
[`style.ref()`](../macros/ref/index.md) instead of `group` and `peer`.
|
|
35
35
|
|
|
36
36
|
## Options
|
|
37
37
|
|
|
@@ -5,10 +5,11 @@ description: "Reports a condition in style.media() that is not a media query, su
|
|
|
5
5
|
|
|
6
6
|
# invalid-media-query
|
|
7
7
|
|
|
8
|
-
This rule reports an argument of `style.media()` that is not a
|
|
9
|
-
`hover:` matches a hovered element, not a property of the device, so
|
|
10
|
-
become a query for
|
|
11
|
-
|
|
8
|
+
This rule reports an argument of [`style.media()`](../macros/media.md) that is not a
|
|
9
|
+
media condition. `hover:` matches a hovered element, not a property of the device, so
|
|
10
|
+
it cannot become a query for
|
|
11
|
+
[`matchMedia()`](https://developer.mozilla.org/docs/Web/API/Window/matchMedia).
|
|
12
|
+
The argument is left out, and when no argument remains, the query is `not all`.
|
|
12
13
|
|
|
13
14
|
## Reported
|
|
14
15
|
|
|
@@ -34,12 +35,13 @@ style.media("can-hover");
|
|
|
34
35
|
|
|
35
36
|
- To check whether an input device can hover, define a media variant for that
|
|
36
37
|
capability, as in the example.
|
|
37
|
-
- To style an element while it is hovered, use `hover:` inside
|
|
38
|
+
- To style an element while it is hovered, use `hover:` inside
|
|
39
|
+
[`style()`](../macros/style.md).
|
|
38
40
|
- To check the viewport or user preferences, use media variants such as `md` or
|
|
39
41
|
`motion-safe`.
|
|
40
42
|
- `supports-*` and container queries are not media conditions either.
|
|
41
43
|
|
|
42
|
-
See [style.media()](../macros/media.md#inputs).
|
|
44
|
+
See [`style.media()`](../macros/media.md#inputs).
|
|
43
45
|
|
|
44
46
|
## Rule settings
|
|
45
47
|
|
|
@@ -5,9 +5,9 @@ description: "Reports a style.ref() label or ref method argument that is not a l
|
|
|
5
5
|
|
|
6
6
|
# invalid-ref-input
|
|
7
7
|
|
|
8
|
-
This rule reports a `style.ref()` label or a ref method
|
|
9
|
-
literal. The compiler reads these values at build time,
|
|
10
|
-
cannot name a ref or configure a method.
|
|
8
|
+
This rule reports a [`style.ref()`](../macros/ref/index.md) label or a ref method
|
|
9
|
+
argument that is not a literal. The compiler reads these values at build time,
|
|
10
|
+
so a value from a variable cannot name a ref or configure a method.
|
|
11
11
|
|
|
12
12
|
## Reported
|
|
13
13
|
|
|
@@ -34,9 +34,10 @@ style(card);
|
|
|
34
34
|
- If you need a different ref for each case, declare one ref for each case and
|
|
35
35
|
choose between the refs at runtime. Each `style.ref()` call already creates a
|
|
36
36
|
separate name, so the label does not need to differ.
|
|
37
|
-
- Write method arguments, such as the type of
|
|
37
|
+
- Write method arguments, such as the type of
|
|
38
|
+
[`asContainer()`](../macros/ref/as-container.md), as literals.
|
|
38
39
|
|
|
39
|
-
See [style.ref()](../macros/ref/index.md).
|
|
40
|
+
See [`style.ref()`](../macros/ref/index.md).
|
|
40
41
|
|
|
41
42
|
## Rule settings
|
|
42
43
|
|
|
@@ -5,9 +5,10 @@ description: "Reports a class field, custom property, or ref inside an object wi
|
|
|
5
5
|
|
|
6
6
|
# invalid-rule-group-input
|
|
7
7
|
|
|
8
|
-
This rule reports a `class` field, a custom property, a ref, or a stored
|
|
9
|
-
result inside an object with variant keys,
|
|
10
|
-
can only condition utilities, so the
|
|
8
|
+
This rule reports a `class` field, a custom property, a ref, or a stored
|
|
9
|
+
[`style()`](../macros/style.md) result inside an object with variant keys,
|
|
10
|
+
such as `{ "hover:": ... }`. A variant can only condition utilities, so the
|
|
11
|
+
input is left out.
|
|
11
12
|
|
|
12
13
|
## Reported
|
|
13
14
|
|
|
@@ -18,12 +19,16 @@ can only condition utilities, so the input is left out.
|
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
```tsx
|
|
21
|
-
style({
|
|
22
|
+
style({
|
|
23
|
+
"hover:": {
|
|
24
|
+
class: "external",
|
|
25
|
+
},
|
|
26
|
+
});
|
|
22
27
|
```
|
|
23
28
|
|
|
24
29
|
> invalid-rule-group-input: style() rule groups cannot contain external class value
|
|
25
30
|
>
|
|
26
|
-
> Example:
|
|
31
|
+
> Example:3:12
|
|
27
32
|
|
|
28
33
|
## Fixed
|
|
29
34
|
|
|
@@ -34,7 +39,9 @@ style({ "hover:": { class: "external" } });
|
|
|
34
39
|
```
|
|
35
40
|
|
|
36
41
|
```tsx
|
|
37
|
-
style({
|
|
42
|
+
style({
|
|
43
|
+
class: "external",
|
|
44
|
+
});
|
|
38
45
|
```
|
|
39
46
|
|
|
40
47
|
## How to fix
|
|
@@ -34,7 +34,7 @@ style("w-[42px]");
|
|
|
34
34
|
utility, such as `w-(--width)`.
|
|
35
35
|
- Store a `style()` result in a variable before you pass it to another call.
|
|
36
36
|
|
|
37
|
-
[style()](../macros/style.md#inputs) lists the accepted inputs.
|
|
37
|
+
[`style()`](../macros/style.md#inputs) lists the accepted inputs.
|
|
38
38
|
|
|
39
39
|
## Rule settings
|
|
40
40
|
|
|
@@ -35,8 +35,8 @@ contains it produces no CSS.
|
|
|
35
35
|
|
|
36
36
|
## How to fix
|
|
37
37
|
|
|
38
|
-
- Define the token in `@theme
|
|
39
|
-
name.
|
|
38
|
+
- Define the token in [`@theme`](../at-rules/theme.md), as in the example, or
|
|
39
|
+
correct the spelling of its name.
|
|
40
40
|
- If the token is optional, add a fallback: `--theme(--color-brand, blue)`.
|
|
41
41
|
|
|
42
42
|
Malformed `--theme()` syntax causes [SW14007](../errors/SW14007.md) instead.
|
|
@@ -33,7 +33,7 @@ style(transition.for("card"));
|
|
|
33
33
|
before the update, and `new` styles the snapshot after it.
|
|
34
34
|
- Write each field as a utility string literal.
|
|
35
35
|
|
|
36
|
-
See [style.viewTransition()](../macros/view-transition.md#define-the-snapshot-styles).
|
|
36
|
+
See [`style.viewTransition()`](../macros/view-transition.md#define-the-snapshot-styles).
|
|
37
37
|
|
|
38
38
|
## Rule settings
|
|
39
39
|
|
|
@@ -33,7 +33,7 @@ const second = style(transition.for("b"));
|
|
|
33
33
|
- Give each element its own `.for()` call with its own key, as in the example.
|
|
34
34
|
- Use a string or a number as the key, such as the ID of the item.
|
|
35
35
|
|
|
36
|
-
See [style.viewTransition()](../macros/view-transition.md#name-the-element).
|
|
36
|
+
See [`style.viewTransition()`](../macros/view-transition.md#name-the-element).
|
|
37
37
|
|
|
38
38
|
## Rule settings
|
|
39
39
|
|
|
@@ -6,9 +6,9 @@ description: "Reports a state or container variant in a style.viewTransition() d
|
|
|
6
6
|
# invalid-view-transition-variant
|
|
7
7
|
|
|
8
8
|
This rule reports a state or container variant, such as `hover:`, in a
|
|
9
|
-
`style.viewTransition()` definition. The
|
|
10
|
-
the element itself, so they cannot be
|
|
11
|
-
variants can condition a snapshot style.
|
|
9
|
+
[`style.viewTransition()`](../macros/view-transition.md) definition. The
|
|
10
|
+
snapshots are images of the page, not the element itself, so they cannot be
|
|
11
|
+
hovered. Only media and `supports-*` variants can condition a snapshot style.
|
|
12
12
|
|
|
13
13
|
## Reported
|
|
14
14
|
|
|
@@ -5,10 +5,10 @@ description: "Reports an import of style() from the entrypoint of another framew
|
|
|
5
5
|
|
|
6
6
|
# mismatched-framework-import
|
|
7
7
|
|
|
8
|
-
This rule reports a file that imports `style()` from the
|
|
9
|
-
framework, such as `stillwind/astro` in a React component.
|
|
10
|
-
selects a class key and style representation. Entrypoints with
|
|
11
|
-
format are compatible.
|
|
8
|
+
This rule reports a file that imports [`style()`](../macros/style.md) from the
|
|
9
|
+
entrypoint of another framework, such as `stillwind/astro` in a React component.
|
|
10
|
+
Each entrypoint selects a class key and style representation. Entrypoints with
|
|
11
|
+
the same output format are compatible.
|
|
12
12
|
|
|
13
13
|
## Reported
|
|
14
14
|
|
|
@@ -31,7 +31,7 @@ style.css("p-4", { selector: ":host" });
|
|
|
31
31
|
- Add a `selector` option, such as `:host` for the shadow host.
|
|
32
32
|
- Or use a variant that sets its own selector, such as `host:p-4`.
|
|
33
33
|
|
|
34
|
-
See [style.css()](../macros/css.md#inputs).
|
|
34
|
+
See [`style.css()`](../macros/css.md#inputs).
|
|
35
35
|
|
|
36
36
|
## Rule settings
|
|
37
37
|
|