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.
Files changed (305) hide show
  1. package/AGENTS_TEMPLATE.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +166 -0
  4. package/TAILWINDCSS-MIT-LICENSE +21 -0
  5. package/css/builtin-metadata/sw-motion-properties.css +186 -0
  6. package/css/builtin-metadata/tw-legacy-metadata.css +36 -0
  7. package/css/builtin-metadata/tw-properties.css +944 -0
  8. package/css/builtin-metadata/tw-registry-metadata.css +52 -0
  9. package/css/builtin-metadata/tw-relationship-metadata.css +10 -0
  10. package/css/builtin-utilities/sw-motion-contexts.css +1043 -0
  11. package/css/builtin-utilities/tw-backgrounds.css +606 -0
  12. package/css/builtin-utilities/tw-borders.css +954 -0
  13. package/css/builtin-utilities/tw-effects.css +1209 -0
  14. package/css/builtin-utilities/tw-flex-grid.css +749 -0
  15. package/css/builtin-utilities/tw-interactivity.css +680 -0
  16. package/css/builtin-utilities/tw-layout.css +943 -0
  17. package/css/builtin-utilities/tw-masks.css +1268 -0
  18. package/css/builtin-utilities/tw-motion.css +142 -0
  19. package/css/builtin-utilities/tw-spacing-sizing.css +621 -0
  20. package/css/builtin-utilities/tw-svg.css +50 -0
  21. package/css/builtin-utilities/tw-transforms.css +652 -0
  22. package/css/builtin-utilities/tw-typography.css +720 -0
  23. package/css/builtin-variants/sw-conditional.css +5 -0
  24. package/css/builtin-variants/sw-document.css +13 -0
  25. package/css/builtin-variants/tw-conditional.css +187 -0
  26. package/css/builtin-variants/tw-dynamic-selector.css +49 -0
  27. package/css/builtin-variants/tw-relationship.css +41 -0
  28. package/css/builtin-variants/tw-state.css +159 -0
  29. package/css/builtin-variants/tw-structural.css +121 -0
  30. package/css/builtins.css +111 -0
  31. package/css/preflight.css +401 -0
  32. package/css/templates.css +40 -0
  33. package/css/theme.css +546 -0
  34. package/css/utilities.css +9 -0
  35. package/dist/class-object-D24FFYqO.js +6 -0
  36. package/dist/class-object-D24FFYqO.js.map +1 -0
  37. package/dist/class-object-D7ZGJOf_.d.ts +9 -0
  38. package/dist/class-string-CQHnc9GN.d.ts +9 -0
  39. package/dist/class-string-Db8-oI4q.js +6 -0
  40. package/dist/class-string-Db8-oI4q.js.map +1 -0
  41. package/dist/config.d.ts +1 -0
  42. package/dist/config.js +2 -0
  43. package/dist/css.d.ts +100 -0
  44. package/dist/css.js +143 -0
  45. package/dist/css.js.map +1 -0
  46. package/dist/cva-BwX07CFw.js +204 -0
  47. package/dist/cva-BwX07CFw.js.map +1 -0
  48. package/dist/cva-DSpDNBYi.d.ts +9 -0
  49. package/dist/development-DttPQc71.d.ts +27 -0
  50. package/dist/development-J-JCSIm0.js +111 -0
  51. package/dist/development-J-JCSIm0.js.map +1 -0
  52. package/dist/frameworks/alpine.d.ts +20 -0
  53. package/dist/frameworks/alpine.js +18 -0
  54. package/dist/frameworks/alpine.js.map +1 -0
  55. package/dist/frameworks/astro.d.ts +3 -0
  56. package/dist/frameworks/astro.js +1 -0
  57. package/dist/frameworks/lit.d.ts +21 -0
  58. package/dist/frameworks/lit.js +38 -0
  59. package/dist/frameworks/lit.js.map +1 -0
  60. package/dist/frameworks/preact.d.ts +3 -0
  61. package/dist/frameworks/preact.js +1 -0
  62. package/dist/frameworks/qwik.d.ts +3 -0
  63. package/dist/frameworks/qwik.js +1 -0
  64. package/dist/frameworks/react.d.ts +10 -0
  65. package/dist/frameworks/react.js +6 -0
  66. package/dist/frameworks/react.js.map +1 -0
  67. package/dist/frameworks/solid.d.ts +3 -0
  68. package/dist/frameworks/solid.js +1 -0
  69. package/dist/frameworks/svelte.d.ts +3 -0
  70. package/dist/frameworks/svelte.js +1 -0
  71. package/dist/frameworks/vanilla.d.ts +27 -0
  72. package/dist/frameworks/vanilla.js +3 -0
  73. package/dist/frameworks/vue.d.ts +3 -0
  74. package/dist/frameworks/vue.js +1 -0
  75. package/dist/index-RwVFpxhE.d.ts +815 -0
  76. package/dist/macro/index.d.ts +2 -0
  77. package/dist/macro/index.js +1 -0
  78. package/dist/module-css.d.ts +30 -0
  79. package/dist/module-css.js +23 -0
  80. package/dist/module-css.js.map +1 -0
  81. package/dist/runtime/class-name-object-development.d.ts +10 -0
  82. package/dist/runtime/class-name-object-development.js +18 -0
  83. package/dist/runtime/class-name-object-development.js.map +1 -0
  84. package/dist/runtime/class-name-object.d.ts +16 -0
  85. package/dist/runtime/class-name-object.js +31 -0
  86. package/dist/runtime/class-name-object.js.map +1 -0
  87. package/dist/runtime/class-object-development.d.ts +10 -0
  88. package/dist/runtime/class-object-development.js +18 -0
  89. package/dist/runtime/class-object-development.js.map +1 -0
  90. package/dist/runtime/class-object.d.ts +16 -0
  91. package/dist/runtime/class-object.js +31 -0
  92. package/dist/runtime/class-object.js.map +1 -0
  93. package/dist/runtime/class-string-development.d.ts +10 -0
  94. package/dist/runtime/class-string-development.js +18 -0
  95. package/dist/runtime/class-string-development.js.map +1 -0
  96. package/dist/runtime/class-string.d.ts +16 -0
  97. package/dist/runtime/class-string.js +31 -0
  98. package/dist/runtime/class-string.js.map +1 -0
  99. package/dist/shared-B9IQXU6P.d.ts +32 -0
  100. package/dist/style-BV4ctkni.js +78 -0
  101. package/dist/style-BV4ctkni.js.map +1 -0
  102. package/dist/style-fTQbsVWZ.js +41 -0
  103. package/dist/style-fTQbsVWZ.js.map +1 -0
  104. package/docs/agents.md +76 -0
  105. package/docs/at-rules/apply.md +93 -0
  106. package/docs/at-rules/custom-variant.md +127 -0
  107. package/docs/at-rules/index.md +75 -0
  108. package/docs/at-rules/plugin.md +71 -0
  109. package/docs/at-rules/registry-directives.md +181 -0
  110. package/docs/at-rules/slot.md +58 -0
  111. package/docs/at-rules/stillwind-css-template.md +126 -0
  112. package/docs/at-rules/stillwind-property.md +133 -0
  113. package/docs/at-rules/stillwind-registry.md +115 -0
  114. package/docs/at-rules/stillwind-require-properties.md +91 -0
  115. package/docs/at-rules/stillwind-slot.md +85 -0
  116. package/docs/at-rules/stillwind-undef-arbitrary-property.md +75 -0
  117. package/docs/at-rules/stillwind-undef-utility.md +87 -0
  118. package/docs/at-rules/stillwind-undef-variant.md +55 -0
  119. package/docs/at-rules/theme.md +304 -0
  120. package/docs/at-rules/utility.md +286 -0
  121. package/docs/at-rules/variant.md +91 -0
  122. package/docs/concepts/css-ordering.md +245 -0
  123. package/docs/concepts/how-styles-compile.md +132 -0
  124. package/docs/configuration.md +298 -0
  125. package/docs/errors/SW01001.md +51 -0
  126. package/docs/errors/SW01002.md +52 -0
  127. package/docs/errors/SW01003.md +69 -0
  128. package/docs/errors/SW02001.md +23 -0
  129. package/docs/errors/SW02002.md +51 -0
  130. package/docs/errors/SW03001.md +71 -0
  131. package/docs/errors/SW03002.md +79 -0
  132. package/docs/errors/SW03003.md +36 -0
  133. package/docs/errors/SW10001.md +34 -0
  134. package/docs/errors/SW10002.md +36 -0
  135. package/docs/errors/SW10003.md +30 -0
  136. package/docs/errors/SW10004.md +39 -0
  137. package/docs/errors/SW10005.md +35 -0
  138. package/docs/errors/SW11001.md +37 -0
  139. package/docs/errors/SW11002.md +65 -0
  140. package/docs/errors/SW11003.md +20 -0
  141. package/docs/errors/SW12001.md +43 -0
  142. package/docs/errors/SW12002.md +42 -0
  143. package/docs/errors/SW13001.md +35 -0
  144. package/docs/errors/SW13002.md +33 -0
  145. package/docs/errors/SW13003.md +18 -0
  146. package/docs/errors/SW13004.md +45 -0
  147. package/docs/errors/SW14001.md +44 -0
  148. package/docs/errors/SW14002.md +47 -0
  149. package/docs/errors/SW14003.md +38 -0
  150. package/docs/errors/SW14004.md +48 -0
  151. package/docs/errors/SW14005.md +51 -0
  152. package/docs/errors/SW14006.md +19 -0
  153. package/docs/errors/SW14007.md +35 -0
  154. package/docs/errors/SW14008.md +41 -0
  155. package/docs/errors/SW15001.md +18 -0
  156. package/docs/errors/SW15002.md +19 -0
  157. package/docs/errors/SW15003.md +16 -0
  158. package/docs/errors/SW30001.md +21 -0
  159. package/docs/errors/SW30002.md +18 -0
  160. package/docs/errors/SW30003.md +17 -0
  161. package/docs/errors/SW30004.md +18 -0
  162. package/docs/errors/SW31001.md +20 -0
  163. package/docs/errors/SW31002.md +17 -0
  164. package/docs/errors/SW31003.md +18 -0
  165. package/docs/errors/SW31004.md +20 -0
  166. package/docs/errors/SW31005.md +18 -0
  167. package/docs/errors/SW31006.md +17 -0
  168. package/docs/errors/SW31007.md +18 -0
  169. package/docs/errors/SW31008.md +16 -0
  170. package/docs/errors/SW31009.md +18 -0
  171. package/docs/errors/SW31010.md +16 -0
  172. package/docs/errors/SW31011.md +17 -0
  173. package/docs/errors/SW32001.md +18 -0
  174. package/docs/errors/SW32002.md +45 -0
  175. package/docs/errors/SW32003.md +43 -0
  176. package/docs/errors/SW32004.md +17 -0
  177. package/docs/errors/SW32005.md +40 -0
  178. package/docs/errors/SW32006.md +18 -0
  179. package/docs/errors/SW32007.md +20 -0
  180. package/docs/errors/SW33001.md +17 -0
  181. package/docs/errors/SW33002.md +17 -0
  182. package/docs/errors/SW33003.md +17 -0
  183. package/docs/errors/SW33004.md +17 -0
  184. package/docs/errors/SW33005.md +20 -0
  185. package/docs/errors/SW34001.md +18 -0
  186. package/docs/errors/SW34002.md +17 -0
  187. package/docs/errors/SW34003.md +18 -0
  188. package/docs/errors/SW90001.md +17 -0
  189. package/docs/errors/SW90002.md +18 -0
  190. package/docs/errors/SW90003.md +17 -0
  191. package/docs/errors/SW90004.md +17 -0
  192. package/docs/errors/SW90005.md +16 -0
  193. package/docs/errors/SW90006.md +17 -0
  194. package/docs/errors/SW90007.md +17 -0
  195. package/docs/errors/SW90008.md +17 -0
  196. package/docs/errors/index.md +125 -0
  197. package/docs/guides/animations.md +73 -0
  198. package/docs/guides/design-systems.md +119 -0
  199. package/docs/guides/element-relationships.md +136 -0
  200. package/docs/guides/lint-adoption.md +128 -0
  201. package/docs/guides/migrating-from-css.md +126 -0
  202. package/docs/guides/migrating-from-tailwind.md +179 -0
  203. package/docs/guides/recommended-practices.md +338 -0
  204. package/docs/guides/responsive-styles.md +103 -0
  205. package/docs/guides/reusable-styles.md +110 -0
  206. package/docs/guides/style.md +181 -0
  207. package/docs/guides/tailwind-compatibility.md +126 -0
  208. package/docs/guides/view-transitions.md +84 -0
  209. package/docs/guides/web-components.md +216 -0
  210. package/docs/index.md +136 -0
  211. package/docs/integrations.md +190 -0
  212. package/docs/lints/ambiguous-style-base-order.md +50 -0
  213. package/docs/lints/bypassed-undefinition.md +50 -0
  214. package/docs/lints/clamped-value.md +44 -0
  215. package/docs/lints/conflicting-provider-properties.md +47 -0
  216. package/docs/lints/conflicting-utilities.md +55 -0
  217. package/docs/lints/document-scoped-selector.md +45 -0
  218. package/docs/lints/duplicate-definition.md +44 -0
  219. package/docs/lints/duplicate-utility.md +44 -0
  220. package/docs/lints/duplicate-view-transition-name.md +45 -0
  221. package/docs/lints/ignored-definition-condition.md +51 -0
  222. package/docs/lints/ignored-tailwind-feature.md +62 -0
  223. package/docs/lints/incompatible-property-value.md +60 -0
  224. package/docs/lints/incompatible-theme-value.md +46 -0
  225. package/docs/lints/index.md +140 -0
  226. package/docs/lints/ineffective-anchor-scope.md +46 -0
  227. package/docs/lints/interfering-imported-style-base.md +57 -0
  228. package/docs/lints/invalid-animation-option.md +47 -0
  229. package/docs/lints/invalid-css-directive.md +43 -0
  230. package/docs/lints/invalid-css-import.md +43 -0
  231. package/docs/lints/invalid-css-input.md +45 -0
  232. package/docs/lints/invalid-cva-config.md +46 -0
  233. package/docs/lints/invalid-cva-input.md +50 -0
  234. package/docs/lints/invalid-keyframes-definition.md +47 -0
  235. package/docs/lints/invalid-keyframes-use.md +47 -0
  236. package/docs/lints/invalid-keyframes-variant.md +48 -0
  237. package/docs/lints/invalid-lint-suppression.md +47 -0
  238. package/docs/lints/invalid-marker-use.md +53 -0
  239. package/docs/lints/invalid-media-query.md +52 -0
  240. package/docs/lints/invalid-ref-input.md +49 -0
  241. package/docs/lints/invalid-rule-group-input.md +58 -0
  242. package/docs/lints/invalid-runtime-condition.md +67 -0
  243. package/docs/lints/invalid-style-composition.md +52 -0
  244. package/docs/lints/invalid-style-input.md +47 -0
  245. package/docs/lints/invalid-theme-reference.md +52 -0
  246. package/docs/lints/invalid-utility.md +44 -0
  247. package/docs/lints/invalid-variant.md +45 -0
  248. package/docs/lints/invalid-view-transition-definition.md +46 -0
  249. package/docs/lints/invalid-view-transition-use.md +46 -0
  250. package/docs/lints/invalid-view-transition-variant.md +51 -0
  251. package/docs/lints/mismatched-framework-import.md +47 -0
  252. package/docs/lints/missing-document-target.md +44 -0
  253. package/docs/lints/missing-ref-attachment.md +44 -0
  254. package/docs/lints/missing-view-transition-name.md +46 -0
  255. package/docs/lints/mutating-macro-argument.md +48 -0
  256. package/docs/lints/no-arbitrary-breakpoints.md +50 -0
  257. package/docs/lints/no-arbitrary-colors.md +51 -0
  258. package/docs/lints/no-arbitrary-spacing.md +57 -0
  259. package/docs/lints/no-class-property.md +58 -0
  260. package/docs/lints/no-important.md +50 -0
  261. package/docs/lints/no-restricted-declarations.md +76 -0
  262. package/docs/lints/no-restricted-length-units.md +73 -0
  263. package/docs/lints/no-restricted-theme-tokens.md +73 -0
  264. package/docs/lints/no-restricted-utilities.md +73 -0
  265. package/docs/lints/prefer-canonical-utilities.md +69 -0
  266. package/docs/lints/prefer-direct-styling.md +47 -0
  267. package/docs/lints/prefer-explicit-nesting-selector.md +42 -0
  268. package/docs/lints/prefer-logical-properties.md +49 -0
  269. package/docs/lints/prefer-sorted-utilities.md +46 -0
  270. package/docs/lints/prefer-typed-relationships.md +48 -0
  271. package/docs/lints/prefer-typed-variables.md +43 -0
  272. package/docs/lints/prefer-variant-directive.md +59 -0
  273. package/docs/lints/redundant-variant.md +50 -0
  274. package/docs/lints/repeated-nesting-selector.md +59 -0
  275. package/docs/lints/runtime-condition-requires-css-if.md +59 -0
  276. package/docs/lints/split-view-transition-class.md +47 -0
  277. package/docs/lints/suspending-macro-argument.md +46 -0
  278. package/docs/lints/unknown-utility.md +47 -0
  279. package/docs/lints/unknown-variant.md +42 -0
  280. package/docs/lints/unsatisfiable-variants.md +42 -0
  281. package/docs/lints/unused-lint-suppression.md +57 -0
  282. package/docs/lints/unverified-style-base.md +64 -0
  283. package/docs/macros/anchor-scope.md +90 -0
  284. package/docs/macros/css.md +68 -0
  285. package/docs/macros/cva.md +153 -0
  286. package/docs/macros/index.md +30 -0
  287. package/docs/macros/keyframes.md +98 -0
  288. package/docs/macros/media.md +65 -0
  289. package/docs/macros/ref/as-anchor.md +70 -0
  290. package/docs/macros/ref/as-container.md +64 -0
  291. package/docs/macros/ref/at.md +68 -0
  292. package/docs/macros/ref/condition.md +86 -0
  293. package/docs/macros/ref/in.md +81 -0
  294. package/docs/macros/ref/index.md +115 -0
  295. package/docs/macros/ref/position-anchor.md +64 -0
  296. package/docs/macros/style.md +185 -0
  297. package/docs/macros/view-transition.md +159 -0
  298. package/docs/utilities.md +35 -0
  299. package/docs/why.md +144 -0
  300. package/index.css +7 -0
  301. package/package.json +135 -8
  302. package/skills/migrate-to-stillwind/SKILL.md +81 -0
  303. package/skills/setup-stillwind/SKILL.md +51 -0
  304. package/skills/stillwind/SKILL.md +54 -0
  305. package/index.js +0 -1
