stillwind 0.0.0 → 0.1.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,49 @@
1
+ ---
2
+ title: "invalid-ref-input"
3
+ description: "Reports a style.ref() label or ref method argument that is not a literal."
4
+ ---
5
+
6
+ # invalid-ref-input
7
+
8
+ This rule reports a `style.ref()` label or a ref method argument that is not a
9
+ literal. The compiler reads these values at build time, so a value from a variable
10
+ cannot name a ref or configure a method.
11
+
12
+ ## Reported
13
+
14
+ ```tsx
15
+ declare const label: string;
16
+ const card = style.ref(label);
17
+ style(card);
18
+ ```
19
+
20
+ > invalid-ref-input: style.ref() accepts only an optional literal label
21
+ >
22
+ > Example:2:24
23
+
24
+ ## Fixed
25
+
26
+ ```tsx
27
+ const card = style.ref("card");
28
+ style(card);
29
+ ```
30
+
31
+ ## How to fix
32
+
33
+ - Write the label as a string literal.
34
+ - If you need a different ref for each case, declare one ref for each case and
35
+ choose between the refs at runtime. Each `style.ref()` call already creates a
36
+ separate name, so the label does not need to differ.
37
+ - Write method arguments, such as the type of `asContainer()`, as literals.
38
+
39
+ See [style.ref()](../macros/ref/index.md).
40
+
41
+ ## Rule settings
42
+
43
+ | Preset | Severity |
44
+ | --- | --- |
45
+ | `recommended` | deny |
46
+ | `strict` | deny |
47
+ | `stylistic` | off |
48
+
49
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,58 @@
1
+ ---
2
+ title: "invalid-rule-group-input"
3
+ description: "Reports a class field, custom property, or ref inside an object with variant keys."
4
+ ---
5
+
6
+ # invalid-rule-group-input
7
+
8
+ This rule reports a `class` field, a custom property, a ref, or a stored `style()`
9
+ result inside an object with variant keys, such as `{ "hover:": ... }`. A variant
10
+ can only condition utilities, so the input is left out.
11
+
12
+ ## Reported
13
+
14
+ ```css
15
+ .external {
16
+ color: red;
17
+ }
18
+ ```
19
+
20
+ ```tsx
21
+ style({ "hover:": { class: "external" } });
22
+ ```
23
+
24
+ > invalid-rule-group-input: style() rule groups cannot contain external class value
25
+ >
26
+ > Example:1:28
27
+
28
+ ## Fixed
29
+
30
+ ```css
31
+ .external:hover {
32
+ color: red;
33
+ }
34
+ ```
35
+
36
+ ```tsx
37
+ style({ class: "external" });
38
+ ```
39
+
40
+ ## How to fix
41
+
42
+ - If you own the other stylesheet, put the state in its selector and attach the
43
+ class without a variant, as in the example. The element still turns red only
44
+ while it is hovered.
45
+ - If the stylesheet cannot change and the application already tracks the state
46
+ in JavaScript, pass the `class` field under that JavaScript condition.
47
+ - If the class only applies styles that Stillwind has as utilities, write those
48
+ utilities under the variant instead, such as `{ "hover:": "opacity-50" }`.
49
+
50
+ ## Rule settings
51
+
52
+ | Preset | Severity |
53
+ | --- | --- |
54
+ | `recommended` | deny |
55
+ | `strict` | deny |
56
+ | `stylistic` | off |
57
+
58
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,67 @@
1
+ ---
2
+ title: "invalid-runtime-condition"
3
+ description: "Reports a runtime CSS condition that the compiler cannot compile in its position."
4
+ ---
5
+
6
+ # invalid-runtime-condition
7
+
8
+ This rule reports a runtime CSS condition, such as `--if()`, that the compiler
9
+ cannot express with the supported CSS. Comparisons of custom-property values,
10
+ for example, need the native CSS `if()` function and `useCssIf: true`. The
11
+ message explains why the condition failed. The declaration produces no CSS.
12
+
13
+ ## Reported
14
+
15
+ ```tsx
16
+ const fade = style.keyframes({ to: "[color:--if(--mode:compact,red,blue)]" });
17
+ style(fade("duration-300"));
18
+ ```
19
+
20
+ > invalid-runtime-condition: `color` is left out because its `--if()` cannot be lowered: custom-property value comparisons require useCssIf: true
21
+ >
22
+ > Example:1:1
23
+
24
+ ## Fixed
25
+
26
+ ```tsx
27
+ const fade = style.keyframes({ to: "text-(color:--frame-color)" });
28
+ style("[--frame-color:--if(--mode:compact,red,blue)]", fade("duration-300"));
29
+ ```
30
+
31
+ ```ts title="stillwind.config.ts"
32
+ import { defineConfig } from "stillwind/config";
33
+
34
+ export default defineConfig({
35
+ projects: [
36
+ {
37
+ css: "./src/stillwind.css",
38
+ files: ["src/**/*.{ts,tsx}"],
39
+ useCssIf: true,
40
+ },
41
+ ],
42
+ });
43
+ ```
44
+
45
+ ## How to fix
46
+
47
+ - Move the condition onto the element, and let the keyframes read the result
48
+ through a custom property, as in the example. This keeps `--mode` as the
49
+ source of the condition and keeps the same red and blue values.
50
+ - Enable `useCssIf: true` for comparisons of custom-property values, as in the
51
+ configuration above. The browsers that you support must implement CSS `if()`.
52
+ - If the message names another unsupported condition, rewrite that condition or
53
+ set the resulting custom property in JavaScript.
54
+
55
+ A condition that only needs `useCssIf` is reported by
56
+ [runtime-condition-requires-css-if](runtime-condition-requires-css-if.md)
57
+ instead.
58
+
59
+ ## Rule settings
60
+
61
+ | Preset | Severity |
62
+ | --- | --- |
63
+ | `recommended` | deny |
64
+ | `strict` | deny |
65
+ | `stylistic` | off |
66
+
67
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: "invalid-style-composition"
3
+ description: "Reports inline styles or custom properties in a base style, which do not carry over."
4
+ ---
5
+
6
+ # invalid-style-composition
7
+
8
+ This rule reports a base style that contains inline styles or custom properties.
9
+ When you pass a stored `style()` result to another call, only its classes carry
10
+ over. The custom property in the base is lost.
11
+
12
+ Base styles can come from any framework entrypoint. The receiving call returns its
13
+ own framework's class and style props.
14
+
15
+ ## Reported
16
+
17
+ ```tsx
18
+ declare const value: string;
19
+ const base = style("rounded-md", { "--x": value });
20
+ style(base, "p-4");
21
+ ```
22
+
23
+ > invalid-style-composition: a style base contributes only its class; its inline style is ignored
24
+ >
25
+ > Example:3:7
26
+
27
+ ## Fixed
28
+
29
+ ```tsx
30
+ declare const value: string;
31
+ const base = style("rounded-md");
32
+ style(base, "p-4", { "--x": value });
33
+ ```
34
+
35
+ ## How to fix
36
+
37
+ - Keep the utilities in the base, and set the custom property in the call that
38
+ receives the base, as in the example.
39
+ - If several elements need the same value, set the custom property on a common
40
+ ancestor. Custom properties are inherited.
41
+
42
+ See [Base styles](../macros/style.md#base-styles).
43
+
44
+ ## Rule settings
45
+
46
+ | Preset | Severity |
47
+ | --- | --- |
48
+ | `recommended` | deny |
49
+ | `strict` | deny |
50
+ | `stylistic` | off |
51
+
52
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,47 @@
1
+ ---
2
+ title: "invalid-style-input"
3
+ description: "Reports a style() argument that the compiler cannot compile, such as a number."
4
+ ---
5
+
6
+ # invalid-style-input
7
+
8
+ This rule reports an argument of `style()` that the compiler cannot compile, such
9
+ as a number or a `style()` call written inside another `style()` call. The
10
+ argument adds nothing to the element. A number alone supplies neither a CSS
11
+ property nor a unit. The example intends to set a width in pixels.
12
+
13
+ ## Reported
14
+
15
+ ```tsx
16
+ style(42);
17
+ ```
18
+
19
+ > invalid-style-input: style() accepts literal utility strings, arrays, `condition && "…"` branches, and variant wrappers
20
+ >
21
+ > Example:1:7
22
+
23
+ ## Fixed
24
+
25
+ ```tsx
26
+ style("w-[42px]");
27
+ ```
28
+
29
+ ## How to fix
30
+
31
+ - For a value that you know when you write the code, use a utility, as in the
32
+ example, or a theme value.
33
+ - For a value that changes at runtime, set a custom property and read it in a
34
+ utility, such as `w-(--width)`.
35
+ - Store a `style()` result in a variable before you pass it to another call.
36
+
37
+ [style()](../macros/style.md#inputs) lists the accepted inputs.
38
+
39
+ ## Rule settings
40
+
41
+ | Preset | Severity |
42
+ | --- | --- |
43
+ | `recommended` | deny |
44
+ | `strict` | deny |
45
+ | `stylistic` | off |
46
+
47
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: "invalid-theme-reference"
3
+ description: "Reports a --theme() reference to a token that is not defined."
4
+ ---
5
+
6
+ # invalid-theme-reference
7
+
8
+ This rule reports a `--theme()` reference in your stylesheet to a token that the
9
+ theme does not define, when the reference has no fallback. The declaration that
10
+ contains it produces no CSS.
11
+
12
+ ## Reported
13
+
14
+ ```css
15
+ .card {
16
+ color: --theme(--color-brand);
17
+ }
18
+ ```
19
+
20
+ > invalid-theme-reference: `--theme(--color-brand)` names no theme token and has no fallback
21
+ >
22
+ > Example:2:10
23
+
24
+ ## Fixed
25
+
26
+ ```css
27
+ @theme {
28
+ --color-brand: oklch(0.6 0.2 250);
29
+ }
30
+
31
+ .card {
32
+ color: --theme(--color-brand);
33
+ }
34
+ ```
35
+
36
+ ## How to fix
37
+
38
+ - Define the token in `@theme`, as in the example, or correct the spelling of its
39
+ name.
40
+ - If the token is optional, add a fallback: `--theme(--color-brand, blue)`.
41
+
42
+ Malformed `--theme()` syntax causes [SW14007](../errors/SW14007.md) instead.
43
+
44
+ ## Rule settings
45
+
46
+ | Preset | Severity |
47
+ | --- | --- |
48
+ | `recommended` | deny |
49
+ | `strict` | deny |
50
+ | `stylistic` | off |
51
+
52
+ [Configure lint](../configuration.md#lint) to change the severity or options.
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: "invalid-utility"
3
+ description: "Reports a known utility written in a form that it does not accept."
4
+ ---
5
+
6
+ # invalid-utility
7
+
8
+ This rule reports a utility whose name is known but whose form is not valid. For
9
+ example, `flex` has no negative form, so `-flex` is invalid. The utility produces
10
+ no CSS.
11
+
12
+ ## Reported
13
+
14
+ ```tsx
15
+ style("-flex");
16
+ ```
17
+
18
+ > invalid-utility: `flex` does not accept a negative value
19
+ >
20
+ > Example:1:8
21
+
22
+ ## Fixed
23
+
24
+ ```tsx
25
+ style("flex");
26
+ ```
27
+
28
+ ## How to fix
29
+
30
+ - Remove the modifier or value that the utility does not accept.
31
+ - Check the accepted forms in [Built-in utilities](../utilities.md).
32
+
33
+ A utility name or theme value that does not exist is reported by
34
+ [unknown-utility](unknown-utility.md) instead.
35
+
36
+ ## Rule settings
37
+
38
+ | Preset | Severity |
39
+ | --- | --- |
40
+ | `recommended` | deny |
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: "invalid-variant"
3
+ description: "Reports a known variant with a value that it does not accept, such as min-[foo]."
4
+ ---
5
+
6
+ # invalid-variant
7
+
8
+ This rule reports a variant whose name is known but whose value is not valid. For
9
+ example, `min-[foo]:` needs a length, and `foo` is not one. The condition never
10
+ matches, so the utilities under it never apply.
11
+
12
+ ## Reported
13
+
14
+ ```tsx
15
+ style("min-[foo]:p-4");
16
+ ```
17
+
18
+ > invalid-variant: `min-` does not accept `foo`
19
+ >
20
+ > Example:1:12
21
+
22
+ ## Fixed
23
+
24
+ ```tsx
25
+ style("min-[40rem]:p-4");
26
+ ```
27
+
28
+ ## How to fix
29
+
30
+ - Give the variant a value of the type that it accepts, such as a length for
31
+ `min-[...]`.
32
+ - Prefer a named breakpoint, such as `md:`, when one matches the width.
33
+
34
+ A variant name that does not exist is reported by
35
+ [unknown-variant](unknown-variant.md) instead.
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,46 @@
1
+ ---
2
+ title: "invalid-view-transition-definition"
3
+ description: "Reports an unknown field in a style.viewTransition() definition."
4
+ ---
5
+
6
+ # invalid-view-transition-definition
7
+
8
+ This rule reports a `style.viewTransition()` definition that the compiler cannot
9
+ read, such as an unknown field. Each field must name a snapshot pseudo-element,
10
+ so an unknown field produces no CSS.
11
+
12
+ ## Reported
13
+
14
+ ```tsx
15
+ const transition = style.viewTransition({ before: "opacity-0" });
16
+ style(transition.for("card"));
17
+ ```
18
+
19
+ > invalid-view-transition-definition: view transition keys must be `group`, `old`, `new`, or `imagePair`
20
+ >
21
+ > Example:1:43
22
+
23
+ ## Fixed
24
+
25
+ ```tsx
26
+ const transition = style.viewTransition({ old: "opacity-0" });
27
+ style(transition.for("card"));
28
+ ```
29
+
30
+ ## How to fix
31
+
32
+ - Use the fields `group`, `imagePair`, `old`, and `new`. `old` styles the snapshot
33
+ before the update, and `new` styles the snapshot after it.
34
+ - Write each field as a utility string literal.
35
+
36
+ See [style.viewTransition()](../macros/view-transition.md#define-the-snapshot-styles).
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,46 @@
1
+ ---
2
+ title: "invalid-view-transition-use"
3
+ description: "Reports extra or invalid arguments to .for() of a view transition."
4
+ ---
5
+
6
+ # invalid-view-transition-use
7
+
8
+ This rule reports a `.for()` call with more than one argument, or with a key that
9
+ is not a string or a number. One `.for()` call names one element, so extra
10
+ arguments do not name more elements.
11
+
12
+ ## Reported
13
+
14
+ ```tsx
15
+ const transition = style.viewTransition({ old: "duration-150" });
16
+ style(transition.for("a", "b"));
17
+ ```
18
+
19
+ > invalid-view-transition-use: viewTransition.for() accepts at most one key expression
20
+ >
21
+ > Example:2:7
22
+
23
+ ## Fixed
24
+
25
+ ```tsx
26
+ const transition = style.viewTransition({ old: "duration-150" });
27
+ const first = style(transition.for("a"));
28
+ const second = style(transition.for("b"));
29
+ ```
30
+
31
+ ## How to fix
32
+
33
+ - Give each element its own `.for()` call with its own key, as in the example.
34
+ - Use a string or a number as the key, such as the ID of the item.
35
+
36
+ See [style.viewTransition()](../macros/view-transition.md#name-the-element).
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,51 @@
1
+ ---
2
+ title: "invalid-view-transition-variant"
3
+ description: "Reports a state or container variant in a style.viewTransition() definition."
4
+ ---
5
+
6
+ # invalid-view-transition-variant
7
+
8
+ This rule reports a state or container variant, such as `hover:`, in a
9
+ `style.viewTransition()` definition. The snapshots are images of the page, not
10
+ the element itself, so they cannot be hovered. Only media and `supports-*`
11
+ variants can condition a snapshot style.
12
+
13
+ ## Reported
14
+
15
+ ```tsx
16
+ const transition = style.viewTransition({ old: "hover:opacity-0" });
17
+ style(transition.for("card"));
18
+ ```
19
+
20
+ > invalid-view-transition-variant: view transition utilities accept only media and supports condition variants
21
+ >
22
+ > Example:1:49
23
+
24
+ ## Fixed
25
+
26
+ ```tsx
27
+ declare const hovered: boolean;
28
+ const fade = style.viewTransition({ old: "opacity-0" });
29
+ const keep = style.viewTransition({ old: "opacity-100" });
30
+ style((hovered ? fade : keep).for("card"));
31
+ ```
32
+
33
+ ## How to fix
34
+
35
+ - To use a different transition depending on the state of the element, define
36
+ one transition for each case and choose between them in JavaScript before the
37
+ update, as in the example.
38
+ - To use a different transition for a media condition, such as reduced motion,
39
+ keep the variant: `old: "motion-reduce:duration-0"`.
40
+
41
+ See [View transitions](../guides/view-transitions.md).
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,47 @@
1
+ ---
2
+ title: "mismatched-framework-import"
3
+ description: "Reports an import of style() from the entrypoint of another framework."
4
+ ---
5
+
6
+ # mismatched-framework-import
7
+
8
+ This rule reports a file that imports `style()` from the entrypoint of another
9
+ framework, such as `stillwind/astro` in a React component. Each entrypoint
10
+ selects a class key and style representation. Entrypoints with the same output
11
+ format are compatible.
12
+
13
+ ## Reported
14
+
15
+ ```tsx
16
+ import { style } from "stillwind/astro";
17
+
18
+ export const props = style("p-4");
19
+ ```
20
+
21
+ > mismatched-framework-import: `stillwind/astro` is incompatible with JSX/TSX input; use `stillwind/alpine`, `stillwind/lit`, `stillwind/preact`, `stillwind/qwik`, `stillwind/react`, `stillwind/solid`, `stillwind/vanilla`, `stillwind/vue`
22
+ >
23
+ > Example:1:23
24
+
25
+ ## Fixed
26
+
27
+ ```tsx
28
+ import { style } from "stillwind/react";
29
+
30
+ export const props = style("p-4");
31
+ ```
32
+
33
+ ## How to fix
34
+
35
+ Import from the entrypoint of the framework that renders the element. A React
36
+ island inside an Astro page imports `stillwind/react`. See
37
+ [Framework integrations](../integrations.md#import-style-for-your-framework).
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,44 @@
1
+ ---
2
+ title: "missing-document-target"
3
+ description: "Reports a style.css() utility without a selector to apply to."
4
+ ---
5
+
6
+ # missing-document-target
7
+
8
+ This rule reports a utility in `style.css()` that has no element to style.
9
+ `style.css()` returns a stylesheet, not props for an element, so a utility needs
10
+ a `selector` option or a variant that sets its own selector. Otherwise the utility
11
+ produces no CSS.
12
+
13
+ ## Reported
14
+
15
+ ```tsx
16
+ style.css("p-4");
17
+ ```
18
+
19
+ > missing-document-target: no variant selects the element to style; start with a variant such as `host:` or `[:root]:`
20
+ >
21
+ > Example:1:12
22
+
23
+ ## Fixed
24
+
25
+ ```tsx
26
+ style.css("p-4", { selector: ":host" });
27
+ ```
28
+
29
+ ## How to fix
30
+
31
+ - Add a `selector` option, such as `:host` for the shadow host.
32
+ - Or use a variant that sets its own selector, such as `host:p-4`.
33
+
34
+ See [style.css()](../macros/css.md#inputs).
35
+
36
+ ## Rule settings
37
+
38
+ | Preset | Severity |
39
+ | --- | --- |
40
+ | `recommended` | deny |
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: "missing-ref-attachment"
3
+ description: "Reports asContainer() or asAnchor() in a call that does not attach the ref."
4
+ ---
5
+
6
+ # missing-ref-attachment
7
+
8
+ This rule reports `asContainer()` or `asAnchor()` in a `style()` call that does not
9
+ also attach the ref. The container or anchor applies only to an element that has
10
+ the ref, so without it, nothing happens.
11
+
12
+ ## Reported
13
+
14
+ ```tsx
15
+ const card = style.ref("card");
16
+ style(card.asContainer("inline-size"));
17
+ ```
18
+
19
+ > missing-ref-attachment: ref `card` provider has no matching marker attachment in this style() call
20
+ >
21
+ > Example:2:7
22
+
23
+ ## Fixed
24
+
25
+ ```tsx
26
+ const card = style.ref("card");
27
+ style(card, card.asContainer("inline-size"));
28
+ ```
29
+
30
+ ## How to fix
31
+
32
+ Pass the ref and the method in the same `style()` call, as in the example.
33
+
34
+ `positionAnchor()` is not reported. The positioned element does not need the ref.
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.