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,125 @@
1
+ ---
2
+ title: "Compiler error reference"
3
+ description: "Find a compiler error by its code, and see whether to fix the source, fix the configuration, or report a bug."
4
+ ---
5
+
6
+ # Compiler error reference
7
+
8
+ A compiler error stops the compilation of a module. Unlike a lint finding, you
9
+ cannot turn it off or suppress it with a comment. Each error page explains what
10
+ causes the error and how to fix it.
11
+
12
+ The first digits of a code tell you what to do next:
13
+
14
+ | Codes | What to do |
15
+ | ----------------- | ---------------------------------------------------- |
16
+ | SW01xxx – SW03xxx | Fix `stillwind.config.ts` or the integration options |
17
+ | SW10xxx – SW15xxx | Fix your components, `style()` calls, or stylesheet |
18
+ | SW30xxx – SW34xxx | Check your integration, or report a bug |
19
+ | SW90xxx | Report a bug |
20
+
21
+ ## Fix the configuration
22
+
23
+ - [SW01001](SW01001.md): Invalid property prefix
24
+ - [SW01002](SW01002.md): Invalid hash length
25
+ - [SW01003](SW01003.md): Invalid lint configuration
26
+ - [SW02001](SW02001.md): Framework constraint conflict
27
+ - [SW02002](SW02002.md): Unresolved root stylesheet
28
+ - [SW03001](SW03001.md): Generated identifier collision
29
+ - [SW03002](SW03002.md): Identifier generator failed
30
+ - [SW03003](SW03003.md): Theme variable collision
31
+
32
+ ## Fix your components and style() calls
33
+
34
+ - [SW10001](SW10001.md): JavaScript parse error
35
+ - [SW10002](SW10002.md): Invalid component syntax
36
+ - [SW10003](SW10003.md): Invalid Unicode string
37
+ - [SW10004](SW10004.md): Unconsumed macro use
38
+ - [SW10005](SW10005.md): Untransformed macro reference
39
+ - [SW11001](SW11001.md): Style composition cycle
40
+ - [SW11002](SW11002.md): CSS module ordering cycle
41
+ - [SW11003](SW11003.md): Unavailable style base
42
+ - [SW12001](SW12001.md): Incompatible declaration assignment
43
+ - [SW12002](SW12002.md): Declaration identities unavailable
44
+
45
+ ## Fix your stylesheet
46
+
47
+ - [SW13001](SW13001.md): Authored CSS parse error
48
+ - [SW13002](SW13002.md): Unterminated CSS block
49
+ - [SW13003](SW13003.md): Invalid CSS block
50
+ - [SW13004](SW13004.md): CSS nesting limit exceeded
51
+ - [SW14001](SW14001.md): Missing utilities slot
52
+ - [SW14002](SW14002.md): Missing support slot
53
+ - [SW14003](SW14003.md): Malformed property requirement
54
+ - [SW14004](SW14004.md): Malformed utility property requirement
55
+ - [SW14005](SW14005.md): Required property is unregistered
56
+ - [SW14006](SW14006.md): Property-usage parse failure
57
+ - [SW14007](SW14007.md): Malformed theme reference
58
+ - [SW14008](SW14008.md): Circular utility application
59
+ - [SW15001](SW15001.md): CSS offset exceeds source coordinates
60
+ - [SW15002](SW15002.md): Rendered source is too large
61
+ - [SW15003](SW15003.md): Source size or offset is too large
62
+
63
+ ## Check your integration
64
+
65
+ These errors come from the connection between the compiler and the build tool
66
+ or the editor. With an official integration, update the Stillwind packages
67
+ first. If the error remains, report it as a bug. If you write your own
68
+ integration, the error page explains which input to fix.
69
+
70
+ ### Type information
71
+
72
+ - [SW30001](SW30001.md): TypeScript checker facts required
73
+ - [SW30002](SW30002.md): Invalid or stale TypeScript facts
74
+ - [SW30003](SW30003.md): Incompatible symbolic fact kinds
75
+ - [SW30004](SW30004.md): Checker expression unavailable
76
+
77
+ ### Vue, Svelte, and Astro components
78
+
79
+ - [SW31001](SW31001.md): Invalid projection map
80
+ - [SW31002](SW31002.md): Ambiguous or missing original range
81
+ - [SW31003](SW31003.md): Projection content mismatch
82
+ - [SW31004](SW31004.md): Invalid converter output syntax
83
+ - [SW31005](SW31005.md): Component projection preparation failed
84
+ - [SW31006](SW31006.md): Invalid UTF-16 offset
85
+ - [SW31007](SW31007.md): Invalid UTF-16 position
86
+ - [SW31008](SW31008.md): Invalid UTF-8 offset
87
+ - [SW31009](SW31009.md): Unmapped macro binding read
88
+ - [SW31010](SW31010.md): Edit outside an editable projection region
89
+ - [SW31011](SW31011.md): Attribute quote mismatch
90
+
91
+ ### Stylesheet loading and source files
92
+
93
+ - [SW32001](SW32001.md): CSS imports need host resolution
94
+ - [SW32002](SW32002.md): Invalid initial CSS batch
95
+ - [SW32003](SW32003.md): Unknown or duplicate CSS request
96
+ - [SW32004](SW32004.md): Conflicting CSS source
97
+ - [SW32005](SW32005.md): CSS loader already completed
98
+ - [SW32006](SW32006.md): CSS request IDs exhausted
99
+ - [SW32007](SW32007.md): CSS source IDs exhausted
100
+ - [SW33001](SW33001.md): Original map on an internal source
101
+ - [SW33002](SW33002.md): Invalid source byte range
102
+ - [SW33003](SW33003.md): Span belongs to another file
103
+ - [SW33004](SW33004.md): Invalid source span
104
+ - [SW33005](SW33005.md): Invalid source byte offset
105
+
106
+ ### Code transformation
107
+
108
+ - [SW34001](SW34001.md): Missing macro import anchor
109
+ - [SW34002](SW34002.md): Missing module CSS target
110
+ - [SW34003](SW34003.md): Transform requested after failed compilation
111
+
112
+ ## Report a bug
113
+
114
+ These errors mean that the compiler produced an inconsistent result. Please
115
+ [open an issue](https://github.com/SegaraRai/stillwind/issues) with the error
116
+ message and, if possible, the source that causes it.
117
+
118
+ - [SW90001](SW90001.md): Invalid generated CSS block
119
+ - [SW90002](SW90002.md): Missing retained rule
120
+ - [SW90003](SW90003.md): Inconsistent internal CSS graph
121
+ - [SW90004](SW90004.md): Inconsistent macro import metadata
122
+ - [SW90005](SW90005.md): Macro anchor removal edit missing
123
+ - [SW90006](SW90006.md): Invalid transform expression mapping
124
+ - [SW90007](SW90007.md): Overlapping source replacements
125
+ - [SW90008](SW90008.md): Invalid compiler-produced source coordinates
@@ -0,0 +1,73 @@
1
+ ---
2
+ title: "Animations"
3
+ description: "Define keyframes in the component that uses them, and respect reduced-motion preferences."
4
+ ---
5
+
6
+ # Animations
7
+
8
+ You want to animate a component. With Tailwind, as with plain CSS, you write
9
+ `@keyframes` in a global stylesheet and register the animation in the theme.
10
+ In Stillwind, you can define the keyframes in the component that uses them, so
11
+ the animation stays next to the code that uses it.
12
+
13
+ ## Define and apply keyframes
14
+
15
+ ```tsx
16
+ import { style } from "stillwind/react";
17
+
18
+ const enter = style.keyframes({
19
+ from: "opacity-0 translate-y-2",
20
+ to: "opacity-100 translate-y-0",
21
+ });
22
+
23
+ export function Notice() {
24
+ return (
25
+ <aside {...style({ "motion-safe:": enter("duration-300 ease-out both") })}>
26
+ Your changes are saved.
27
+ </aside>
28
+ );
29
+ }
30
+ ```
31
+
32
+ `style.keyframes()` defines the frames with utilities. `enter(...)` applies the
33
+ animation, and its utilities set the animation's options. For example,
34
+ `duration-300` sets `animation-duration`.
35
+
36
+ The compiler generates a unique animation name, so two components can both
37
+ define an `enter` animation. When you delete the component, its keyframes are no
38
+ longer generated.
39
+
40
+ ## Respect reduced motion
41
+
42
+ The `motion-safe:` key in the example applies the animation only when the user
43
+ has not asked for reduced motion. Without the animation, the element shows its
44
+ ordinary styles, so make sure that those styles show the final state.
45
+
46
+ To use a different animation for reduced motion, add a definition under a
47
+ variant:
48
+
49
+ ```ts
50
+ import { style } from "stillwind/react";
51
+
52
+ const enter = style.keyframes({
53
+ from: "opacity-0 translate-y-2",
54
+ to: "opacity-100 translate-y-0",
55
+ "motion-reduce:": {
56
+ from: "opacity-0",
57
+ to: "opacity-100",
58
+ },
59
+ });
60
+ ```
61
+
62
+ The definition under `motion-reduce:` replaces the whole animation. It does not
63
+ inherit frames from the ordinary definition. Use media and `supports-*` variants
64
+ here. Container queries are not supported.
65
+
66
+ ## Share an animation
67
+
68
+ Export the keyframes from their module, and import them in other components.
69
+ Write the call that applies them, such as `enter("duration-300")`, directly in
70
+ `style()`. You cannot store that call in a variable and use it later.
71
+
72
+ The [style.keyframes() reference](../macros/keyframes.md) shows the generated
73
+ JavaScript and CSS.
@@ -0,0 +1,119 @@
1
+ ---
2
+ title: "Design systems"
3
+ description: "Define colors, spacing, radii, breakpoints, and text sizes once, and report values that bypass them."
4
+ ---
5
+
6
+ # Design systems
7
+
8
+ You want every component to use the same colors, spacing, and breakpoints.
9
+ Tailwind accepts arbitrary values such as `bg-[#3b82f6]` and `min-[713px]:`,
10
+ which is useful for one-off designs. In a shared codebase, you may want every
11
+ value to come from your tokens instead. In Stillwind, you define tokens in your
12
+ stylesheet and can enable rules that report values outside them.
13
+
14
+ ## Define tokens by role
15
+
16
+ Add tokens to the stylesheet that `stillwind.config.ts` selects. Name each token
17
+ after its role, such as `action` or `panel`, instead of its value:
18
+
19
+ ```css
20
+ @import "stillwind";
21
+
22
+ @theme {
23
+ --color-background: light-dark(#f4f7fc, #131b2b);
24
+ --color-foreground: light-dark(#202b45, #e4edff);
25
+ --color-surface: light-dark(#ffffff, #1b263b);
26
+ --color-action: light-dark(#354fa2, #b6cdff);
27
+ --color-action-foreground: light-dark(#f7faff, #172448);
28
+ --spacing-panel: 1.5rem;
29
+ --radius-control: 0.25rem;
30
+ --radius-panel: 0.5rem;
31
+ --breakpoint-sidebar: 52.5rem;
32
+ --text-ui: 0.8125rem;
33
+ }
34
+
35
+ :root {
36
+ color-scheme: light dark;
37
+ }
38
+ ```
39
+
40
+ Each token adds utilities. For example, `--color-action` adds `bg-action` and
41
+ `text-action`, and `--spacing-panel` adds `p-panel` and `gap-panel`.
42
+
43
+ `light-dark()` selects the first value in a light color scheme and the second
44
+ value in a dark one. Components use the same utility names in both schemes.
45
+
46
+ ## Use the tokens in components
47
+
48
+ ```tsx
49
+ import { style } from "stillwind/react";
50
+
51
+ export function Panel() {
52
+ return (
53
+ <section {...style("rounded-panel bg-surface p-panel text-foreground sidebar:grid")}>
54
+ <button {...style("rounded-control bg-action px-4 py-2 text-action-foreground text-ui")}>
55
+ Continue
56
+ </button>
57
+ </section>
58
+ );
59
+ }
60
+ ```
61
+
62
+ When a theme changes, you edit the stylesheet. The components stay the same.
63
+
64
+ To use a breakpoint in JavaScript, pass its name to `style.media()`. See
65
+ [Responsive styles](responsive-styles.md).
66
+
67
+ ## Report values outside the theme
68
+
69
+ Enable these rules in `stillwind.config.ts`:
70
+
71
+ ```ts title="stillwind.config.ts"
72
+ import { defineConfig, lintPresets } from "stillwind/config";
73
+
74
+ export default defineConfig({
75
+ projects: [
76
+ {
77
+ css: "./src/stillwind.css",
78
+ files: ["src/**/*.{ts,tsx,vue,svelte,astro}"],
79
+ lint: {
80
+ extends: [lintPresets.recommended],
81
+ rules: {
82
+ "no-arbitrary-colors": "deny",
83
+ "no-arbitrary-spacing": "deny",
84
+ "no-arbitrary-breakpoints": "deny",
85
+ },
86
+ },
87
+ },
88
+ ],
89
+ });
90
+ ```
91
+
92
+ | Rule | Reports | Example |
93
+ | ---------------------------------------------------------------- | --------------------------------- | -------------- |
94
+ | [no-arbitrary-colors](../lints/no-arbitrary-colors.md) | Colors written as values | `bg-[#123456]` |
95
+ | [no-arbitrary-spacing](../lints/no-arbitrary-spacing.md) | Margin, padding, and gap values | `p-[13px]` |
96
+ | [no-arbitrary-breakpoints](../lints/no-arbitrary-breakpoints.md) | Viewport widths written as values | `min-[713px]:` |
97
+
98
+ No preset enables these rules, so add them yourself. To enforce them, run the
99
+ CLI in CI, as described in [Checks in the editor and CI](lint-adoption.md).
100
+
101
+ ## Reserve the default palette
102
+
103
+ The default theme also contains palette colors such as `blue-500`. To make
104
+ components use your role names instead, report the palette tokens:
105
+
106
+ ```ts
107
+ const rules = {
108
+ "no-restricted-theme-tokens": {
109
+ severity: "deny",
110
+ tokens: ["--color-blue-*", "--color-gray-*"],
111
+ },
112
+ };
113
+ ```
114
+
115
+ The rule reports utilities that use a matching token, such as `bg-blue-500`.
116
+ Your role tokens can still use palette colors in their definitions.
117
+
118
+ For more restrictions, such as banned utilities or length units, see
119
+ [Configuration](../configuration.md#rule-options).
@@ -0,0 +1,136 @@
1
+ ---
2
+ title: "Element relationships"
3
+ description: "Style an element from another element's state, size, or position through refs that TypeScript checks."
4
+ ---
5
+
6
+ # Element relationships
7
+
8
+ You want to style an element based on another element: a parent's hover state,
9
+ a sibling's state, the width of a container, or the position of an anchor.
10
+ Tailwind connects the two elements by name, such as `group/card` and
11
+ `group-hover/card:`. It reads these names as strings, so it does not check that
12
+ they match. Nested groups or containers may also need names to target the right
13
+ ancestor. You must avoid name collisions when nesting components.
14
+
15
+ In Stillwind, you create the name as a variable with `style.ref()`. A misspelled
16
+ ref is an undefined variable, so TypeScript reports it.
17
+
18
+ ## React to a parent's state
19
+
20
+ Create a ref, attach it to the parent, and use it in the child's style:
21
+
22
+ ```tsx
23
+ import { style } from "stillwind/react";
24
+
25
+ const card = style.ref("card");
26
+
27
+ export function Card() {
28
+ return (
29
+ <article {...style(card, "rounded-lg p-4")}>
30
+ <h2 {...style({ [card("hover")]: "text-blue-600" })}>Project</h2>
31
+ </article>
32
+ );
33
+ }
34
+ ```
35
+
36
+ `style(card, ...)` attaches the ref to the `<article>`. The key `card("hover")`
37
+ applies `text-blue-600` while the `<article>` is hovered. Write the variants
38
+ inside the call, such as `card("hover:active")`, to combine states.
39
+
40
+ The label `"card"` is optional and only helps you read the generated class
41
+ names. The compiler creates a unique name for each `style.ref()` call, so two
42
+ components can use the label `"card"` without affecting each other.
43
+
44
+ ## React to a sibling's state
45
+
46
+ Without `.in()`, the ref must be on an ancestor of the styled element. To use a
47
+ sibling, add `.in()` with a ref on an element that contains both:
48
+
49
+ ```tsx
50
+ import { style } from "stillwind/react";
51
+
52
+ const card = style.ref("card");
53
+ const trigger = style.ref("trigger");
54
+
55
+ export function Card() {
56
+ return (
57
+ <section {...style(card, "p-4")}>
58
+ <button {...style(trigger, "rounded-md px-4 py-2")}>Details</button>
59
+ <p {...style({ [trigger("hover").in(card)]: "text-blue-600" })}>
60
+ This text changes color while the button is hovered.
61
+ </p>
62
+ </section>
63
+ );
64
+ }
65
+ ```
66
+
67
+ `trigger("hover").in(card)` matches while the `<button>` is hovered and both the
68
+ `<button>` and the `<p>` are inside the `<section>`.
69
+
70
+ ## React to a container's size
71
+
72
+ Make the element a container with `asContainer()`, and query it with `at()`:
73
+
74
+ ```tsx
75
+ import { style } from "stillwind/react";
76
+
77
+ const card = style.ref("card");
78
+
79
+ export function Card() {
80
+ return (
81
+ <section {...style(card, card.asContainer("inline-size"), "p-4")}>
82
+ <p {...style({ [card.at("width >= 40rem")]: "text-lg" })}>
83
+ This text grows when the card is at least 40rem wide.
84
+ </p>
85
+ </section>
86
+ );
87
+ }
88
+ ```
89
+
90
+ Pass `card` and `card.asContainer()` in the same `style()` call. The container
91
+ applies only to an element that has the ref, and the CLI warns when the ref is
92
+ missing.
93
+
94
+ ## Position an element at an anchor
95
+
96
+ Make an element an anchor with `asAnchor()`, and position another element
97
+ against it with `positionAnchor()`:
98
+
99
+ ```tsx
100
+ import { style } from "stillwind/react";
101
+
102
+ const trigger = style.ref("trigger");
103
+
104
+ export function AnchoredHint() {
105
+ return (
106
+ <section {...style(style.anchorScope([trigger]))}>
107
+ <button {...style(trigger, trigger.asAnchor())}>Open hint</button>
108
+ <div
109
+ {...style(trigger.positionAnchor(), "absolute top-[anchor(bottom)] left-[anchor(left)]")}
110
+ >
111
+ Anchor-positioned content
112
+ </div>
113
+ </section>
114
+ );
115
+ }
116
+ ```
117
+
118
+ `style.anchorScope([trigger])` limits the anchor name to the `<section>`, so
119
+ each rendered `AnchoredHint` positions against its own button. Stillwind
120
+ generates CSS anchor positioning only. Check that the browsers you support
121
+ implement it.
122
+
123
+ ## Share refs between components
124
+
125
+ Export a ref from its module and import it where you need it. Keep the call or
126
+ `.in()` chain, such as `card("hover")`, directly in the key of the `style()`
127
+ call. You cannot store it in a variable and use it later.
128
+
129
+ ## Report group and peer variants
130
+
131
+ The `stylistic` preset includes
132
+ [prefer-typed-relationships](../lints/prefer-typed-relationships.md). The rule
133
+ reports `group-*` and `peer-*` variants so that you can replace them with refs.
134
+
135
+ The [style.ref() reference](../macros/ref/index.md) lists every method and its
136
+ accepted inputs.
@@ -0,0 +1,128 @@
1
+ ---
2
+ title: "Checks in the editor and CI"
3
+ description: "Catch misspelled utilities, conflicts, and project policy violations with the CLI, CI, and the editor."
4
+ ---
5
+
6
+ # Checks in the editor and CI
7
+
8
+ You want to catch misspelled utilities, conflicting styles, and values outside
9
+ your theme before you merge a change. Stillwind checks them with lint rules.
10
+ The CLI, CI, the editor, and AI agents all use the same rules from
11
+ `stillwind.config.ts`.
12
+
13
+ ## What the build checks
14
+
15
+ The build stops on compiler errors, such as a JavaScript syntax error or a
16
+ `style()` call that cannot compile. See [Compiler errors](../errors/index.md).
17
+
18
+ The build does not run lint rules. A misspelled utility such as `bg-acent`
19
+ produces no CSS, and the page still renders without that style. Run the CLI or
20
+ use the editor to find such mistakes.
21
+
22
+ ## Run the CLI
23
+
24
+ ```sh
25
+ vp i -D @stillwind/cli
26
+ ```
27
+
28
+ Run these commands from the application root:
29
+
30
+ ```sh
31
+ vp exec stillwind lint
32
+ vp exec stillwind lint --fix
33
+ vp exec stillwind fmt
34
+ ```
35
+
36
+ `lint` reports findings. `lint --fix` also applies the automatic fixes that the
37
+ rules provide. `fmt` sorts the utilities in `style()` calls. Review the changes
38
+ before you commit a large fix.
39
+
40
+ The CLI checks the files that `files` selects in `stillwind.config.ts`, including
41
+ files that the application does not import.
42
+
43
+ ## Choose rules
44
+
45
+ Without a `lint` setting, the project uses the `recommended` preset. Add a
46
+ `lint` setting to add presets or change rules:
47
+
48
+ ```ts title="stillwind.config.ts"
49
+ import { defineConfig, lintPresets } from "stillwind/config";
50
+
51
+ export default defineConfig({
52
+ projects: [
53
+ {
54
+ css: "./src/stillwind.css",
55
+ files: ["src/**/*.{ts,tsx,vue,svelte,astro}"],
56
+ lint: {
57
+ extends: [lintPresets.recommended, lintPresets.stylistic],
58
+ rules: { "no-arbitrary-colors": "warn" },
59
+ },
60
+ },
61
+ ],
62
+ });
63
+ ```
64
+
65
+ When you write a `lint` setting, list `lintPresets.recommended` in `extends`.
66
+ A `lint` setting without `extends` uses no preset.
67
+
68
+ | Preset | Contents |
69
+ | ------------- | ---------------------------------------------------------------------- |
70
+ | `recommended` | Invalid input, conflicting styles, and other likely mistakes |
71
+ | `strict` | Every `recommended` rule as an error, and unused suppression comments |
72
+ | `stylistic` | Preferred spellings and utility sorting; combine it with `recommended` |
73
+
74
+ Each rule has a severity. `warn` reports a warning, `deny` reports an error,
75
+ and `off` disables the rule and its fixes. To adopt a new rule, set it to `warn`
76
+ first, fix the existing code, and then change it to `deny`.
77
+
78
+ [Configuration](../configuration.md#lint) describes rule options, and the
79
+ [lint rule reference](../lints/index.md) lists every rule.
80
+
81
+ ## Run the checks in CI
82
+
83
+ ```sh
84
+ vp exec stillwind lint
85
+ vp exec stillwind fmt --check
86
+ ```
87
+
88
+ `lint` fails when an error remains. `fmt --check` fails when utilities need
89
+ sorting. Warnings do not fail the command. Add `--max-warnings 0` to fail on
90
+ warnings too.
91
+
92
+ In GitHub Actions, the CLI prints findings as annotations that link to the reported lines.
93
+
94
+ ## Let AI agents run the checks
95
+
96
+ Tell your agent to run `stillwind lint --fix` and `stillwind fmt` after it edits
97
+ styles. The agent sees the same findings as you. Add `--format json` when the
98
+ agent or a script reads the results.
99
+
100
+ ## Check while you edit
101
+
102
+ The [VS Code extension](https://github.com/SegaraRai/stillwind/blob/main/packages/vscode-extension/README.md)
103
+ shows findings as you type, including in unsaved files. It also offers the
104
+ automatic fixes as Quick Fixes. To fix and sort on save, add these settings:
105
+
106
+ ```json
107
+ {
108
+ "editor.codeActionsOnSave": {
109
+ "source.fixAll.stillwind": "explicit",
110
+ "source.sort.stillwind": "explicit"
111
+ }
112
+ }
113
+ ```
114
+
115
+ ## Allow an exception
116
+
117
+ When code breaks a rule on purpose, add a comment on the line above it. Name the
118
+ rule, and give the reason after `--`:
119
+
120
+ ```ts
121
+ import { style } from "stillwind/react";
122
+
123
+ // swlint-disable-next-line no-arbitrary-colors -- External brand color.
124
+ export const badge = style("bg-[#123456]");
125
+ ```
126
+
127
+ A comment hides the finding only. It does not make a misspelled utility produce
128
+ CSS, and it does not hide compiler errors.