@@ -0,0 +1,47 @@
1
+ ---
2
+ title: "conflicting-provider-properties"
3
+ description: "Reports a container or anchor property that a ref method and a utility both set."
4
+ ---
5
+
6
+ # conflicting-provider-properties
7
+
8
+ This rule reports a container or anchor property that a ref method, such as
9
+ `asContainer()`, and another utility both set on the same element. For example,
10
+ `asContainer("size")` sets `container-type: size`, and `@container` sets it to
11
+ `inline-size`. Only one value takes effect, and the code does not show which.
12
+
13
+ ## Reported
14
+
15
+ ```tsx
16
+ const card = style.ref("card");
17
+ style(card, card.asContainer("size"), "@container");
18
+ ```
19
+
20
+ > conflicting-provider-properties: provider use overlaps `container-type` from another source; their order is not guaranteed
21
+ >
22
+ > Example:2:40
23
+ >
24
+ > Example:2:13: overlapping property source
25
+
26
+ ## Fixed
27
+
28
+ ```tsx
29
+ const card = style.ref("card");
30
+ style(card, card.asContainer("size"));
31
+ ```
32
+
33
+ ## How to fix
34
+
35
+ - Set the property in one place. With a ref, pass the container type to
36
+ `asContainer()`, and remove the utility, as in the example.
37
+ - If you want the type from the utility, call `asContainer()` without a type.
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,55 @@
1
+ ---
2
+ title: "conflicting-utilities"
3
+ description: "Reports utilities that set the same CSS property under the same conditions, such as p-2 p-4."
4
+ ---
5
+
6
+ # conflicting-utilities
7
+
8
+ This rule reports two utilities that set the same CSS property under the same
9
+ conditions. Only one of them takes effect. The order of the generated CSS decides
10
+ which one, not the order in your code, so the code does not show the result.
11
+
12
+ ## Reported
13
+
14
+ ```tsx
15
+ style("p-2 p-4");
16
+ ```
17
+
18
+ > conflicting-utilities: utilities `p-2` and `p-4` overlap `padding`
19
+ >
20
+ > Example:1:12
21
+ >
22
+ > Example:1:8: previous utility
23
+
24
+ ## Fixed
25
+
26
+ ```tsx
27
+ style("p-4");
28
+ ```
29
+
30
+ ## How to fix
31
+
32
+ - Keep the utility that you want, and remove the other.
33
+ - If the values belong to different states or widths, add a variant to one of
34
+ them, such as `p-2 md:p-4`.
35
+ - If one utility overrides a shared style, pass the shared style as a base. See
36
+ [Override a style](../guides/style.md#override-a-style).
37
+
38
+ ## Options
39
+
40
+ `allowShorthandOverrides` allows the supported overrides between a shorthand
41
+ utility and a longhand utility. The rule still reports other conflicts.
42
+
43
+ ## Rule settings
44
+
45
+ | Preset | Severity |
46
+ | --- | --- |
47
+ | `recommended` | warn |
48
+ | `strict` | deny |
49
+ | `stylistic` | off |
50
+
51
+ | Option | Default |
52
+ | --- | --- |
53
+ | `allowShorthandOverrides` | `false` |
54
+
55
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: "document-scoped-selector"
3
+ description: "Reports a selector variant that styles the whole document instead of the element."
4
+ ---
5
+
6
+ # document-scoped-selector
7
+
8
+ This rule reports a variant that replaces the element with a document-wide
9
+ target, such as `[:root]:`. Stillwind compiles CSS statically, so including this
10
+ declaration in your code affects the document even when the element is not
11
+ rendered.
12
+
13
+ ## Reported
14
+
15
+ ```tsx
16
+ style("[:root]:text-red-500");
17
+ ```
18
+
19
+ > document-scoped-selector: `:root` does not depend on the styled element; declare document-wide CSS in a global stylesheet
20
+ >
21
+ > Example:1:8
22
+
23
+ ## Fixed
24
+
25
+ ```css
26
+ :root {
27
+ @apply text-red-500;
28
+ }
29
+ ```
30
+
31
+ ## How to fix
32
+
33
+ - To style the root of the page, write a rule in your stylesheet, as in the
34
+ example.
35
+ - To style the element itself, remove the variant: `style("text-red-500")`.
36
+
37
+ ## Rule settings
38
+
39
+ | Preset | Severity |
40
+ | --- | --- |
41
+ | `recommended` | deny |
42
+ | `strict` | deny |
43
+ | `stylistic` | off |
44
+
45
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: "duplicate-definition"
3
+ description: "Reports a utility or variant definition that replaces an earlier one with the same name."
4
+ ---
5
+
6
+ # duplicate-definition
7
+
8
+ This rule reports a `@utility` or `@custom-variant` definition that replaces an
9
+ earlier definition with the same name. The definitions do not combine, so the
10
+ earlier one is lost. In the example, `hocus` matches focus only, not hover.
11
+
12
+ ## Reported
13
+
14
+ ```css
15
+ @custom-variant hocus (&:hover);
16
+ @custom-variant hocus (&:focus);
17
+ ```
18
+
19
+ > duplicate-definition: `@custom-variant hocus` is never used because a later definition with the same name replaces it
20
+ >
21
+ > Example:1:17
22
+ >
23
+ > Example:2:17: later definition
24
+
25
+ ## Fixed
26
+
27
+ ```css
28
+ @custom-variant hocus (&:hover, &:focus);
29
+ ```
30
+
31
+ ## How to fix
32
+
33
+ - To combine the definitions, write them as one definition, as in the example.
34
+ - If one of the definitions is left over, remove it.
35
+
36
+ ## Rule settings
37
+
38
+ | Preset | Severity |
39
+ | --- | --- |
40
+ | `recommended` | warn |
41
+ | `strict` | deny |
42
+ | `stylistic` | off |
43
+
44
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: "duplicate-utility"
3
+ description: "Reports the same utility written twice under the same conditions."
4
+ ---
5
+
6
+ # duplicate-utility
7
+
8
+ This rule reports a utility that appears twice under the same conditions, such as
9
+ `p-4 p-4`. The second one adds nothing.
10
+
11
+ ## Reported
12
+
13
+ ```tsx
14
+ style("p-4 p-4");
15
+ ```
16
+
17
+ > duplicate-utility: utility `p-4` is repeated under the same conditions
18
+ >
19
+ > Example:1:12
20
+ >
21
+ > Example:1:8: previous utility
22
+
23
+ ## Fixed
24
+
25
+ ```tsx
26
+ style("p-4");
27
+ ```
28
+
29
+ ## How to fix
30
+
31
+ Remove one of them. The automatic fix removes the repeated utility.
32
+
33
+ Two different utilities that set the same property are reported by
34
+ [conflicting-utilities](conflicting-utilities.md) instead.
35
+
36
+ ## Rule settings
37
+
38
+ | Preset | Severity |
39
+ | --- | --- |
40
+ | `recommended` | warn |
41
+ | `strict` | deny |
42
+ | `stylistic` | off |
43
+
44
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: "duplicate-view-transition-name"
3
+ description: "Reports two .for() calls in one style() call."
4
+ ---
5
+
6
+ # duplicate-view-transition-name
7
+
8
+ This rule reports a `style()` call with more than one `.for()`. An element has one
9
+ `view-transition-name`, so only one of the names takes effect.
10
+
11
+ ## Reported
12
+
13
+ ```tsx
14
+ const transition = style.viewTransition({ old: "duration-150" });
15
+ style(transition.for("a"), transition.for("b"));
16
+ ```
17
+
18
+ > duplicate-view-transition-name: 2 view-transition-name sources in one style() call; only one element value applies, and a runtime name wins
19
+ >
20
+ > Example:2:1
21
+
22
+ ## Fixed
23
+
24
+ ```tsx
25
+ const transition = style.viewTransition({ old: "duration-150" });
26
+ style(transition.for("a"));
27
+ ```
28
+
29
+ ## How to fix
30
+
31
+ - Keep one `.for()` for the element, as in the example.
32
+ - If the names belong to different elements, give each element its own
33
+ `style()` call with its own `.for()`.
34
+ - To combine several transitions on one element, pass the others without
35
+ `.for()`, such as `style(fade, slide.for("a"))`.
36
+
37
+ ## Rule settings
38
+
39
+ | Preset | Severity |
40
+ | --- | --- |
41
+ | `recommended` | warn |
42
+ | `strict` | deny |
43
+ | `stylistic` | off |
44
+
45
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,51 @@
1
+ ---
2
+ title: "ignored-definition-condition"
3
+ description: "Reports a media rule around a utility definition, which the compiler ignores."
4
+ ---
5
+
6
+ # ignored-definition-condition
7
+
8
+ This rule reports a `@utility` definition inside a condition such as `@media`.
9
+ The compiler registers utilities when it reads the stylesheet, not in the
10
+ browser, so it ignores the condition. The utility then applies at every width.
11
+
12
+ ## Reported
13
+
14
+ ```css
15
+ @media (width >= 40rem) {
16
+ @utility brand {
17
+ color: red;
18
+ }
19
+ }
20
+ ```
21
+
22
+ > ignored-definition-condition: `@utility` defines at compile time, so the enclosing condition is ignored; put conditions around `@stillwind-slot utilities;` instead
23
+ >
24
+ > Example:2:3
25
+
26
+ ## Fixed
27
+
28
+ ```css
29
+ @utility brand {
30
+ @media (width >= 40rem) {
31
+ color: red;
32
+ }
33
+ }
34
+ ```
35
+
36
+ ## How to fix
37
+
38
+ - Put the condition inside the body of the utility, as in the example. Then the
39
+ generated CSS keeps the condition.
40
+ - Or define the utility without a condition, and apply it with a variant, such as
41
+ `md:brand`.
42
+
43
+ ## Rule settings
44
+
45
+ | Preset | Severity |
46
+ | --- | --- |
47
+ | `recommended` | deny |
48
+ | `strict` | deny |
49
+ | `stylistic` | off |
50
+
51
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,62 @@
1
+ ---
2
+ title: "ignored-tailwind-feature"
3
+ description: "Reports Tailwind CSS features that Stillwind ignores in the stylesheet, such as @config and @source."
4
+ ---
5
+
6
+ # ignored-tailwind-feature
7
+
8
+ This rule reports a Tailwind CSS feature in your stylesheet that Stillwind
9
+ ignores, such as `@config`, `@source`, or an option on `@import`. The line has
10
+ no effect, because Stillwind reads its settings from `stillwind.config.ts` and
11
+ generates utilities only from `style()` calls.
12
+
13
+ ## Reported
14
+
15
+ ```css
16
+ @config "./tailwind.config.js";
17
+ ```
18
+
19
+ > ignored-tailwind-feature: `@config` has no effect in Stillwind; set the project's `tailwind` field in stillwind.config.ts instead
20
+ >
21
+ > Example:1:1
22
+
23
+ ## Fixed
24
+
25
+ ```ts title="stillwind.config.ts"
26
+ import { defineConfig } from "stillwind/config";
27
+
28
+ import tailwindConfig from "./tailwind.config.js";
29
+
30
+ export default defineConfig({
31
+ projects: [
32
+ {
33
+ css: "./src/stillwind.css",
34
+ files: ["src/**/*.{ts,tsx}"],
35
+ tailwind: tailwindConfig,
36
+ },
37
+ ],
38
+ });
39
+ ```
40
+
41
+ ## How to fix
42
+
43
+ - Move the configuration to the `tailwind` field of the project in
44
+ `stillwind.config.ts`, as in the example, and remove `@config`.
45
+ - Move an `important` option on `@import` to the `important` field.
46
+ - Remove `@source`, and move each utility that it listed into a `style()` call.
47
+ - Replace `@reference` with an `@import` in the stylesheet of the project.
48
+ - Replace a v3 path in `theme()`, such as `theme(colors.red.500)`, with a theme
49
+ variable: `--theme(--color-red-500)`. Without this change, browsers reject the
50
+ declaration.
51
+ - [Migrating from Tailwind CSS](../guides/migrating-from-tailwind.md#move-configuration)
52
+ lists every replacement.
53
+
54
+ ## Rule settings
55
+
56
+ | Preset | Severity |
57
+ | --- | --- |
58
+ | `recommended` | warn |
59
+ | `strict` | deny |
60
+ | `stylistic` | off |
61
+
62
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,60 @@
1
+ ---
2
+ title: "incompatible-property-value"
3
+ description: "Reports a utility value that the browser rejects for its CSS property."
4
+ ---
5
+
6
+ # incompatible-property-value
7
+
8
+ This rule reports a utility whose value the browser rejects for its CSS property.
9
+ The compiler still writes the CSS, but the browser ignores the declaration. For
10
+ example, `w-[1/2]` writes `width: 1/2`, which is not a valid width.
11
+
12
+ The compiler checks an arbitrary value against the grammar of each CSS property
13
+ that receives it. A value that every receiving property accepts is not reported,
14
+ even when no value type of the utility accepts it, such as `basis-[content]`.
15
+
16
+ Some utilities pass the value only to custom properties, such as `--tw-blur` for
17
+ `blur-[5%]`, so no property grammar can check it. When no value type of such a
18
+ utility accepts the value, the rule reports that the utility does not accept it.
19
+
20
+ For a utility that your own stylesheet defines, the rule also checks the other
21
+ declarations that the utility writes, such as a bare value in `fg-5` from
22
+ `@utility fg-* { color: --value(integer); }`. It skips values that contain
23
+ `var()`, values that come from theme tokens, and custom properties.
24
+ [incompatible-theme-value](incompatible-theme-value.md) checks theme
25
+ tokens where you define them. By default, the rule does not check the
26
+ definitions of packages and plugins, because you cannot change them. The
27
+ [`checkLibraries` and `checkPlugins`](../configuration.md#definitions-of-packages-and-plugins)
28
+ fields of `lint` select packages and plugins to check.
29
+
30
+ ## Reported
31
+
32
+ ```tsx
33
+ style("w-[1/2]");
34
+ ```
35
+
36
+ > incompatible-property-value: `width` does not accept `1/2`
37
+ >
38
+ > Example:1:10
39
+
40
+ ## Fixed
41
+
42
+ ```tsx
43
+ style("w-1/2");
44
+ ```
45
+
46
+ ## How to fix
47
+
48
+ - Use the form of the utility that the theme defines, such as the fraction form
49
+ `w-1/2`, as in the example.
50
+ - In an arbitrary value, write a valid CSS value, such as `w-[50%]`.
51
+
52
+ ## Rule settings
53
+
54
+ | Preset | Severity |
55
+ | --- | --- |
56
+ | `recommended` | deny |
57
+ | `strict` | deny |
58
+ | `stylistic` | off |
59
+
60
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,46 @@
1
+ ---
2
+ title: "incompatible-theme-value"
3
+ description: "Reports a theme token with a value of the wrong type for its namespace, such as a length for a color."
4
+ ---
5
+
6
+ # incompatible-theme-value
7
+
8
+ This rule reports a theme token whose value does not match the type of its
9
+ namespace. For example, tokens in `--color-*` must be colors, so a length makes
10
+ `bg-brand` and the other color utilities write an invalid value.
11
+
12
+ ## Reported
13
+
14
+ ```css
15
+ @theme {
16
+ --color-brand: 1rem;
17
+ }
18
+ ```
19
+
20
+ > incompatible-theme-value: `1rem` is not a valid value for `--color-brand` because tokens of `--color-*` must be `color`
21
+ >
22
+ > Example:2:18
23
+
24
+ ## Fixed
25
+
26
+ ```css
27
+ @theme {
28
+ --spacing-brand: 1rem;
29
+ }
30
+ ```
31
+
32
+ ## How to fix
33
+
34
+ - If the value is right, move the token to the namespace of that type, such as
35
+ `--spacing-*` for a length, as in the example.
36
+ - If the namespace is right, correct the value, such as a color for `--color-*`.
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.
@@ -0,0 +1,140 @@
1
+ ---
2
+ title: "Lint rule reference"
3
+ description: "Find a lint rule by the kind of mistake or policy that it reports."
4
+ ---
5
+
6
+ # Lint rule reference
7
+
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](../guides/lint-adoption.md)
10
+ explains where the rules run, and [Configuration](../configuration.md#lint)
11
+ covers presets, severities, and suppression comments.
12
+
13
+ The **Default** column shows the severity in the `recommended` preset, which a
14
+ project uses when it has no `lint` setting. Each rule page shows its severity in
15
+ every preset.
16
+
17
+ ## Misspelled or invalid utilities
18
+
19
+ A utility or variant that these rules report produces no CSS.
20
+
21
+ | Rule | Reports | Default |
22
+ | ---------------------------------------------------- | ------------------------------------------------------------- | ------- |
23
+ | [unknown-utility](unknown-utility.md) | A utility or theme value that your stylesheet does not define | warn |
24
+ | [invalid-utility](invalid-utility.md) | A known utility written in a form that it does not accept | deny |
25
+ | [unknown-variant](unknown-variant.md) | A variant that your stylesheet does not define | warn |
26
+ | [invalid-variant](invalid-variant.md) | A known variant with an invalid value, such as `min-[foo]:` | deny |
27
+ | [invalid-marker-use](invalid-marker-use.md) | A marker class such as `group` with a variant or `!` | warn |
28
+
29
+ ## Invalid arguments to Stillwind APIs
30
+
31
+ An argument that these rules report adds no CSS, and a condition that they
32
+ report never matches.
33
+
34
+ | Rule | Reports | Default |
35
+ | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------- | ------- |
36
+ | [invalid-style-input](invalid-style-input.md) | A `style()` argument that it cannot compile, such as a number | deny |
37
+ | [invalid-rule-group-input](invalid-rule-group-input.md) | A `class` field or ref inside a variant key of `style()` | deny |
38
+ | [invalid-style-composition](invalid-style-composition.md) | Inline styles or custom properties in a base style, which do not carry over | deny |
39
+ | [invalid-css-input](invalid-css-input.md) | A `style.css()` argument that is not a static utility | deny |
40
+ | [missing-document-target](missing-document-target.md) | A `style.css()` utility without a selector | deny |
41
+ | [invalid-ref-input](invalid-ref-input.md) | A `style.ref()` label or ref method argument that is not a literal | deny |
42
+ | [invalid-cva-config](invalid-cva-config.md) | An unknown or malformed field in a `style.cva()` configuration | deny |
43
+ | [invalid-cva-input](invalid-cva-input.md) | `&&` or a ternary inside a `style.cva()` value | deny |
44
+ | [invalid-keyframes-definition](invalid-keyframes-definition.md) | A frame key that is not a keyframe position, such as `middle` | deny |
45
+ | [invalid-keyframes-variant](invalid-keyframes-variant.md) | A selector or container variant around a keyframes definition | deny |
46
+ | [invalid-keyframes-use](invalid-keyframes-use.md) | An animation applied with an argument that is not an options string | deny |
47
+ | [invalid-animation-option](invalid-animation-option.md) | A utility that is not an animation option, such as `p-4` | deny |
48
+ | [invalid-view-transition-definition](invalid-view-transition-definition.md) | An unknown field in a `style.viewTransition()` definition | deny |
49
+ | [invalid-view-transition-variant](invalid-view-transition-variant.md) | A state or container variant in a view transition definition | deny |
50
+ | [invalid-view-transition-use](invalid-view-transition-use.md) | Extra or invalid arguments to `.for()` | deny |
51
+ | [invalid-media-query](invalid-media-query.md) | A condition in `style.media()` that is not a media query, such as `hover` | deny |
52
+ | [invalid-runtime-condition](invalid-runtime-condition.md) | A runtime CSS condition that Stillwind cannot compile | deny |
53
+ | [runtime-condition-requires-css-if](runtime-condition-requires-css-if.md) | A runtime CSS condition that needs `useCssIf` | deny |
54
+
55
+ ## Arguments and imports
56
+
57
+ | Rule | Reports | Default |
58
+ | ---------------------------------------------------------------------- | ----------------------------------------------------------- | ------- |
59
+ | [mutating-macro-argument](mutating-macro-argument.md) | A state update inside a `style()` argument | deny |
60
+ | [suspending-macro-argument](suspending-macro-argument.md) | `await`, `yield`, or `import()` inside a `style()` argument | deny |
61
+ | [mismatched-framework-import](mismatched-framework-import.md) | An import from the entrypoint of another framework | warn |
62
+
63
+ ## Conflicting or duplicated styles
64
+
65
+ | Rule | Reports | Default |
66
+ | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------- | ------- |
67
+ | [conflicting-utilities](conflicting-utilities.md) | Utilities that set the same property, such as `p-2 p-4` | warn |
68
+ | [duplicate-utility](duplicate-utility.md) | The same utility twice under the same conditions | warn |
69
+ | [conflicting-provider-properties](conflicting-provider-properties.md) | A container or anchor property that a ref method and a utility both set | warn |
70
+ | [ambiguous-style-base-order](ambiguous-style-base-order.md) | Two base styles in one call that set the same property | warn |
71
+ | [interfering-imported-style-base](interfering-imported-style-base.md) | An imported base style that sets the same property as another style | warn |
72
+ | [unverified-style-base](unverified-style-base.md) | A base style whose origin the CLI cannot determine from its type | warn |
73
+
74
+ ## Styles that do not apply as written
75
+
76
+ | Rule | Reports | Default |
77
+ | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------- |
78
+ | [missing-ref-attachment](missing-ref-attachment.md) | `asContainer()` or `asAnchor()` in a call that does not attach the ref | warn |
79
+ | [ineffective-anchor-scope](ineffective-anchor-scope.md) | An empty or repeated ref list in an anchor scope | warn |
80
+ | [missing-view-transition-name](missing-view-transition-name.md) | A view transition applied without `.for()` | warn |
81
+ | [duplicate-view-transition-name](duplicate-view-transition-name.md) | Two `.for()` calls in one `style()` call | warn |
82
+ | [split-view-transition-class](split-view-transition-class.md) | View transitions split across separate `style()` calls | warn |
83
+ | [document-scoped-selector](document-scoped-selector.md) | A selector that styles the whole document instead of the element | deny |
84
+ | [repeated-nesting-selector](repeated-nesting-selector.md) | A selector that repeats `&` to relate two elements | warn |
85
+ | [incompatible-property-value](incompatible-property-value.md) | A value that the browser rejects for the property | deny |
86
+ | [clamped-value](clamped-value.md) | A value outside the range that the browser uses, such as opacity above 1 | warn |
87
+ | [unsatisfiable-variants](unsatisfiable-variants.md) | Variants that can never match together, such as `portrait:landscape:` | warn |
88
+
89
+ ## Stylesheet definitions
90
+
91
+ | Rule | Reports | Default |
92
+ | ------------------------------------------------------------------------ | ---------------------------------------------------------------- | ------- |
93
+ | [invalid-css-import](invalid-css-import.md) | A stylesheet import that cannot be resolved | deny |
94
+ | [invalid-css-directive](invalid-css-directive.md) | A malformed or unsupported Stillwind directive | deny |
95
+ | [invalid-theme-reference](invalid-theme-reference.md) | A reference to a theme token that is not defined | deny |
96
+ | [incompatible-theme-value](incompatible-theme-value.md) | A theme value of the wrong type, such as a length for a color | deny |
97
+ | [duplicate-definition](duplicate-definition.md) | A utility or variant definition that replaces an earlier one | warn |
98
+ | [bypassed-undefinition](bypassed-undefinition.md) | A definition that bypasses an undefinition in another context | warn |
99
+ | [ignored-definition-condition](ignored-definition-condition.md) | A media rule around a definition, which the compiler ignores | deny |
100
+ | [ignored-tailwind-feature](ignored-tailwind-feature.md) | Tailwind-only directives such as `@config`, which have no effect | warn |
101
+
102
+ ## Project policies
103
+
104
+ These rules enforce choices of your project. No preset enables them.
105
+
106
+ | Rule | Reports | Default |
107
+ | -------------------------------------------------------------------- | ------------------------------------------------------------- | ------- |
108
+ | [no-arbitrary-colors](no-arbitrary-colors.md) | Colors written as values, such as `bg-[#123456]` | off |
109
+ | [no-arbitrary-spacing](no-arbitrary-spacing.md) | Spacing written as values, such as `p-[13px]` | off |
110
+ | [no-arbitrary-breakpoints](no-arbitrary-breakpoints.md) | Viewport widths written as values, such as `min-[713px]:` | off |
111
+ | [no-restricted-theme-tokens](no-restricted-theme-tokens.md) | Utilities that use the theme tokens that you list | off |
112
+ | [no-restricted-utilities](no-restricted-utilities.md) | The utilities that you list | off |
113
+ | [no-restricted-declarations](no-restricted-declarations.md) | Utilities that produce the CSS declarations that you list | off |
114
+ | [no-restricted-length-units](no-restricted-length-units.md) | Length units that you forbid for the properties that you list | off |
115
+ | [no-important](no-important.md) | The `!` modifier | off |
116
+ | [no-class-property](no-class-property.md) | The `class` field, which adds classes without generated CSS | off |
117
+
118
+ ## Preferred spelling
119
+
120
+ These rules report code that works but has a clearer form. The `stylistic`
121
+ preset enables the rules that are off by default.
122
+
123
+ | Rule | Reports | Default |
124
+ | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------- |
125
+ | [prefer-canonical-utilities](prefer-canonical-utilities.md) | A utility with a shorter equivalent, such as `px-[16px]` for `px-4` | warn |
126
+ | [redundant-variant](redundant-variant.md) | A variant that adds no condition, such as `hover:hover:` | warn |
127
+ | [prefer-explicit-nesting-selector](prefer-explicit-nesting-selector.md) | A custom variant selector without `&` | warn |
128
+ | [prefer-sorted-utilities](prefer-sorted-utilities.md) | Utilities that are not in sorted order | off |
129
+ | [prefer-typed-relationships](prefer-typed-relationships.md) | `group-*` and `peer-*` variants that a ref can replace | off |
130
+ | [prefer-direct-styling](prefer-direct-styling.md) | A selector that styles another element, such as `[&_button]:` | off |
131
+ | [prefer-logical-properties](prefer-logical-properties.md) | A physical property with a logical form, such as `ml-4` | off |
132
+ | [prefer-typed-variables](prefer-typed-variables.md) | A custom property without a type in a utility that accepts several types | off |
133
+ | [prefer-variant-directive](prefer-variant-directive.md) | A media rule in your CSS that a named variant can replace | off |
134
+
135
+ ## Suppression comments
136
+
137
+ | Rule | Reports | Default |
138
+ | ---------------------------------------------------------------- | ------------------------------------------- | ------- |
139
+ | [invalid-lint-suppression](invalid-lint-suppression.md) | A malformed comment or an unknown rule name | warn |
140
+ | [unused-lint-suppression](unused-lint-suppression.md) | A comment that suppresses no finding | off |