stillwind 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +193 -0
- package/css/builtin-variants/sw-conditional.css +10 -1
- package/css/builtin-variants/tw-relationship.css +4 -4
- package/css/builtins.css +1 -1
- package/dist/{class-object-D7ZGJOf_.d.ts → class-object-BaK8uudd.d.ts} +2 -2
- package/dist/class-object-DNcjzcfH.js +6 -0
- package/dist/{class-object-D24FFYqO.js.map → class-object-DNcjzcfH.js.map} +1 -1
- package/dist/{class-string-CQHnc9GN.d.ts → class-string-C5YFtXQn.d.ts} +2 -2
- package/dist/class-string-KnYInbiw.js +6 -0
- package/dist/{class-string-Db8-oI4q.js.map → class-string-KnYInbiw.js.map} +1 -1
- package/dist/{cva-BwX07CFw.js → formats-Ctf2WFc-.js} +87 -2
- package/dist/formats-Ctf2WFc-.js.map +1 -0
- package/dist/formats-aeLCNAXl.d.ts +73 -0
- package/dist/frameworks/alpine.d.ts +3 -3
- package/dist/frameworks/alpine.js +1 -1
- package/dist/frameworks/alpine.js.map +1 -1
- package/dist/frameworks/astro.d.ts +3 -3
- package/dist/frameworks/astro.js +1 -1
- package/dist/frameworks/lit.d.ts +3 -3
- package/dist/frameworks/lit.js +1 -1
- package/dist/frameworks/lit.js.map +1 -1
- package/dist/frameworks/preact.d.ts +3 -3
- package/dist/frameworks/preact.js +1 -1
- package/dist/frameworks/qwik.d.ts +3 -3
- package/dist/frameworks/qwik.js +1 -1
- package/dist/frameworks/react.d.ts +2 -2
- package/dist/frameworks/react.js +1 -1
- package/dist/frameworks/solid.d.ts +3 -3
- package/dist/frameworks/solid.js +1 -1
- package/dist/frameworks/svelte.d.ts +3 -3
- package/dist/frameworks/svelte.js +1 -1
- package/dist/frameworks/vanilla.d.ts +3 -3
- package/dist/frameworks/vanilla.js +1 -1
- package/dist/frameworks/vue.d.ts +3 -3
- package/dist/frameworks/vue.js +1 -1
- package/dist/{index-RwVFpxhE.d.ts → index-DBpgaaD7.d.ts} +54 -5
- package/dist/macro/index.d.ts +2 -2
- package/dist/macro/index.js +1 -1
- package/dist/runtime/development.d.ts +47 -0
- package/dist/{development-J-JCSIm0.js → runtime/development.js} +41 -5
- package/dist/runtime/development.js.map +1 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +1 -0
- package/dist/{style-fTQbsVWZ.js → style-BE8vuLiO.js} +4 -1
- package/dist/style-BE8vuLiO.js.map +1 -0
- package/docs/at-rules/apply.md +5 -5
- package/docs/at-rules/custom-variant.md +12 -12
- package/docs/at-rules/index.md +19 -19
- package/docs/at-rules/plugin.md +7 -7
- package/docs/at-rules/registry-directives.md +9 -9
- package/docs/at-rules/slot.md +6 -6
- package/docs/at-rules/stillwind-css-template.md +7 -7
- package/docs/at-rules/stillwind-property.md +10 -10
- package/docs/at-rules/stillwind-registry.md +18 -18
- package/docs/at-rules/stillwind-require-properties.md +9 -9
- package/docs/at-rules/stillwind-slot.md +6 -6
- package/docs/at-rules/stillwind-undef-arbitrary-property.md +9 -9
- package/docs/at-rules/stillwind-undef-utility.md +10 -10
- package/docs/at-rules/stillwind-undef-variant.md +6 -6
- package/docs/at-rules/theme.md +23 -23
- package/docs/at-rules/utility.md +30 -30
- package/docs/at-rules/variant.md +6 -6
- package/docs/cli.md +11 -8
- package/docs/concepts/css-ordering.md +19 -19
- package/docs/concepts/how-styles-compile.md +17 -17
- package/docs/concepts/stylesheets.md +4 -4
- package/docs/configuration.md +34 -34
- package/docs/editors.md +9 -8
- package/docs/errors/SW01003.md +1 -1
- package/docs/errors/SW10001.md +1 -1
- package/docs/errors/SW10002.md +1 -1
- package/docs/errors/SW10004.md +7 -6
- package/docs/errors/SW10005.md +1 -1
- package/docs/errors/SW11001.md +1 -1
- package/docs/errors/SW11003.md +1 -1
- package/docs/errors/SW12001.md +2 -2
- package/docs/errors/SW12002.md +1 -1
- package/docs/errors/SW13001.md +1 -1
- package/docs/errors/SW13003.md +2 -2
- package/docs/errors/SW14001.md +1 -1
- package/docs/errors/SW14003.md +4 -4
- package/docs/errors/SW14004.md +2 -2
- package/docs/errors/SW14005.md +1 -1
- package/docs/errors/SW14006.md +1 -1
- package/docs/errors/SW14007.md +2 -2
- package/docs/errors/SW14008.md +1 -1
- package/docs/errors/SW30001.md +1 -1
- package/docs/errors/SW31001.md +1 -1
- package/docs/errors/SW31004.md +1 -1
- package/docs/errors/SW33005.md +1 -1
- package/docs/errors/SW34002.md +1 -1
- package/docs/errors/SW90001.md +1 -1
- package/docs/errors/SW90005.md +1 -1
- package/docs/errors/SW90006.md +1 -1
- package/docs/errors/index.md +72 -72
- package/docs/formatters.md +5 -5
- package/docs/guides/animations.md +7 -8
- package/docs/guides/design-systems.md +7 -7
- package/docs/guides/element-relationships.md +15 -19
- package/docs/guides/lint-adoption.md +5 -5
- package/docs/guides/migrating-from-css.md +11 -11
- package/docs/guides/migrating-from-tailwind.md +16 -16
- package/docs/guides/recommended-practices.md +18 -18
- package/docs/guides/responsive-styles.md +7 -7
- package/docs/guides/reusable-styles.md +10 -5
- package/docs/guides/runtime-conditions.md +6 -6
- package/docs/guides/style.md +42 -10
- package/docs/guides/tailwind-compatibility.md +23 -22
- package/docs/guides/view-transitions.md +9 -11
- package/docs/guides/web-components.md +4 -4
- package/docs/index.md +14 -12
- package/docs/integrations.md +3 -3
- package/docs/lints/ambiguous-style-base-order.md +4 -2
- package/docs/lints/bypassed-undefinition.md +3 -3
- package/docs/lints/clamped-value.md +1 -1
- package/docs/lints/conflicting-provider-properties.md +2 -2
- package/docs/lints/conflicting-utilities.md +45 -3
- package/docs/lints/document-scoped-selector.md +1 -1
- package/docs/lints/duplicate-definition.md +3 -3
- package/docs/lints/duplicate-utility.md +2 -2
- package/docs/lints/duplicate-view-transition-name.md +3 -3
- package/docs/lints/ignored-definition-condition.md +2 -2
- package/docs/lints/ignored-tailwind-feature.md +3 -3
- package/docs/lints/implicit-nesting-selector.md +2 -2
- package/docs/lints/incompatible-property-value.md +3 -3
- package/docs/lints/incompatible-theme-value.md +1 -1
- package/docs/lints/index.md +74 -73
- package/docs/lints/ineffective-anchor-scope.md +2 -2
- package/docs/lints/interfering-imported-style-base.md +22 -4
- package/docs/lints/invalid-animation-option.md +3 -3
- package/docs/lints/invalid-css-directive.md +3 -3
- package/docs/lints/invalid-css-import.md +2 -2
- package/docs/lints/invalid-css-input.md +4 -4
- package/docs/lints/invalid-cva-config.md +2 -2
- package/docs/lints/invalid-cva-input.md +4 -4
- package/docs/lints/invalid-keyframes-definition.md +2 -2
- package/docs/lints/invalid-keyframes-use.md +2 -2
- package/docs/lints/invalid-keyframes-variant.md +4 -4
- package/docs/lints/invalid-lint-suppression.md +3 -3
- package/docs/lints/invalid-marker-use.md +2 -2
- package/docs/lints/invalid-media-query.md +4 -4
- package/docs/lints/invalid-ref-input.md +4 -4
- package/docs/lints/invalid-rule-group-input.md +2 -2
- package/docs/lints/invalid-runtime-condition.md +3 -3
- package/docs/lints/invalid-stored-variant.md +52 -0
- package/docs/lints/invalid-style-composition.md +2 -2
- package/docs/lints/invalid-style-input.md +2 -2
- package/docs/lints/invalid-theme-reference.md +3 -3
- package/docs/lints/invalid-utility.md +3 -3
- package/docs/lints/invalid-variant.md +2 -2
- package/docs/lints/invalid-view-transition-definition.md +2 -2
- package/docs/lints/invalid-view-transition-use.md +2 -2
- package/docs/lints/invalid-view-transition-variant.md +3 -3
- package/docs/lints/mismatched-framework-import.md +3 -3
- package/docs/lints/missing-document-target.md +2 -2
- package/docs/lints/missing-ref-attachment.md +4 -4
- package/docs/lints/missing-view-transition-name.md +3 -3
- package/docs/lints/mutating-macro-argument.md +2 -2
- package/docs/lints/no-arbitrary-breakpoints.md +2 -2
- package/docs/lints/no-arbitrary-colors.md +2 -2
- package/docs/lints/no-arbitrary-spacing.md +1 -1
- package/docs/lints/no-class-property.md +3 -3
- package/docs/lints/no-important.md +2 -2
- package/docs/lints/no-restricted-declarations.md +1 -1
- package/docs/lints/no-restricted-length-units.md +1 -1
- package/docs/lints/no-restricted-theme-tokens.md +1 -1
- package/docs/lints/no-restricted-utilities.md +2 -2
- package/docs/lints/prefer-canonical-utilities.md +2 -2
- package/docs/lints/prefer-direct-styling.md +3 -3
- package/docs/lints/prefer-logical-properties.md +3 -3
- package/docs/lints/prefer-sorted-utilities.md +2 -2
- package/docs/lints/prefer-typed-relationships.md +3 -3
- package/docs/lints/prefer-typed-variables.md +1 -1
- package/docs/lints/prefer-variant-directive.md +3 -3
- package/docs/lints/redundant-variant.md +2 -2
- package/docs/lints/repeated-nesting-selector.md +2 -2
- package/docs/lints/runtime-condition-requires-css-if.md +3 -3
- package/docs/lints/split-view-transition-class.md +3 -3
- package/docs/lints/suspending-macro-argument.md +2 -2
- package/docs/lints/unknown-utility.md +4 -4
- package/docs/lints/unknown-variant.md +2 -2
- package/docs/lints/unmatched-host-selector.md +2 -2
- package/docs/lints/unsatisfiable-variants.md +1 -1
- package/docs/lints/unused-lint-suppression.md +1 -1
- package/docs/lints/unverified-style-base.md +2 -2
- package/docs/macros/anchor-scope.md +13 -13
- package/docs/macros/css.md +7 -7
- package/docs/macros/cva.md +17 -16
- package/docs/macros/index.md +10 -9
- package/docs/macros/keyframes.md +9 -9
- package/docs/macros/media.md +2 -2
- package/docs/macros/ref/as-anchor.md +11 -11
- package/docs/macros/ref/as-container.md +8 -8
- package/docs/macros/ref/at.md +10 -10
- package/docs/macros/ref/condition.md +9 -8
- package/docs/macros/ref/in.md +11 -11
- package/docs/macros/ref/index.md +17 -16
- package/docs/macros/ref/position-anchor.md +9 -9
- package/docs/macros/style.md +53 -27
- package/docs/macros/view-transition.md +17 -17
- package/docs/macros/when.md +129 -0
- package/docs/plugins/iconify.md +5 -5
- package/docs/plugins/index.md +4 -4
- package/docs/utilities-and-variants.md +6 -6
- package/docs/why.md +13 -15
- package/package.json +14 -28
- package/dist/class-object-D24FFYqO.js +0 -6
- package/dist/class-string-Db8-oI4q.js +0 -6
- package/dist/cva-BwX07CFw.js.map +0 -1
- package/dist/cva-DSpDNBYi.d.ts +0 -9
- package/dist/development-DttPQc71.d.ts +0 -27
- package/dist/development-J-JCSIm0.js.map +0 -1
- package/dist/runtime/class-name-object-development.d.ts +0 -10
- package/dist/runtime/class-name-object-development.js +0 -18
- package/dist/runtime/class-name-object-development.js.map +0 -1
- package/dist/runtime/class-name-object.d.ts +0 -16
- package/dist/runtime/class-name-object.js +0 -31
- package/dist/runtime/class-name-object.js.map +0 -1
- package/dist/runtime/class-object-development.d.ts +0 -10
- package/dist/runtime/class-object-development.js +0 -18
- package/dist/runtime/class-object-development.js.map +0 -1
- package/dist/runtime/class-object.d.ts +0 -16
- package/dist/runtime/class-object.js +0 -31
- package/dist/runtime/class-object.js.map +0 -1
- package/dist/runtime/class-string-development.d.ts +0 -10
- package/dist/runtime/class-string-development.js +0 -18
- package/dist/runtime/class-string-development.js.map +0 -1
- package/dist/runtime/class-string.d.ts +0 -16
- package/dist/runtime/class-string.js +0 -31
- package/dist/runtime/class-string.js.map +0 -1
- package/dist/shared-B9IQXU6P.d.ts +0 -32
- package/dist/style-fTQbsVWZ.js.map +0 -1
|
@@ -5,7 +5,7 @@ description: "Reports two independent base styles in one call that set the same
|
|
|
5
5
|
|
|
6
6
|
# ambiguous-style-base-order
|
|
7
7
|
|
|
8
|
-
This rule reports a [`style()`](
|
|
8
|
+
This rule reports a [`style()`](https://stillwind.dev/docs/macros/style) call with two base styles
|
|
9
9
|
that set the same property, when neither base is built on the other. The order
|
|
10
10
|
of the arguments does not decide which base wins, so the result is not defined.
|
|
11
11
|
|
|
@@ -20,6 +20,8 @@ export const props = style(first, second);
|
|
|
20
20
|
> ambiguous-style-base-order: two composition bases declare `padding`; neither base precedes the other, so which declaration wins is undefined
|
|
21
21
|
>
|
|
22
22
|
> Example:3:22
|
|
23
|
+
>
|
|
24
|
+
> reordering the style() arguments does not change which declaration wins
|
|
23
25
|
|
|
24
26
|
## Fixed
|
|
25
27
|
|
|
@@ -45,6 +47,6 @@ Bases that set different properties do not need this.
|
|
|
45
47
|
| `strict` | deny |
|
|
46
48
|
| `stylistic` | off |
|
|
47
49
|
|
|
48
|
-
[Configure lint](
|
|
50
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
49
51
|
|
|
50
52
|
The CLI and the editor report this rule only when they analyze the whole project.
|
|
@@ -5,7 +5,7 @@ description: "Reports a top-level utility definition that also applies where the
|
|
|
5
5
|
|
|
6
6
|
# bypassed-undefinition
|
|
7
7
|
|
|
8
|
-
This rule reports a top-level [`@utility`](
|
|
8
|
+
This rule reports a top-level [`@utility`](https://stillwind.dev/docs/at-rules/utility) that also applies
|
|
9
9
|
where Stillwind removes the utility on purpose. Inside animation options, for example,
|
|
10
10
|
`duration-*` sets `animation-duration`, and the built-in definitions remove the
|
|
11
11
|
`transition-duration` meaning there. A top-level `duration-slow` would bring that
|
|
@@ -36,7 +36,7 @@ meaning back.
|
|
|
36
36
|
## How to fix
|
|
37
37
|
|
|
38
38
|
Define the utility inside `@stillwind-registry default`, as in the example. Then
|
|
39
|
-
it applies in ordinary [`style()`](
|
|
39
|
+
it applies in ordinary [`style()`](https://stillwind.dev/docs/macros/style) calls, and animation options
|
|
40
40
|
keep their own meaning of `duration-*`.
|
|
41
41
|
|
|
42
42
|
## Rule settings
|
|
@@ -47,4 +47,4 @@ keep their own meaning of `duration-*`.
|
|
|
47
47
|
| `strict` | deny |
|
|
48
48
|
| `stylistic` | off |
|
|
49
49
|
|
|
50
|
-
[Configure lint](
|
|
50
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -41,4 +41,4 @@ custom property receives at runtime.
|
|
|
41
41
|
| `strict` | deny |
|
|
42
42
|
| `stylistic` | off |
|
|
43
43
|
|
|
44
|
-
[Configure lint](
|
|
44
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -6,7 +6,7 @@ description: "Reports a container or anchor property that a ref method and a uti
|
|
|
6
6
|
# conflicting-provider-properties
|
|
7
7
|
|
|
8
8
|
This rule reports a container or anchor property that a ref method, such as
|
|
9
|
-
[`asContainer()`](
|
|
9
|
+
[`asContainer()`](https://stillwind.dev/docs/macros/ref/as-container), and another utility both set
|
|
10
10
|
on the same element. For example, `asContainer("size")` sets
|
|
11
11
|
`container-type: size`, and `@container` sets it to `inline-size`. Only one
|
|
12
12
|
value takes effect, and the code does not show which.
|
|
@@ -45,4 +45,4 @@ style(card, card.asContainer("size"));
|
|
|
45
45
|
| `strict` | deny |
|
|
46
46
|
| `stylistic` | off |
|
|
47
47
|
|
|
48
|
-
[Configure lint](
|
|
48
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -33,23 +33,65 @@ style("p-4");
|
|
|
33
33
|
- If the values belong to different states or widths, add a variant to one of
|
|
34
34
|
them, such as `p-2 md:p-4`.
|
|
35
35
|
- If one utility overrides a shared style, pass the shared style as a base. See
|
|
36
|
-
[Override a style](
|
|
36
|
+
[Override a style](https://stillwind.dev/docs/guides/style#override-a-style).
|
|
37
|
+
- If a physical utility such as `ml-4` meets a logical utility such as `mx-auto`,
|
|
38
|
+
use logical utilities for both or physical utilities for both. The writing mode
|
|
39
|
+
decides how physical and logical properties overlap.
|
|
40
|
+
|
|
41
|
+
Some pairs do not conflict because one utility reads a custom property that the
|
|
42
|
+
other utility sets to the value it writes, so the order does not change the result:
|
|
43
|
+
|
|
44
|
+
- A side utility, such as `border-t` or `divide-y`, and a style utility, such as
|
|
45
|
+
`border-dashed` or `divide-dashed`
|
|
46
|
+
- A font size utility, such as `text-sm`, and a `leading-*` utility
|
|
47
|
+
|
|
48
|
+
A physical utility and a logical utility conflict only when they set the same
|
|
49
|
+
side in one of the writing modes that `writingModes` lists. By default, the rule
|
|
50
|
+
checks horizontal writing modes only, so `px-2 pt-2` does not conflict, but
|
|
51
|
+
`mx-auto ml-4` does.
|
|
52
|
+
|
|
53
|
+
When a physical utility meets a logical utility, the finding also shows how to
|
|
54
|
+
use logical properties for both. It names a logical utility from your design
|
|
55
|
+
system that writes the same value, such as `pbs-2` for `pt-2`, with the sides of
|
|
56
|
+
horizontal left-to-right writing modes. The finding does not prefer logical
|
|
57
|
+
properties; you can also replace the logical utility with physical utilities. It
|
|
58
|
+
names no utility when `writingModes` does not include `horizontal-tb`.
|
|
37
59
|
|
|
38
60
|
## Options
|
|
39
61
|
|
|
40
62
|
`allowShorthandOverrides` allows the supported overrides between a shorthand
|
|
41
63
|
utility and a longhand utility. The rule still reports other conflicts.
|
|
42
64
|
|
|
65
|
+
`writingModes` lists the CSS `writing-mode` values in which the rule compares
|
|
66
|
+
physical and logical utilities: `horizontal-tb`, `vertical-rl`, and
|
|
67
|
+
`vertical-lr`. The rule checks both the left-to-right and the right-to-left
|
|
68
|
+
direction of each mode. `sideways-rl` and `sideways-lr` place the sides as
|
|
69
|
+
`vertical-rl` and `vertical-lr` do. The default is `["horizontal-tb"]`, and the
|
|
70
|
+
`stylistic` preset lists all three. Add the vertical modes if your pages use
|
|
71
|
+
vertical text:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
const rules = {
|
|
75
|
+
"conflicting-utilities": {
|
|
76
|
+
writingModes: ["horizontal-tb", "vertical-rl"],
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Utilities that conflict in every writing mode, such as `p-2 px-4`, are reported
|
|
82
|
+
even when the list is empty.
|
|
83
|
+
|
|
43
84
|
## Rule settings
|
|
44
85
|
|
|
45
86
|
| Preset | Severity |
|
|
46
87
|
| --- | --- |
|
|
47
88
|
| `recommended` | warn |
|
|
48
89
|
| `strict` | deny |
|
|
49
|
-
| `stylistic` |
|
|
90
|
+
| `stylistic` | warn |
|
|
50
91
|
|
|
51
92
|
| Option | Default |
|
|
52
93
|
| --- | --- |
|
|
53
94
|
| `allowShorthandOverrides` | `false` |
|
|
95
|
+
| `writingModes` | `["horizontal-tb"]` |
|
|
54
96
|
|
|
55
|
-
[Configure lint](
|
|
97
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -5,8 +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`](
|
|
9
|
-
[`@custom-variant`](
|
|
8
|
+
This rule reports a [`@utility`](https://stillwind.dev/docs/at-rules/utility) or
|
|
9
|
+
[`@custom-variant`](https://stillwind.dev/docs/at-rules/custom-variant) definition that replaces an
|
|
10
10
|
earlier definition with the same name. The definitions do not combine, so the
|
|
11
11
|
earlier one is lost. In the example, `hocus` matches focus only, not hover.
|
|
12
12
|
|
|
@@ -42,4 +42,4 @@ earlier one is lost. In the example, `hocus` matches focus only, not hover.
|
|
|
42
42
|
| `strict` | deny |
|
|
43
43
|
| `stylistic` | off |
|
|
44
44
|
|
|
45
|
-
[Configure lint](
|
|
45
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -31,7 +31,7 @@ style("p-4");
|
|
|
31
31
|
Remove one of them. The automatic fix removes the repeated utility.
|
|
32
32
|
|
|
33
33
|
Two different utilities that set the same property are reported by
|
|
34
|
-
[conflicting-utilities](conflicting-utilities
|
|
34
|
+
[conflicting-utilities](https://stillwind.dev/docs/lints/conflicting-utilities) instead.
|
|
35
35
|
|
|
36
36
|
## Rule settings
|
|
37
37
|
|
|
@@ -41,4 +41,4 @@ Two different utilities that set the same property are reported by
|
|
|
41
41
|
| `strict` | deny |
|
|
42
42
|
| `stylistic` | off |
|
|
43
43
|
|
|
44
|
-
[Configure lint](
|
|
44
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -5,8 +5,8 @@ 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()`](
|
|
9
|
-
[`.for()`](
|
|
8
|
+
This rule reports a [`style()`](https://stillwind.dev/docs/macros/style) call with more than one
|
|
9
|
+
[`.for()`](https://stillwind.dev/docs/macros/view-transition). An element has one
|
|
10
10
|
[`view-transition-name`](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/view-transition-name),
|
|
11
11
|
so only one of the names takes effect.
|
|
12
12
|
|
|
@@ -44,4 +44,4 @@ style(transition.for("a"));
|
|
|
44
44
|
| `strict` | deny |
|
|
45
45
|
| `stylistic` | off |
|
|
46
46
|
|
|
47
|
-
[Configure lint](
|
|
47
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -5,7 +5,7 @@ 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`](
|
|
8
|
+
This rule reports a [`@utility`](https://stillwind.dev/docs/at-rules/utility) definition inside a
|
|
9
9
|
condition such as `@media`. The compiler registers utilities when it reads the
|
|
10
10
|
stylesheet, not in the browser, so it ignores the condition. The utility then
|
|
11
11
|
applies at every width.
|
|
@@ -49,4 +49,4 @@ applies at every width.
|
|
|
49
49
|
| `strict` | deny |
|
|
50
50
|
| `stylistic` | off |
|
|
51
51
|
|
|
52
|
-
[Configure lint](
|
|
52
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -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()`](
|
|
11
|
+
generates utilities only from [`style()`](https://stillwind.dev/docs/macros/style) calls.
|
|
12
12
|
|
|
13
13
|
## Reported
|
|
14
14
|
|
|
@@ -48,7 +48,7 @@ export default defineConfig({
|
|
|
48
48
|
- Replace a v3 path in `theme()`, such as `theme(colors.red.500)`, with a theme
|
|
49
49
|
variable: `--theme(--color-red-500)`. Without this change, browsers reject the
|
|
50
50
|
declaration.
|
|
51
|
-
- [Migrating from Tailwind CSS](
|
|
51
|
+
- [Migrating from Tailwind CSS](https://stillwind.dev/docs/guides/migrating-from-tailwind#move-configuration)
|
|
52
52
|
lists every replacement.
|
|
53
53
|
|
|
54
54
|
## Rule settings
|
|
@@ -59,4 +59,4 @@ export default defineConfig({
|
|
|
59
59
|
| `strict` | deny |
|
|
60
60
|
| `stylistic` | off |
|
|
61
61
|
|
|
62
|
-
[Configure lint](
|
|
62
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -5,7 +5,7 @@ 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`](
|
|
8
|
+
This rule reports a [`@custom-variant`](https://stillwind.dev/docs/at-rules/custom-variant) selector
|
|
9
9
|
without `&`. Without `&`, the selector matches descendants of the element, not
|
|
10
10
|
the element itself. In the example, `hocus:` would match hovered elements inside
|
|
11
11
|
the element.
|
|
@@ -40,4 +40,4 @@ the element.
|
|
|
40
40
|
| `strict` | deny |
|
|
41
41
|
| `stylistic` | off |
|
|
42
42
|
|
|
43
|
-
[Configure lint](
|
|
43
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -21,10 +21,10 @@ For a utility that your own stylesheet defines, the rule also checks the other
|
|
|
21
21
|
declarations that the utility writes, such as a bare value in `fg-5` from
|
|
22
22
|
`@utility fg-* { color: --value(integer); }`. It skips values that contain
|
|
23
23
|
`var()`, values that come from theme tokens, and custom properties.
|
|
24
|
-
[incompatible-theme-value](incompatible-theme-value
|
|
24
|
+
[incompatible-theme-value](https://stillwind.dev/docs/lints/incompatible-theme-value) checks theme
|
|
25
25
|
tokens where you define them. By default, the rule does not check the
|
|
26
26
|
definitions of packages and plugins, because you cannot change them. The
|
|
27
|
-
[`checkLibraries` and `checkPlugins`](
|
|
27
|
+
[`checkLibraries` and `checkPlugins`](https://stillwind.dev/docs/configuration#definitions-of-packages-and-plugins)
|
|
28
28
|
fields of `lint` select packages and plugins to check.
|
|
29
29
|
|
|
30
30
|
## Reported
|
|
@@ -57,4 +57,4 @@ style("w-1/2");
|
|
|
57
57
|
| `strict` | deny |
|
|
58
58
|
| `stylistic` | off |
|
|
59
59
|
|
|
60
|
-
[Configure lint](
|
|
60
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -43,4 +43,4 @@ namespace. For example, tokens in `--color-*` must be colors, so a length makes
|
|
|
43
43
|
| `strict` | deny |
|
|
44
44
|
| `stylistic` | off |
|
|
45
45
|
|
|
46
|
-
[Configure lint](
|
|
46
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
package/docs/lints/index.md
CHANGED
|
@@ -6,8 +6,8 @@ description: "Find a lint rule by the kind of mistake or policy that it reports.
|
|
|
6
6
|
# Lint rule reference
|
|
7
7
|
|
|
8
8
|
Lint rules report mistakes and project policies in your styles. The CLI and the
|
|
9
|
-
editor run them. [Checks in the editor and CI](
|
|
10
|
-
explains where the rules run, and [Configuration](
|
|
9
|
+
editor run them. [Checks in the editor and CI](https://stillwind.dev/docs/guides/lint-adoption)
|
|
10
|
+
explains where the rules run, and [Configuration](https://stillwind.dev/docs/configuration#lint)
|
|
11
11
|
covers presets, severities, and suppression comments.
|
|
12
12
|
|
|
13
13
|
The **Default** column shows the severity in the `recommended` preset, which a
|
|
@@ -20,11 +20,11 @@ A utility or variant that these rules report produces no CSS.
|
|
|
20
20
|
|
|
21
21
|
| Rule | Reports | Default |
|
|
22
22
|
| ---------------------------------------------------- | ------------------------------------------------------------- | ------- |
|
|
23
|
-
| [invalid-marker-use](invalid-marker-use
|
|
24
|
-
| [invalid-utility](invalid-utility
|
|
25
|
-
| [invalid-variant](invalid-variant
|
|
26
|
-
| [unknown-utility](unknown-utility
|
|
27
|
-
| [unknown-variant](unknown-variant
|
|
23
|
+
| [invalid-marker-use](https://stillwind.dev/docs/lints/invalid-marker-use) | A marker class such as `group` with a variant or `!` | warn |
|
|
24
|
+
| [invalid-utility](https://stillwind.dev/docs/lints/invalid-utility) | A known utility written in a form that it does not accept | deny |
|
|
25
|
+
| [invalid-variant](https://stillwind.dev/docs/lints/invalid-variant) | A known variant with an invalid value, such as `min-[foo]:` | deny |
|
|
26
|
+
| [unknown-utility](https://stillwind.dev/docs/lints/unknown-utility) | A utility or theme value that your stylesheet does not define | deny |
|
|
27
|
+
| [unknown-variant](https://stillwind.dev/docs/lints/unknown-variant) | A variant that your stylesheet does not define | deny |
|
|
28
28
|
|
|
29
29
|
## Invalid arguments to Stillwind APIs
|
|
30
30
|
|
|
@@ -33,73 +33,74 @@ report never matches.
|
|
|
33
33
|
|
|
34
34
|
| Rule | Reports | Default |
|
|
35
35
|
| ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------- | ------- |
|
|
36
|
-
| [invalid-animation-option](invalid-animation-option
|
|
37
|
-
| [invalid-css-input](invalid-css-input
|
|
38
|
-
| [invalid-cva-config](invalid-cva-config
|
|
39
|
-
| [invalid-cva-input](invalid-cva-input
|
|
40
|
-
| [invalid-keyframes-definition](invalid-keyframes-definition
|
|
41
|
-
| [invalid-keyframes-use](invalid-keyframes-use
|
|
42
|
-
| [invalid-keyframes-variant](invalid-keyframes-variant
|
|
43
|
-
| [invalid-media-query](invalid-media-query
|
|
44
|
-
| [invalid-ref-input](invalid-ref-input
|
|
45
|
-
| [invalid-rule-group-input](invalid-rule-group-input
|
|
46
|
-
| [invalid-runtime-condition](invalid-runtime-condition
|
|
47
|
-
| [invalid-
|
|
48
|
-
| [invalid-style-
|
|
49
|
-
| [invalid-
|
|
50
|
-
| [invalid-view-transition-
|
|
51
|
-
| [invalid-view-transition-
|
|
52
|
-
| [
|
|
53
|
-
| [
|
|
36
|
+
| [invalid-animation-option](https://stillwind.dev/docs/lints/invalid-animation-option) | A utility that is not an animation option, such as `p-4` | deny |
|
|
37
|
+
| [invalid-css-input](https://stillwind.dev/docs/lints/invalid-css-input) | A [`style.css()`](https://stillwind.dev/docs/macros/css) argument that is not a static utility | deny |
|
|
38
|
+
| [invalid-cva-config](https://stillwind.dev/docs/lints/invalid-cva-config) | An unknown or malformed field in a [`style.cva()`](https://stillwind.dev/docs/macros/cva) configuration | deny |
|
|
39
|
+
| [invalid-cva-input](https://stillwind.dev/docs/lints/invalid-cva-input) | `&&` or a ternary inside a `style.cva()` value | deny |
|
|
40
|
+
| [invalid-keyframes-definition](https://stillwind.dev/docs/lints/invalid-keyframes-definition) | A frame key that is not a keyframe position, such as `middle` | deny |
|
|
41
|
+
| [invalid-keyframes-use](https://stillwind.dev/docs/lints/invalid-keyframes-use) | An animation applied with an argument that is not an options string | deny |
|
|
42
|
+
| [invalid-keyframes-variant](https://stillwind.dev/docs/lints/invalid-keyframes-variant) | A selector or container variant around a keyframes definition | deny |
|
|
43
|
+
| [invalid-media-query](https://stillwind.dev/docs/lints/invalid-media-query) | A condition in [`style.media()`](https://stillwind.dev/docs/macros/media) that is not a media query, such as `hover` | deny |
|
|
44
|
+
| [invalid-ref-input](https://stillwind.dev/docs/lints/invalid-ref-input) | A [`style.ref()`](https://stillwind.dev/docs/macros/ref) label or ref method argument that is not a literal | deny |
|
|
45
|
+
| [invalid-rule-group-input](https://stillwind.dev/docs/lints/invalid-rule-group-input) | A `class` field or ref inside a variant key of [`style()`](https://stillwind.dev/docs/macros/style) | deny |
|
|
46
|
+
| [invalid-runtime-condition](https://stillwind.dev/docs/lints/invalid-runtime-condition) | A runtime CSS condition that Stillwind cannot compile | deny |
|
|
47
|
+
| [invalid-stored-variant](https://stillwind.dev/docs/lints/invalid-stored-variant) | A [`style.when()`](https://stillwind.dev/docs/macros/when) argument that is not a sequence of variants | deny |
|
|
48
|
+
| [invalid-style-composition](https://stillwind.dev/docs/lints/invalid-style-composition) | Inline styles or custom properties in a base style, which do not carry over | deny |
|
|
49
|
+
| [invalid-style-input](https://stillwind.dev/docs/lints/invalid-style-input) | A [`style()`](https://stillwind.dev/docs/macros/style) argument that it cannot compile, such as a number | deny |
|
|
50
|
+
| [invalid-view-transition-definition](https://stillwind.dev/docs/lints/invalid-view-transition-definition) | An unknown field in a [`style.viewTransition()`](https://stillwind.dev/docs/macros/view-transition) definition | deny |
|
|
51
|
+
| [invalid-view-transition-use](https://stillwind.dev/docs/lints/invalid-view-transition-use) | Extra or invalid arguments to [`.for()`](https://stillwind.dev/docs/macros/view-transition) | deny |
|
|
52
|
+
| [invalid-view-transition-variant](https://stillwind.dev/docs/lints/invalid-view-transition-variant) | A state or container variant in a view transition definition | deny |
|
|
53
|
+
| [missing-document-target](https://stillwind.dev/docs/lints/missing-document-target) | A [`style.css()`](https://stillwind.dev/docs/macros/css) utility without a selector | deny |
|
|
54
|
+
| [runtime-condition-requires-css-if](https://stillwind.dev/docs/lints/runtime-condition-requires-css-if) | A runtime CSS condition that needs `useCssIf` | deny |
|
|
54
55
|
|
|
55
56
|
## Arguments and imports
|
|
56
57
|
|
|
57
58
|
| Rule | Reports | Default |
|
|
58
59
|
| ---------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------- |
|
|
59
|
-
| [mismatched-framework-import](mismatched-framework-import
|
|
60
|
-
| [mutating-macro-argument](mutating-macro-argument
|
|
61
|
-
| [suspending-macro-argument](suspending-macro-argument
|
|
60
|
+
| [mismatched-framework-import](https://stillwind.dev/docs/lints/mismatched-framework-import) | An import from the entrypoint of another framework | warn |
|
|
61
|
+
| [mutating-macro-argument](https://stillwind.dev/docs/lints/mutating-macro-argument) | A state update inside a [`style()`](https://stillwind.dev/docs/macros/style) argument | deny |
|
|
62
|
+
| [suspending-macro-argument](https://stillwind.dev/docs/lints/suspending-macro-argument) | `await`, `yield`, or `import()` inside a [`style()`](https://stillwind.dev/docs/macros/style) argument | deny |
|
|
62
63
|
|
|
63
64
|
## Conflicting or duplicated styles
|
|
64
65
|
|
|
65
66
|
| Rule | Reports | Default |
|
|
66
67
|
| ------------------------------------------------------------------------------ | ----------------------------------------------------------------------- | ------- |
|
|
67
|
-
| [ambiguous-style-base-order](ambiguous-style-base-order
|
|
68
|
-
| [conflicting-provider-properties](conflicting-provider-properties
|
|
69
|
-
| [conflicting-utilities](conflicting-utilities
|
|
70
|
-
| [duplicate-utility](duplicate-utility
|
|
71
|
-
| [interfering-imported-style-base](interfering-imported-style-base
|
|
72
|
-
| [unverified-style-base](unverified-style-base
|
|
68
|
+
| [ambiguous-style-base-order](https://stillwind.dev/docs/lints/ambiguous-style-base-order) | Two base styles in one call that set the same property | warn |
|
|
69
|
+
| [conflicting-provider-properties](https://stillwind.dev/docs/lints/conflicting-provider-properties) | A container or anchor property that a ref method and a utility both set | warn |
|
|
70
|
+
| [conflicting-utilities](https://stillwind.dev/docs/lints/conflicting-utilities) | Utilities that set the same property, such as `p-2 p-4` | warn |
|
|
71
|
+
| [duplicate-utility](https://stillwind.dev/docs/lints/duplicate-utility) | The same utility twice under the same conditions | warn |
|
|
72
|
+
| [interfering-imported-style-base](https://stillwind.dev/docs/lints/interfering-imported-style-base) | An imported base style that sets the same property as another style | warn |
|
|
73
|
+
| [unverified-style-base](https://stillwind.dev/docs/lints/unverified-style-base) | A base style whose origin the CLI cannot determine from its type | warn |
|
|
73
74
|
|
|
74
75
|
## Styles that do not apply as written
|
|
75
76
|
|
|
76
77
|
| Rule | Reports | Default |
|
|
77
78
|
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
78
|
-
| [clamped-value](clamped-value
|
|
79
|
-
| [document-scoped-selector](document-scoped-selector
|
|
80
|
-
| [duplicate-view-transition-name](duplicate-view-transition-name
|
|
81
|
-
| [incompatible-property-value](incompatible-property-value
|
|
82
|
-
| [ineffective-anchor-scope](ineffective-anchor-scope
|
|
83
|
-
| [missing-ref-attachment](missing-ref-attachment
|
|
84
|
-
| [missing-view-transition-name](missing-view-transition-name
|
|
85
|
-
| [repeated-nesting-selector](repeated-nesting-selector
|
|
86
|
-
| [split-view-transition-class](split-view-transition-class
|
|
87
|
-
| [unmatched-host-selector](unmatched-host-selector
|
|
88
|
-
| [unsatisfiable-variants](unsatisfiable-variants
|
|
79
|
+
| [clamped-value](https://stillwind.dev/docs/lints/clamped-value) | A value outside the range that the browser uses, such as opacity above 1 | warn |
|
|
80
|
+
| [document-scoped-selector](https://stillwind.dev/docs/lints/document-scoped-selector) | A selector that styles the whole document instead of the element | deny |
|
|
81
|
+
| [duplicate-view-transition-name](https://stillwind.dev/docs/lints/duplicate-view-transition-name) | Two [`.for()`](https://stillwind.dev/docs/macros/view-transition) calls in one [`style()`](https://stillwind.dev/docs/macros/style) call | warn |
|
|
82
|
+
| [incompatible-property-value](https://stillwind.dev/docs/lints/incompatible-property-value) | A value that the browser rejects for the property | deny |
|
|
83
|
+
| [ineffective-anchor-scope](https://stillwind.dev/docs/lints/ineffective-anchor-scope) | An empty or repeated ref list in an anchor scope | warn |
|
|
84
|
+
| [missing-ref-attachment](https://stillwind.dev/docs/lints/missing-ref-attachment) | [`asContainer()`](https://stillwind.dev/docs/macros/ref/as-container) or [`asAnchor()`](https://stillwind.dev/docs/macros/ref/as-anchor) in a call that does not attach the ref | warn |
|
|
85
|
+
| [missing-view-transition-name](https://stillwind.dev/docs/lints/missing-view-transition-name) | A view transition applied without [`.for()`](https://stillwind.dev/docs/macros/view-transition) | warn |
|
|
86
|
+
| [repeated-nesting-selector](https://stillwind.dev/docs/lints/repeated-nesting-selector) | A selector that repeats `&` to relate two elements | warn |
|
|
87
|
+
| [split-view-transition-class](https://stillwind.dev/docs/lints/split-view-transition-class) | View transitions split across separate [`style()`](https://stillwind.dev/docs/macros/style) calls | warn |
|
|
88
|
+
| [unmatched-host-selector](https://stillwind.dev/docs/lints/unmatched-host-selector) | A variant that tests a shadow host through the elements around it | warn |
|
|
89
|
+
| [unsatisfiable-variants](https://stillwind.dev/docs/lints/unsatisfiable-variants) | Variants that can never match together, such as `portrait:landscape:` | warn |
|
|
89
90
|
|
|
90
91
|
## Stylesheet definitions
|
|
91
92
|
|
|
92
93
|
| Rule | Reports | Default |
|
|
93
94
|
| ------------------------------------------------------------------------ | ---------------------------------------------------------------- | ------- |
|
|
94
|
-
| [bypassed-undefinition](bypassed-undefinition
|
|
95
|
-
| [duplicate-definition](duplicate-definition
|
|
96
|
-
| [ignored-definition-condition](ignored-definition-condition
|
|
97
|
-
| [ignored-tailwind-feature](ignored-tailwind-feature
|
|
98
|
-
| [implicit-nesting-selector](implicit-nesting-selector
|
|
99
|
-
| [incompatible-theme-value](incompatible-theme-value
|
|
100
|
-
| [invalid-css-directive](invalid-css-directive
|
|
101
|
-
| [invalid-css-import](invalid-css-import
|
|
102
|
-
| [invalid-theme-reference](invalid-theme-reference
|
|
95
|
+
| [bypassed-undefinition](https://stillwind.dev/docs/lints/bypassed-undefinition) | A definition that bypasses an undefinition in another context | warn |
|
|
96
|
+
| [duplicate-definition](https://stillwind.dev/docs/lints/duplicate-definition) | A utility or variant definition that replaces an earlier one | warn |
|
|
97
|
+
| [ignored-definition-condition](https://stillwind.dev/docs/lints/ignored-definition-condition) | A media rule around a definition, which the compiler ignores | deny |
|
|
98
|
+
| [ignored-tailwind-feature](https://stillwind.dev/docs/lints/ignored-tailwind-feature) | Tailwind-only directives such as `@config`, which have no effect | warn |
|
|
99
|
+
| [implicit-nesting-selector](https://stillwind.dev/docs/lints/implicit-nesting-selector) | A custom variant selector without `&`, which selects descendants | warn |
|
|
100
|
+
| [incompatible-theme-value](https://stillwind.dev/docs/lints/incompatible-theme-value) | A theme value of the wrong type, such as a length for a color | deny |
|
|
101
|
+
| [invalid-css-directive](https://stillwind.dev/docs/lints/invalid-css-directive) | A malformed or unsupported Stillwind directive | deny |
|
|
102
|
+
| [invalid-css-import](https://stillwind.dev/docs/lints/invalid-css-import) | A stylesheet import that cannot be resolved | deny |
|
|
103
|
+
| [invalid-theme-reference](https://stillwind.dev/docs/lints/invalid-theme-reference) | A reference to a theme token that is not defined | deny |
|
|
103
104
|
|
|
104
105
|
## Project policies
|
|
105
106
|
|
|
@@ -107,15 +108,15 @@ These rules enforce choices of your project. No preset enables them.
|
|
|
107
108
|
|
|
108
109
|
| Rule | Reports | Default |
|
|
109
110
|
| -------------------------------------------------------------------- | ------------------------------------------------------------- | ------- |
|
|
110
|
-
| [no-arbitrary-breakpoints](no-arbitrary-breakpoints
|
|
111
|
-
| [no-arbitrary-colors](no-arbitrary-colors
|
|
112
|
-
| [no-arbitrary-spacing](no-arbitrary-spacing
|
|
113
|
-
| [no-class-property](no-class-property
|
|
114
|
-
| [no-important](no-important
|
|
115
|
-
| [no-restricted-declarations](no-restricted-declarations
|
|
116
|
-
| [no-restricted-length-units](no-restricted-length-units
|
|
117
|
-
| [no-restricted-theme-tokens](no-restricted-theme-tokens
|
|
118
|
-
| [no-restricted-utilities](no-restricted-utilities
|
|
111
|
+
| [no-arbitrary-breakpoints](https://stillwind.dev/docs/lints/no-arbitrary-breakpoints) | Viewport widths written as values, such as `min-[713px]:` | off |
|
|
112
|
+
| [no-arbitrary-colors](https://stillwind.dev/docs/lints/no-arbitrary-colors) | Colors written as values, such as `bg-[#123456]` | off |
|
|
113
|
+
| [no-arbitrary-spacing](https://stillwind.dev/docs/lints/no-arbitrary-spacing) | Spacing written as values, such as `p-[13px]` | off |
|
|
114
|
+
| [no-class-property](https://stillwind.dev/docs/lints/no-class-property) | The `class` field, which adds classes without generated CSS | off |
|
|
115
|
+
| [no-important](https://stillwind.dev/docs/lints/no-important) | The `!` modifier | off |
|
|
116
|
+
| [no-restricted-declarations](https://stillwind.dev/docs/lints/no-restricted-declarations) | Utilities that produce the CSS declarations that you list | off |
|
|
117
|
+
| [no-restricted-length-units](https://stillwind.dev/docs/lints/no-restricted-length-units) | Length units that you forbid for the properties that you list | off |
|
|
118
|
+
| [no-restricted-theme-tokens](https://stillwind.dev/docs/lints/no-restricted-theme-tokens) | Utilities that use the theme tokens that you list | off |
|
|
119
|
+
| [no-restricted-utilities](https://stillwind.dev/docs/lints/no-restricted-utilities) | The utilities that you list | off |
|
|
119
120
|
|
|
120
121
|
## Preferred spelling
|
|
121
122
|
|
|
@@ -124,18 +125,18 @@ preset enables the rules that are off by default.
|
|
|
124
125
|
|
|
125
126
|
| Rule | Reports | Default |
|
|
126
127
|
| -------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------- |
|
|
127
|
-
| [prefer-canonical-utilities](prefer-canonical-utilities
|
|
128
|
-
| [prefer-direct-styling](prefer-direct-styling
|
|
129
|
-
| [prefer-logical-properties](prefer-logical-properties
|
|
130
|
-
| [prefer-sorted-utilities](prefer-sorted-utilities
|
|
131
|
-
| [prefer-typed-relationships](prefer-typed-relationships
|
|
132
|
-
| [prefer-typed-variables](prefer-typed-variables
|
|
133
|
-
| [prefer-variant-directive](prefer-variant-directive
|
|
134
|
-
| [redundant-variant](redundant-variant
|
|
128
|
+
| [prefer-canonical-utilities](https://stillwind.dev/docs/lints/prefer-canonical-utilities) | A utility with a shorter equivalent, such as `px-[16px]` for `px-4` | warn |
|
|
129
|
+
| [prefer-direct-styling](https://stillwind.dev/docs/lints/prefer-direct-styling) | A selector that styles another element, such as `[&_button]:` | off |
|
|
130
|
+
| [prefer-logical-properties](https://stillwind.dev/docs/lints/prefer-logical-properties) | A physical property with a logical form, such as `ml-4` | off |
|
|
131
|
+
| [prefer-sorted-utilities](https://stillwind.dev/docs/lints/prefer-sorted-utilities) | Utilities that are not in sorted order | off |
|
|
132
|
+
| [prefer-typed-relationships](https://stillwind.dev/docs/lints/prefer-typed-relationships) | `group-*` and `peer-*` variants that a ref can replace | off |
|
|
133
|
+
| [prefer-typed-variables](https://stillwind.dev/docs/lints/prefer-typed-variables) | A custom property without a type in a utility that accepts several types | off |
|
|
134
|
+
| [prefer-variant-directive](https://stillwind.dev/docs/lints/prefer-variant-directive) | A media rule in your CSS that a named variant can replace | off |
|
|
135
|
+
| [redundant-variant](https://stillwind.dev/docs/lints/redundant-variant) | A variant that adds no condition, such as `hover:hover:` | warn |
|
|
135
136
|
|
|
136
137
|
## Suppression comments
|
|
137
138
|
|
|
138
139
|
| Rule | Reports | Default |
|
|
139
140
|
| ---------------------------------------------------------------- | ------------------------------------------- | ------- |
|
|
140
|
-
| [invalid-lint-suppression](invalid-lint-suppression
|
|
141
|
-
| [unused-lint-suppression](unused-lint-suppression
|
|
141
|
+
| [invalid-lint-suppression](https://stillwind.dev/docs/lints/invalid-lint-suppression) | A malformed comment or an unknown rule name | warn |
|
|
142
|
+
| [unused-lint-suppression](https://stillwind.dev/docs/lints/unused-lint-suppression) | A comment that suppresses no finding | off |
|
|
@@ -35,7 +35,7 @@ Write the scope that you mean:
|
|
|
35
35
|
- Use `"all"` to limit every anchor name.
|
|
36
36
|
- Use `"none"` to set `anchor-scope: none`.
|
|
37
37
|
|
|
38
|
-
See [`style.anchorScope()`](
|
|
38
|
+
See [`style.anchorScope()`](https://stillwind.dev/docs/macros/anchor-scope#inputs).
|
|
39
39
|
|
|
40
40
|
## Rule settings
|
|
41
41
|
|
|
@@ -45,4 +45,4 @@ See [`style.anchorScope()`](../macros/anchor-scope.md#inputs).
|
|
|
45
45
|
| `strict` | deny |
|
|
46
46
|
| `stylistic` | off |
|
|
47
47
|
|
|
48
|
-
[Configure lint](
|
|
48
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
@@ -6,8 +6,13 @@ description: "Reports an imported base style that sets the same property as anot
|
|
|
6
6
|
# interfering-imported-style-base
|
|
7
7
|
|
|
8
8
|
This rule reports a base style from another module that sets the same property as
|
|
9
|
-
another base or utility in the call, when neither is built on the other. The
|
|
10
|
-
|
|
9
|
+
another base or utility in the call, when neither is built on the other. The rule
|
|
10
|
+
reports both cases:
|
|
11
|
+
|
|
12
|
+
- Two imported bases set the same property. The order of the arguments does not
|
|
13
|
+
decide which base wins.
|
|
14
|
+
- An imported base and a utility of the call set the same property. The utility of
|
|
15
|
+
the call wins, but the rule still reports the call.
|
|
11
16
|
|
|
12
17
|
## Project files
|
|
13
18
|
|
|
@@ -23,11 +28,20 @@ export const combined = style(first, "p-4");
|
|
|
23
28
|
```tsx
|
|
24
29
|
import { first, second } from "./bases";
|
|
25
30
|
export const props = style(first, second);
|
|
31
|
+
export const padded = style(first, "p-4");
|
|
26
32
|
```
|
|
27
33
|
|
|
28
34
|
> interfering-imported-style-base: the base in `bases.ts` overlaps these declarations: `padding`
|
|
29
35
|
>
|
|
30
36
|
> Example:2:22
|
|
37
|
+
>
|
|
38
|
+
> reordering the style() arguments does not change which declaration wins
|
|
39
|
+
|
|
40
|
+
> interfering-imported-style-base: the base in `bases.ts` overlaps these declarations: `padding`
|
|
41
|
+
>
|
|
42
|
+
> Example:3:23
|
|
43
|
+
>
|
|
44
|
+
> reordering the style() arguments does not change which declaration wins
|
|
31
45
|
|
|
32
46
|
## Fixed
|
|
33
47
|
|
|
@@ -36,13 +50,17 @@ import { combined } from "./bases";
|
|
|
36
50
|
export const props = style(combined);
|
|
37
51
|
```
|
|
38
52
|
|
|
53
|
+
`combined` replaces both reported calls, because it sets `p-4` on top of `first`
|
|
54
|
+
in the module that defines `first`.
|
|
55
|
+
|
|
39
56
|
## How to fix
|
|
40
57
|
|
|
41
58
|
- In the module that defines the styles, build the overriding style on the other
|
|
42
59
|
one, as `combined` does. Then import that style.
|
|
43
60
|
- Or remove the property from one of the styles.
|
|
44
61
|
|
|
45
|
-
|
|
62
|
+
Reordering the arguments does not fix it. `style("p-4", first)` and
|
|
63
|
+
`style(second, first)` produce the same CSS and the same finding.
|
|
46
64
|
|
|
47
65
|
## Rule settings
|
|
48
66
|
|
|
@@ -52,6 +70,6 @@ Changing the order of the arguments in the importing module does not fix it.
|
|
|
52
70
|
| `strict` | deny |
|
|
53
71
|
| `stylistic` | off |
|
|
54
72
|
|
|
55
|
-
[Configure lint](
|
|
73
|
+
[Configure lint](https://stillwind.dev/docs/configuration#lint) to change the severity or options.
|
|
56
74
|
|
|
57
75
|
The CLI and the editor report this rule only when they analyze the whole project.
|