stillwind 0.0.0 → 0.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS_TEMPLATE.md +5 -0
- package/LICENSE +21 -0
- package/README.md +166 -0
- package/TAILWINDCSS-MIT-LICENSE +21 -0
- package/css/builtin-metadata/sw-motion-properties.css +186 -0
- package/css/builtin-metadata/tw-legacy-metadata.css +36 -0
- package/css/builtin-metadata/tw-properties.css +944 -0
- package/css/builtin-metadata/tw-registry-metadata.css +52 -0
- package/css/builtin-metadata/tw-relationship-metadata.css +10 -0
- package/css/builtin-utilities/sw-motion-contexts.css +1043 -0
- package/css/builtin-utilities/tw-backgrounds.css +606 -0
- package/css/builtin-utilities/tw-borders.css +954 -0
- package/css/builtin-utilities/tw-effects.css +1209 -0
- package/css/builtin-utilities/tw-flex-grid.css +749 -0
- package/css/builtin-utilities/tw-interactivity.css +680 -0
- package/css/builtin-utilities/tw-layout.css +943 -0
- package/css/builtin-utilities/tw-masks.css +1268 -0
- package/css/builtin-utilities/tw-motion.css +142 -0
- package/css/builtin-utilities/tw-spacing-sizing.css +621 -0
- package/css/builtin-utilities/tw-svg.css +50 -0
- package/css/builtin-utilities/tw-transforms.css +652 -0
- package/css/builtin-utilities/tw-typography.css +720 -0
- package/css/builtin-variants/sw-conditional.css +5 -0
- package/css/builtin-variants/sw-document.css +13 -0
- package/css/builtin-variants/tw-conditional.css +187 -0
- package/css/builtin-variants/tw-dynamic-selector.css +49 -0
- package/css/builtin-variants/tw-relationship.css +41 -0
- package/css/builtin-variants/tw-state.css +159 -0
- package/css/builtin-variants/tw-structural.css +121 -0
- package/css/builtins.css +111 -0
- package/css/preflight.css +401 -0
- package/css/templates.css +40 -0
- package/css/theme.css +546 -0
- package/css/utilities.css +9 -0
- package/dist/class-object-D24FFYqO.js +6 -0
- package/dist/class-object-D24FFYqO.js.map +1 -0
- package/dist/class-object-D7ZGJOf_.d.ts +9 -0
- package/dist/class-string-CQHnc9GN.d.ts +9 -0
- package/dist/class-string-Db8-oI4q.js +6 -0
- package/dist/class-string-Db8-oI4q.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +2 -0
- package/dist/css.d.ts +100 -0
- package/dist/css.js +143 -0
- package/dist/css.js.map +1 -0
- package/dist/cva-BwX07CFw.js +204 -0
- package/dist/cva-BwX07CFw.js.map +1 -0
- package/dist/cva-DSpDNBYi.d.ts +9 -0
- package/dist/development-DttPQc71.d.ts +27 -0
- package/dist/development-J-JCSIm0.js +111 -0
- package/dist/development-J-JCSIm0.js.map +1 -0
- package/dist/frameworks/alpine.d.ts +20 -0
- package/dist/frameworks/alpine.js +18 -0
- package/dist/frameworks/alpine.js.map +1 -0
- package/dist/frameworks/astro.d.ts +3 -0
- package/dist/frameworks/astro.js +1 -0
- package/dist/frameworks/lit.d.ts +21 -0
- package/dist/frameworks/lit.js +38 -0
- package/dist/frameworks/lit.js.map +1 -0
- package/dist/frameworks/preact.d.ts +3 -0
- package/dist/frameworks/preact.js +1 -0
- package/dist/frameworks/qwik.d.ts +3 -0
- package/dist/frameworks/qwik.js +1 -0
- package/dist/frameworks/react.d.ts +10 -0
- package/dist/frameworks/react.js +6 -0
- package/dist/frameworks/react.js.map +1 -0
- package/dist/frameworks/solid.d.ts +3 -0
- package/dist/frameworks/solid.js +1 -0
- package/dist/frameworks/svelte.d.ts +3 -0
- package/dist/frameworks/svelte.js +1 -0
- package/dist/frameworks/vanilla.d.ts +27 -0
- package/dist/frameworks/vanilla.js +3 -0
- package/dist/frameworks/vue.d.ts +3 -0
- package/dist/frameworks/vue.js +1 -0
- package/dist/index-RwVFpxhE.d.ts +815 -0
- package/dist/macro/index.d.ts +2 -0
- package/dist/macro/index.js +1 -0
- package/dist/module-css.d.ts +30 -0
- package/dist/module-css.js +23 -0
- package/dist/module-css.js.map +1 -0
- package/dist/runtime/class-name-object-development.d.ts +10 -0
- package/dist/runtime/class-name-object-development.js +18 -0
- package/dist/runtime/class-name-object-development.js.map +1 -0
- package/dist/runtime/class-name-object.d.ts +16 -0
- package/dist/runtime/class-name-object.js +31 -0
- package/dist/runtime/class-name-object.js.map +1 -0
- package/dist/runtime/class-object-development.d.ts +10 -0
- package/dist/runtime/class-object-development.js +18 -0
- package/dist/runtime/class-object-development.js.map +1 -0
- package/dist/runtime/class-object.d.ts +16 -0
- package/dist/runtime/class-object.js +31 -0
- package/dist/runtime/class-object.js.map +1 -0
- package/dist/runtime/class-string-development.d.ts +10 -0
- package/dist/runtime/class-string-development.js +18 -0
- package/dist/runtime/class-string-development.js.map +1 -0
- package/dist/runtime/class-string.d.ts +16 -0
- package/dist/runtime/class-string.js +31 -0
- package/dist/runtime/class-string.js.map +1 -0
- package/dist/shared-B9IQXU6P.d.ts +32 -0
- package/dist/style-BV4ctkni.js +78 -0
- package/dist/style-BV4ctkni.js.map +1 -0
- package/dist/style-fTQbsVWZ.js +41 -0
- package/dist/style-fTQbsVWZ.js.map +1 -0
- package/docs/agents.md +76 -0
- package/docs/at-rules/apply.md +93 -0
- package/docs/at-rules/custom-variant.md +127 -0
- package/docs/at-rules/index.md +75 -0
- package/docs/at-rules/plugin.md +71 -0
- package/docs/at-rules/registry-directives.md +181 -0
- package/docs/at-rules/slot.md +58 -0
- package/docs/at-rules/stillwind-css-template.md +126 -0
- package/docs/at-rules/stillwind-property.md +133 -0
- package/docs/at-rules/stillwind-registry.md +115 -0
- package/docs/at-rules/stillwind-require-properties.md +91 -0
- package/docs/at-rules/stillwind-slot.md +85 -0
- package/docs/at-rules/stillwind-undef-arbitrary-property.md +75 -0
- package/docs/at-rules/stillwind-undef-utility.md +87 -0
- package/docs/at-rules/stillwind-undef-variant.md +55 -0
- package/docs/at-rules/theme.md +304 -0
- package/docs/at-rules/utility.md +286 -0
- package/docs/at-rules/variant.md +91 -0
- package/docs/concepts/css-ordering.md +245 -0
- package/docs/concepts/how-styles-compile.md +132 -0
- package/docs/configuration.md +298 -0
- package/docs/errors/SW01001.md +51 -0
- package/docs/errors/SW01002.md +52 -0
- package/docs/errors/SW01003.md +69 -0
- package/docs/errors/SW02001.md +23 -0
- package/docs/errors/SW02002.md +51 -0
- package/docs/errors/SW03001.md +71 -0
- package/docs/errors/SW03002.md +79 -0
- package/docs/errors/SW03003.md +36 -0
- package/docs/errors/SW10001.md +34 -0
- package/docs/errors/SW10002.md +36 -0
- package/docs/errors/SW10003.md +30 -0
- package/docs/errors/SW10004.md +39 -0
- package/docs/errors/SW10005.md +35 -0
- package/docs/errors/SW11001.md +37 -0
- package/docs/errors/SW11002.md +65 -0
- package/docs/errors/SW11003.md +20 -0
- package/docs/errors/SW12001.md +43 -0
- package/docs/errors/SW12002.md +42 -0
- package/docs/errors/SW13001.md +35 -0
- package/docs/errors/SW13002.md +33 -0
- package/docs/errors/SW13003.md +18 -0
- package/docs/errors/SW13004.md +45 -0
- package/docs/errors/SW14001.md +44 -0
- package/docs/errors/SW14002.md +47 -0
- package/docs/errors/SW14003.md +38 -0
- package/docs/errors/SW14004.md +48 -0
- package/docs/errors/SW14005.md +51 -0
- package/docs/errors/SW14006.md +19 -0
- package/docs/errors/SW14007.md +35 -0
- package/docs/errors/SW14008.md +41 -0
- package/docs/errors/SW15001.md +18 -0
- package/docs/errors/SW15002.md +19 -0
- package/docs/errors/SW15003.md +16 -0
- package/docs/errors/SW30001.md +21 -0
- package/docs/errors/SW30002.md +18 -0
- package/docs/errors/SW30003.md +17 -0
- package/docs/errors/SW30004.md +18 -0
- package/docs/errors/SW31001.md +20 -0
- package/docs/errors/SW31002.md +17 -0
- package/docs/errors/SW31003.md +18 -0
- package/docs/errors/SW31004.md +20 -0
- package/docs/errors/SW31005.md +18 -0
- package/docs/errors/SW31006.md +17 -0
- package/docs/errors/SW31007.md +18 -0
- package/docs/errors/SW31008.md +16 -0
- package/docs/errors/SW31009.md +18 -0
- package/docs/errors/SW31010.md +16 -0
- package/docs/errors/SW31011.md +17 -0
- package/docs/errors/SW32001.md +18 -0
- package/docs/errors/SW32002.md +45 -0
- package/docs/errors/SW32003.md +43 -0
- package/docs/errors/SW32004.md +17 -0
- package/docs/errors/SW32005.md +40 -0
- package/docs/errors/SW32006.md +18 -0
- package/docs/errors/SW32007.md +20 -0
- package/docs/errors/SW33001.md +17 -0
- package/docs/errors/SW33002.md +17 -0
- package/docs/errors/SW33003.md +17 -0
- package/docs/errors/SW33004.md +17 -0
- package/docs/errors/SW33005.md +20 -0
- package/docs/errors/SW34001.md +18 -0
- package/docs/errors/SW34002.md +17 -0
- package/docs/errors/SW34003.md +18 -0
- package/docs/errors/SW90001.md +17 -0
- package/docs/errors/SW90002.md +18 -0
- package/docs/errors/SW90003.md +17 -0
- package/docs/errors/SW90004.md +17 -0
- package/docs/errors/SW90005.md +16 -0
- package/docs/errors/SW90006.md +17 -0
- package/docs/errors/SW90007.md +17 -0
- package/docs/errors/SW90008.md +17 -0
- package/docs/errors/index.md +125 -0
- package/docs/guides/animations.md +73 -0
- package/docs/guides/design-systems.md +119 -0
- package/docs/guides/element-relationships.md +136 -0
- package/docs/guides/lint-adoption.md +128 -0
- package/docs/guides/migrating-from-css.md +126 -0
- package/docs/guides/migrating-from-tailwind.md +179 -0
- package/docs/guides/recommended-practices.md +338 -0
- package/docs/guides/responsive-styles.md +103 -0
- package/docs/guides/reusable-styles.md +110 -0
- package/docs/guides/style.md +181 -0
- package/docs/guides/tailwind-compatibility.md +126 -0
- package/docs/guides/view-transitions.md +84 -0
- package/docs/guides/web-components.md +216 -0
- package/docs/index.md +136 -0
- package/docs/integrations.md +190 -0
- package/docs/lints/ambiguous-style-base-order.md +50 -0
- package/docs/lints/bypassed-undefinition.md +50 -0
- package/docs/lints/clamped-value.md +44 -0
- package/docs/lints/conflicting-provider-properties.md +47 -0
- package/docs/lints/conflicting-utilities.md +55 -0
- package/docs/lints/document-scoped-selector.md +45 -0
- package/docs/lints/duplicate-definition.md +44 -0
- package/docs/lints/duplicate-utility.md +44 -0
- package/docs/lints/duplicate-view-transition-name.md +45 -0
- package/docs/lints/ignored-definition-condition.md +51 -0
- package/docs/lints/ignored-tailwind-feature.md +62 -0
- package/docs/lints/incompatible-property-value.md +60 -0
- package/docs/lints/incompatible-theme-value.md +46 -0
- package/docs/lints/index.md +140 -0
- package/docs/lints/ineffective-anchor-scope.md +46 -0
- package/docs/lints/interfering-imported-style-base.md +57 -0
- package/docs/lints/invalid-animation-option.md +47 -0
- package/docs/lints/invalid-css-directive.md +43 -0
- package/docs/lints/invalid-css-import.md +43 -0
- package/docs/lints/invalid-css-input.md +45 -0
- package/docs/lints/invalid-cva-config.md +46 -0
- package/docs/lints/invalid-cva-input.md +50 -0
- package/docs/lints/invalid-keyframes-definition.md +47 -0
- package/docs/lints/invalid-keyframes-use.md +47 -0
- package/docs/lints/invalid-keyframes-variant.md +48 -0
- package/docs/lints/invalid-lint-suppression.md +47 -0
- package/docs/lints/invalid-marker-use.md +53 -0
- package/docs/lints/invalid-media-query.md +52 -0
- package/docs/lints/invalid-ref-input.md +49 -0
- package/docs/lints/invalid-rule-group-input.md +58 -0
- package/docs/lints/invalid-runtime-condition.md +67 -0
- package/docs/lints/invalid-style-composition.md +52 -0
- package/docs/lints/invalid-style-input.md +47 -0
- package/docs/lints/invalid-theme-reference.md +52 -0
- package/docs/lints/invalid-utility.md +44 -0
- package/docs/lints/invalid-variant.md +45 -0
- package/docs/lints/invalid-view-transition-definition.md +46 -0
- package/docs/lints/invalid-view-transition-use.md +46 -0
- package/docs/lints/invalid-view-transition-variant.md +51 -0
- package/docs/lints/mismatched-framework-import.md +47 -0
- package/docs/lints/missing-document-target.md +44 -0
- package/docs/lints/missing-ref-attachment.md +44 -0
- package/docs/lints/missing-view-transition-name.md +46 -0
- package/docs/lints/mutating-macro-argument.md +48 -0
- package/docs/lints/no-arbitrary-breakpoints.md +50 -0
- package/docs/lints/no-arbitrary-colors.md +51 -0
- package/docs/lints/no-arbitrary-spacing.md +57 -0
- package/docs/lints/no-class-property.md +58 -0
- package/docs/lints/no-important.md +50 -0
- package/docs/lints/no-restricted-declarations.md +76 -0
- package/docs/lints/no-restricted-length-units.md +73 -0
- package/docs/lints/no-restricted-theme-tokens.md +73 -0
- package/docs/lints/no-restricted-utilities.md +73 -0
- package/docs/lints/prefer-canonical-utilities.md +69 -0
- package/docs/lints/prefer-direct-styling.md +47 -0
- package/docs/lints/prefer-explicit-nesting-selector.md +42 -0
- package/docs/lints/prefer-logical-properties.md +49 -0
- package/docs/lints/prefer-sorted-utilities.md +46 -0
- package/docs/lints/prefer-typed-relationships.md +48 -0
- package/docs/lints/prefer-typed-variables.md +43 -0
- package/docs/lints/prefer-variant-directive.md +59 -0
- package/docs/lints/redundant-variant.md +50 -0
- package/docs/lints/repeated-nesting-selector.md +59 -0
- package/docs/lints/runtime-condition-requires-css-if.md +59 -0
- package/docs/lints/split-view-transition-class.md +47 -0
- package/docs/lints/suspending-macro-argument.md +46 -0
- package/docs/lints/unknown-utility.md +47 -0
- package/docs/lints/unknown-variant.md +42 -0
- package/docs/lints/unsatisfiable-variants.md +42 -0
- package/docs/lints/unused-lint-suppression.md +57 -0
- package/docs/lints/unverified-style-base.md +64 -0
- package/docs/macros/anchor-scope.md +90 -0
- package/docs/macros/css.md +68 -0
- package/docs/macros/cva.md +153 -0
- package/docs/macros/index.md +30 -0
- package/docs/macros/keyframes.md +98 -0
- package/docs/macros/media.md +65 -0
- package/docs/macros/ref/as-anchor.md +70 -0
- package/docs/macros/ref/as-container.md +64 -0
- package/docs/macros/ref/at.md +68 -0
- package/docs/macros/ref/condition.md +86 -0
- package/docs/macros/ref/in.md +81 -0
- package/docs/macros/ref/index.md +115 -0
- package/docs/macros/ref/position-anchor.md +64 -0
- package/docs/macros/style.md +185 -0
- package/docs/macros/view-transition.md +159 -0
- package/docs/utilities.md +35 -0
- package/docs/why.md +144 -0
- package/index.css +7 -0
- package/package.json +135 -8
- package/skills/migrate-to-stillwind/SKILL.md +81 -0
- package/skills/setup-stillwind/SKILL.md +51 -0
- package/skills/stillwind/SKILL.md +54 -0
- package/index.js +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "prefer-canonical-utilities"
|
|
3
|
+
description: "Suggests standard utility spellings and combines equivalent utilities."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# prefer-canonical-utilities
|
|
7
|
+
|
|
8
|
+
This rule suggests standard spellings, such as `px-4` for `px-[16px]`. It also
|
|
9
|
+
removes unnecessary spaces from arbitrary values, simplifies variants and modifiers,
|
|
10
|
+
and replaces legacy Tailwind spellings. Suggestions use your active theme and custom
|
|
11
|
+
definitions.
|
|
12
|
+
|
|
13
|
+
Within one string or one CSS `@apply` statement, it can combine utilities such as
|
|
14
|
+
`w-4 h-4` into `size-4`. Utilities must have the same variants and importance.
|
|
15
|
+
|
|
16
|
+
## Reported
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
style("px-[16px]");
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
> prefer-canonical-utilities: replace `px-[16px]` with `px-4`
|
|
23
|
+
>
|
|
24
|
+
> Example:1:8
|
|
25
|
+
|
|
26
|
+
## Fixed
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
style("px-4");
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## How to fix
|
|
33
|
+
|
|
34
|
+
Use the suggested form. The automatic fix applies it.
|
|
35
|
+
|
|
36
|
+
## Options
|
|
37
|
+
|
|
38
|
+
`pxToRem` compares `px` values with `rem` values by using `rootFontSize`. With the
|
|
39
|
+
default root size of 16px, `px-[16px]` matches `px-4`, which is `1rem`. Turn the
|
|
40
|
+
option off if your documents use another root size and you have not set
|
|
41
|
+
`rootFontSize`.
|
|
42
|
+
|
|
43
|
+
`collapse` controls whether several utilities can share one replacement. It defaults
|
|
44
|
+
to `true`. Set it to `false` to keep each utility separate.
|
|
45
|
+
|
|
46
|
+
`logicalToPhysical` allows logical properties to match physical properties under
|
|
47
|
+
horizontal, left-to-right writing. It defaults to `false`. Enable it only when that
|
|
48
|
+
writing mode is appropriate for your document.
|
|
49
|
+
|
|
50
|
+
`preserveSpecificity` defaults to `true`. Set it to `false` to allow Tailwind's ancestor
|
|
51
|
+
variant migrations, such as `[p_&]` to `in-[p]`. That replacement uses `:where()` and
|
|
52
|
+
reduces specificity.
|
|
53
|
+
|
|
54
|
+
## Rule settings
|
|
55
|
+
|
|
56
|
+
| Preset | Severity |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| `recommended` | warn |
|
|
59
|
+
| `strict` | deny |
|
|
60
|
+
| `stylistic` | off |
|
|
61
|
+
|
|
62
|
+
| Option | Default |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| `pxToRem` | `true` |
|
|
65
|
+
| `collapse` | `true` |
|
|
66
|
+
| `logicalToPhysical` | `false` |
|
|
67
|
+
| `preserveSpecificity` | `true` |
|
|
68
|
+
|
|
69
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "prefer-direct-styling"
|
|
3
|
+
description: "Reports a selector variant that styles another element, such as [&_button]:."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# prefer-direct-styling
|
|
7
|
+
|
|
8
|
+
This rule reports a selector variant that styles another element from the
|
|
9
|
+
current one, such as `[&_button]:` on a parent. The styles of the button then
|
|
10
|
+
live in the parent, so reading the button does not show them. The `stylistic`
|
|
11
|
+
preset enables this rule.
|
|
12
|
+
|
|
13
|
+
## Reported
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const toolbar = style("flex gap-2 [&_button]:p-4");
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> prefer-direct-styling: variant selector `& button` styles another element. Attach these styles directly to that element
|
|
20
|
+
>
|
|
21
|
+
> Example:1:35
|
|
22
|
+
|
|
23
|
+
## Fixed
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
const toolbar = style("flex gap-2");
|
|
27
|
+
const button = style("p-4");
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## How to fix
|
|
31
|
+
|
|
32
|
+
- Give the styles to the element itself with its own `style()` call, as in the
|
|
33
|
+
example.
|
|
34
|
+
- If the element comes from markup that you cannot change, such as rendered
|
|
35
|
+
Markdown, keep the selector and add a
|
|
36
|
+
[suppression comment](../configuration.md#suppression-comments) with the
|
|
37
|
+
reason.
|
|
38
|
+
|
|
39
|
+
## Rule settings
|
|
40
|
+
|
|
41
|
+
| Preset | Severity |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `recommended` | off |
|
|
44
|
+
| `strict` | off |
|
|
45
|
+
| `stylistic` | warn |
|
|
46
|
+
|
|
47
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "prefer-explicit-nesting-selector"
|
|
3
|
+
description: "Reports a custom variant selector without &, which matches descendants."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# prefer-explicit-nesting-selector
|
|
7
|
+
|
|
8
|
+
This rule reports a `@custom-variant` selector without `&`. Without `&`, the
|
|
9
|
+
selector matches descendants of the element, not the element itself. In the
|
|
10
|
+
example, `hocus:` would match hovered elements inside the element.
|
|
11
|
+
|
|
12
|
+
## Reported
|
|
13
|
+
|
|
14
|
+
```css
|
|
15
|
+
@custom-variant hocus (:hover);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
> prefer-explicit-nesting-selector: variant selector `:hover` is relative to `&` and means `& :hover`; write the `&`, or add `scope(document)` to the definition to select a document-level element
|
|
19
|
+
>
|
|
20
|
+
> Example:1:24
|
|
21
|
+
|
|
22
|
+
## Fixed
|
|
23
|
+
|
|
24
|
+
```css
|
|
25
|
+
@custom-variant hocus (&:hover);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## How to fix
|
|
29
|
+
|
|
30
|
+
- Add `&` where the element belongs in the selector, as in the example.
|
|
31
|
+
- If the variant should match descendants, write that explicitly, such as
|
|
32
|
+
`(& :hover)`.
|
|
33
|
+
|
|
34
|
+
## Rule settings
|
|
35
|
+
|
|
36
|
+
| Preset | Severity |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `recommended` | warn |
|
|
39
|
+
| `strict` | deny |
|
|
40
|
+
| `stylistic` | off |
|
|
41
|
+
|
|
42
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "prefer-logical-properties"
|
|
3
|
+
description: "Reports a physical property that has a logical form, such as ml-4 for ms-4."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# prefer-logical-properties
|
|
7
|
+
|
|
8
|
+
This rule reports a utility for a physical property that has a logical form, such
|
|
9
|
+
as `ml-4` (left) for `ms-4` (start). A logical property follows the writing
|
|
10
|
+
direction, so the layout also works in right-to-left languages. The `stylistic`
|
|
11
|
+
preset enables this rule.
|
|
12
|
+
|
|
13
|
+
## Reported
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
style("ml-4");
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> prefer-logical-properties: prefer a logical declaration for `margin-left: calc(var(--spacing) * 4)`
|
|
20
|
+
>
|
|
21
|
+
> Example:1:8
|
|
22
|
+
|
|
23
|
+
## Fixed
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
style("ms-4");
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## How to fix
|
|
30
|
+
|
|
31
|
+
- If the margin separates the element from the content before it, use the
|
|
32
|
+
logical form, as in the example.
|
|
33
|
+
- If the side must stay on the left in every language, such as for an icon that
|
|
34
|
+
points left, keep the physical form and add a
|
|
35
|
+
[suppression comment](../configuration.md#suppression-comments).
|
|
36
|
+
|
|
37
|
+
## Rule settings
|
|
38
|
+
|
|
39
|
+
| Preset | Severity |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `recommended` | off |
|
|
42
|
+
| `strict` | off |
|
|
43
|
+
| `stylistic` | warn |
|
|
44
|
+
|
|
45
|
+
| Option | Default |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| `checkImplementation` | `false` |
|
|
48
|
+
|
|
49
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "prefer-sorted-utilities"
|
|
3
|
+
description: "Reports utilities that are not in sorted order."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# prefer-sorted-utilities
|
|
7
|
+
|
|
8
|
+
This rule reports utilities that are not in the order that `stillwind fmt` uses.
|
|
9
|
+
The order does not change the CSS. A consistent order makes utilities easier to
|
|
10
|
+
read and diffs smaller. The `stylistic` preset enables this rule.
|
|
11
|
+
|
|
12
|
+
## Reported
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
style("px-4 flex");
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
> prefer-sorted-utilities: utilities are not in compiler order
|
|
19
|
+
>
|
|
20
|
+
> Example:1:8
|
|
21
|
+
|
|
22
|
+
## Fixed
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
style("flex px-4");
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## How to fix
|
|
29
|
+
|
|
30
|
+
Run `stillwind fmt`, or `stillwind lint --fix` with this rule enabled. The editor
|
|
31
|
+
also sorts on save with `source.sort.stillwind`.
|
|
32
|
+
|
|
33
|
+
`stillwind fmt` sorts even when this rule is off. To stop all sorting, set
|
|
34
|
+
`sort: false`. See [Sorting](../configuration.md#sorting).
|
|
35
|
+
|
|
36
|
+
## Rule settings
|
|
37
|
+
|
|
38
|
+
| Preset | Severity |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `recommended` | off |
|
|
41
|
+
| `strict` | off |
|
|
42
|
+
| `stylistic` | warn |
|
|
43
|
+
|
|
44
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
45
|
+
|
|
46
|
+
The CLI and the editor report this rule only when they analyze the whole project.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "prefer-typed-relationships"
|
|
3
|
+
description: "Reports group-* and peer-* variants that a ref can replace."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# prefer-typed-relationships
|
|
7
|
+
|
|
8
|
+
This rule reports `group-*` and `peer-*` variants. They connect elements through
|
|
9
|
+
the class names `group` and `peer`, so any element with the same class can
|
|
10
|
+
match, and nothing checks a misspelled name. A ref connects the elements through a
|
|
11
|
+
variable instead. The `stylistic` preset enables this rule.
|
|
12
|
+
|
|
13
|
+
## Reported
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
style("group-hover:text-red-500");
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> prefer-typed-relationships: Tailwind relationship utility `group-hover:text-red-500` is forbidden; use style.ref() and specify shared scopes with in()
|
|
20
|
+
>
|
|
21
|
+
> Example:1:8
|
|
22
|
+
|
|
23
|
+
## Fixed
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
const card = style.ref("card");
|
|
27
|
+
const container = style(card);
|
|
28
|
+
const title = style({ [card("hover")]: "text-red-500" });
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## How to fix
|
|
32
|
+
|
|
33
|
+
- Replace `group` with a ref on the parent, and `group-hover:` with a condition on
|
|
34
|
+
that ref, as in the example.
|
|
35
|
+
- Replace `peer` with a ref on the sibling, and use
|
|
36
|
+
[`.in()`](../macros/ref/in.md) with a ref on a shared ancestor.
|
|
37
|
+
|
|
38
|
+
See [Element relationships](../guides/element-relationships.md).
|
|
39
|
+
|
|
40
|
+
## Rule settings
|
|
41
|
+
|
|
42
|
+
| Preset | Severity |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `recommended` | off |
|
|
45
|
+
| `strict` | off |
|
|
46
|
+
| `stylistic` | warn |
|
|
47
|
+
|
|
48
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "prefer-typed-variables"
|
|
3
|
+
description: "Reports a custom property without a type in a utility that accepts several types."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# prefer-typed-variables
|
|
7
|
+
|
|
8
|
+
This rule reports a custom property without a type in a utility that accepts
|
|
9
|
+
several types. For example, `text-*` sets a color or a font size, so
|
|
10
|
+
`text-(--brand)` does not show which one you mean. The `stylistic` preset enables
|
|
11
|
+
this rule.
|
|
12
|
+
|
|
13
|
+
## Reported
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
style("text-(--brand)");
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> prefer-typed-variables: `text-(--brand)` has no type hint, so it uses the `color` definition; write `text-(color:--brand)` to state the type
|
|
20
|
+
>
|
|
21
|
+
> Example:1:13
|
|
22
|
+
|
|
23
|
+
## Fixed
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
style("text-(color:--brand)");
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## How to fix
|
|
30
|
+
|
|
31
|
+
Add the type that the custom property holds, such as `color:` in the example, or
|
|
32
|
+
`length:` for a font size. The type only chooses the meaning of the utility. It
|
|
33
|
+
does not check the value that the property receives at runtime.
|
|
34
|
+
|
|
35
|
+
## Rule settings
|
|
36
|
+
|
|
37
|
+
| Preset | Severity |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `recommended` | off |
|
|
40
|
+
| `strict` | off |
|
|
41
|
+
| `stylistic` | warn |
|
|
42
|
+
|
|
43
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "prefer-variant-directive"
|
|
3
|
+
description: "Reports a condition in your stylesheet that a named variant can replace."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# prefer-variant-directive
|
|
7
|
+
|
|
8
|
+
This rule reports a condition in a rule of your stylesheet, such as an `@media`
|
|
9
|
+
query, that a variant of your theme expresses with the same meaning. The named
|
|
10
|
+
variant keeps the stylesheet in sync when the theme changes the breakpoint. The
|
|
11
|
+
`stylistic` preset enables this rule.
|
|
12
|
+
|
|
13
|
+
## Reported
|
|
14
|
+
|
|
15
|
+
```css
|
|
16
|
+
.card {
|
|
17
|
+
@media (width >= 48rem) {
|
|
18
|
+
display: flex;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
> prefer-variant-directive: `@media (width >= 48rem)` applies the same condition as variant `md`; write `@variant md`
|
|
24
|
+
>
|
|
25
|
+
> Example:2:3
|
|
26
|
+
|
|
27
|
+
## Fixed
|
|
28
|
+
|
|
29
|
+
```css
|
|
30
|
+
.card {
|
|
31
|
+
@variant md {
|
|
32
|
+
display: flex;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## How to fix
|
|
38
|
+
|
|
39
|
+
Replace the condition with `@variant` and the name of the variant, as in the
|
|
40
|
+
example. The automatic fix applies it.
|
|
41
|
+
|
|
42
|
+
## Options
|
|
43
|
+
|
|
44
|
+
`pxToRem` treats `px` and `rem` in media queries as equal at 16px per `rem`. With
|
|
45
|
+
it, `@media (width >= 768px)` also matches `md`.
|
|
46
|
+
|
|
47
|
+
## Rule settings
|
|
48
|
+
|
|
49
|
+
| Preset | Severity |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `recommended` | off |
|
|
52
|
+
| `strict` | off |
|
|
53
|
+
| `stylistic` | warn |
|
|
54
|
+
|
|
55
|
+
| Option | Default |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `pxToRem` | `false` |
|
|
58
|
+
|
|
59
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "redundant-variant"
|
|
3
|
+
description: "Reports a variant that adds no condition, such as hover:hover:."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# redundant-variant
|
|
7
|
+
|
|
8
|
+
This rule reports a variant that adds no condition, such as a second `hover:` in
|
|
9
|
+
`hover:hover:`. It also reports a variant that another variant in the stack
|
|
10
|
+
already implies. With the default breakpoints, `sm:` is redundant in `sm:md:`
|
|
11
|
+
because every width that matches `md:` also matches `sm:`.
|
|
12
|
+
|
|
13
|
+
## Reported
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
style("hover:hover:p-4");
|
|
17
|
+
style("sm:md:p-4");
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
> redundant-variant: variant `hover` repeats the earlier `hover` and has no effect
|
|
21
|
+
>
|
|
22
|
+
> Example:1:14
|
|
23
|
+
|
|
24
|
+
> redundant-variant: variant `sm` has no effect because `md` implies its condition
|
|
25
|
+
>
|
|
26
|
+
> Example:2:8
|
|
27
|
+
|
|
28
|
+
## Fixed
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
style("hover:p-4");
|
|
32
|
+
style("md:p-4");
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## How to fix
|
|
36
|
+
|
|
37
|
+
Remove the extra variant, and keep the others. The automatic fix removes it.
|
|
38
|
+
|
|
39
|
+
Variants that can never match together are reported by
|
|
40
|
+
[unsatisfiable-variants](unsatisfiable-variants.md) instead.
|
|
41
|
+
|
|
42
|
+
## Rule settings
|
|
43
|
+
|
|
44
|
+
| Preset | Severity |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `recommended` | warn |
|
|
47
|
+
| `strict` | deny |
|
|
48
|
+
| `stylistic` | off |
|
|
49
|
+
|
|
50
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "repeated-nesting-selector"
|
|
3
|
+
description: "Reports a selector that repeats & to relate two elements, such as [&+&]."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# repeated-nesting-selector
|
|
7
|
+
|
|
8
|
+
This rule reports a selector variant that repeats `&`, such as `[&+&]:`, to relate
|
|
9
|
+
two elements. `&` stands for the generated class of the style, so the selector
|
|
10
|
+
matches any two elements that share the style. When the style is shared or used
|
|
11
|
+
as a base, it can match pairs that you did not mean.
|
|
12
|
+
|
|
13
|
+
## Reported
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
function Items({ labels }: { labels: string[] }) {
|
|
17
|
+
return (
|
|
18
|
+
<div>
|
|
19
|
+
{labels.map((label) => (
|
|
20
|
+
<div {...style("[&+&]:mt-4")}>{label}</div>
|
|
21
|
+
))}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
> repeated-nesting-selector: `&+&` uses `&` more than once, so it matches by generated class identity; relate elements with style.ref()
|
|
28
|
+
>
|
|
29
|
+
> Example:5:25
|
|
30
|
+
|
|
31
|
+
## Fixed
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
function Items({ labels }: { labels: string[] }) {
|
|
35
|
+
return (
|
|
36
|
+
<div {...style("flex flex-col gap-4")}>
|
|
37
|
+
{labels.map((label) => (
|
|
38
|
+
<div>{label}</div>
|
|
39
|
+
))}
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## How to fix
|
|
46
|
+
|
|
47
|
+
- To space items in a list, put `gap` on the list, as in the example.
|
|
48
|
+
- To style an element from the state of a sibling, use refs with
|
|
49
|
+
[`.in()`](../macros/ref/in.md).
|
|
50
|
+
|
|
51
|
+
## Rule settings
|
|
52
|
+
|
|
53
|
+
| Preset | Severity |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `recommended` | warn |
|
|
56
|
+
| `strict` | deny |
|
|
57
|
+
| `stylistic` | off |
|
|
58
|
+
|
|
59
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "runtime-condition-requires-css-if"
|
|
3
|
+
description: "Reports a runtime CSS condition that needs the useCssIf setting."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# runtime-condition-requires-css-if
|
|
7
|
+
|
|
8
|
+
This rule reports a runtime CSS condition, such as `if(--state:active):`, that
|
|
9
|
+
the compiler can only express with the native CSS `if()` function. The project
|
|
10
|
+
does not enable it, so the utility produces no CSS.
|
|
11
|
+
|
|
12
|
+
## Reported
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
style("if(--state:active):block");
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
> runtime-condition-requires-css-if: `if(--state:active):block` cannot be lowered: custom-property value comparisons require useCssIf: true
|
|
19
|
+
>
|
|
20
|
+
> Example:1:8
|
|
21
|
+
|
|
22
|
+
## Fixed
|
|
23
|
+
|
|
24
|
+
```ts title="stillwind.config.ts"
|
|
25
|
+
import { defineConfig } from "stillwind/config";
|
|
26
|
+
|
|
27
|
+
export default defineConfig({
|
|
28
|
+
projects: [
|
|
29
|
+
{
|
|
30
|
+
css: "./src/stillwind.css",
|
|
31
|
+
files: ["src/**/*.{ts,tsx}"],
|
|
32
|
+
useCssIf: true,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
style("if(--state:active):block");
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## How to fix
|
|
43
|
+
|
|
44
|
+
- If the browsers that you support implement CSS `if()`, set `useCssIf: true` in
|
|
45
|
+
the project, as in the example. Keep the condition on the custom property.
|
|
46
|
+
- Otherwise, represent the state with an attribute and use an attribute variant.
|
|
47
|
+
That requires changing the code that sets the state as well.
|
|
48
|
+
|
|
49
|
+
See [Configuration](../configuration.md#generated-css).
|
|
50
|
+
|
|
51
|
+
## Rule settings
|
|
52
|
+
|
|
53
|
+
| Preset | Severity |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `recommended` | deny |
|
|
56
|
+
| `strict` | deny |
|
|
57
|
+
| `stylistic` | off |
|
|
58
|
+
|
|
59
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "split-view-transition-class"
|
|
3
|
+
description: "Reports view transitions split across separate style() calls."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# split-view-transition-class
|
|
7
|
+
|
|
8
|
+
This rule reports view transitions that reach one element through separate
|
|
9
|
+
`style()` calls, such as a base style and the call that receives it. Each call
|
|
10
|
+
sets the whole `view-transition-class` list, so one list replaces the other.
|
|
11
|
+
|
|
12
|
+
## Reported
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
const first = style.viewTransition({ old: "duration-150" });
|
|
16
|
+
const second = style.viewTransition({ new: "duration-150" });
|
|
17
|
+
const base = style(first.for("card"));
|
|
18
|
+
style(base, second);
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
> split-view-transition-class: view-transition-class is one property: this call's list replaces the one its composed base declares, so declare the transitions in one call
|
|
22
|
+
>
|
|
23
|
+
> Example:4:1
|
|
24
|
+
|
|
25
|
+
## Fixed
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
const first = style.viewTransition({ old: "duration-150" });
|
|
29
|
+
const second = style.viewTransition({ new: "duration-150" });
|
|
30
|
+
style(first, second.for("card"));
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## How to fix
|
|
34
|
+
|
|
35
|
+
Pass every transition of the element to the same `style()` call, with one
|
|
36
|
+
`.for()`, as in the example. You can still store and share the transition
|
|
37
|
+
definitions themselves.
|
|
38
|
+
|
|
39
|
+
## Rule settings
|
|
40
|
+
|
|
41
|
+
| Preset | Severity |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `recommended` | warn |
|
|
44
|
+
| `strict` | deny |
|
|
45
|
+
| `stylistic` | off |
|
|
46
|
+
|
|
47
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "suspending-macro-argument"
|
|
3
|
+
description: "Reports await, yield, or import() inside an argument of style() or another macro."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# suspending-macro-argument
|
|
7
|
+
|
|
8
|
+
This rule reports `await`, `yield`, or a dynamic `import()` inside an argument of
|
|
9
|
+
`style()` or another macro. The compiler can move or skip argument expressions,
|
|
10
|
+
so the code would not wait or load where you wrote it.
|
|
11
|
+
|
|
12
|
+
## Reported
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
async function props() {
|
|
16
|
+
return style({ "--x": await Promise.resolve(1) });
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
> suspending-macro-argument: evaluate await, yield, and dynamic imports outside macro arguments, then pass their values
|
|
21
|
+
>
|
|
22
|
+
> Example:2:25
|
|
23
|
+
|
|
24
|
+
## Fixed
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
async function props() {
|
|
28
|
+
const value = await Promise.resolve(1);
|
|
29
|
+
return style({ "--x": value });
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## How to fix
|
|
34
|
+
|
|
35
|
+
Wait for the value before the call, store it in a variable, and pass the
|
|
36
|
+
variable, as in the example.
|
|
37
|
+
|
|
38
|
+
## Rule settings
|
|
39
|
+
|
|
40
|
+
| Preset | Severity |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `recommended` | deny |
|
|
43
|
+
| `strict` | deny |
|
|
44
|
+
| `stylistic` | off |
|
|
45
|
+
|
|
46
|
+
[Configure lint](../configuration.md#lint) to change the severity or options.
|