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,185 @@
1
+ ---
2
+ title: "style()"
3
+ description: "Compile utilities, conditions, custom properties, and base styles into props for an element."
4
+ ---
5
+
6
+ # style()
7
+
8
+ `style(...inputs)` returns props for one element. The compiler generates the CSS
9
+ for its utilities at build time. React receives `className` and `style`; the
10
+ other frameworks receive `class` and `style`. Spread the result onto the element.
11
+
12
+ ## Inputs
13
+
14
+ | Input | Example | Effect |
15
+ | --------------------------- | ------------------------------------ | --------------------------------------------------- |
16
+ | A utility string | `"rounded-md p-4 hover:bg-blue-700"` | Adds the utilities |
17
+ | An array | `["p-4", "text-sm"]` | Adds each item |
18
+ | A condition | `active && "bg-blue-500"` | Adds the item when the condition is true at runtime |
19
+ | A ternary | `dark ? "bg-black" : "bg-white"` | Adds one of the two items |
20
+ | An object with variant keys | `{ "hover:": "underline" }` | Adds the value under the variant |
21
+ | A custom property | `{ "--progress": value }` | Sets the property in the inline style |
22
+ | A `class` field | `{ class: className }` | Adds classes from other stylesheets without CSS |
23
+ | A stored `style()` result | `base` | Adds the classes of the base |
24
+
25
+ `false`, `null`, and `undefined` add nothing. Ref, keyframes, and view transition
26
+ calls are also inputs; see [style.ref()](ref/index.md),
27
+ [style.keyframes()](keyframes.md), and
28
+ [style.viewTransition()](view-transition.md).
29
+
30
+ Write utility names as literals. The compiler reads them from the source, so a
31
+ name that your code builds at runtime produces no CSS.
32
+
33
+ Inside an object with variant keys, write utilities only. A `class` field, a
34
+ custom property, a ref, or a stored `style()` result belongs outside that object.
35
+ [invalid-rule-group-input](../lints/invalid-rule-group-input.md) reports these
36
+ inputs.
37
+
38
+ ## Static input
39
+
40
+ A call with only static input compiles to a plain object. The compiler decides
41
+ the order of the CSS rules, so no runtime library merges classes.
42
+
43
+ ### Source
44
+
45
+ ```tsx
46
+ import { style } from "stillwind/react";
47
+
48
+ export const props = style("rounded-md p-4 text-blue-600");
49
+ ```
50
+
51
+ ### Compiled code
52
+
53
+ ```ts
54
+ export const props = {className:"sw_ad8bv"};
55
+ ```
56
+
57
+ ### Generated CSS
58
+
59
+
60
+ ```css
61
+ .sw_ad8bv {
62
+ padding: calc(var(--spacing) * 4);
63
+ color: var(--color-blue-600);
64
+ border-radius: var(--radius-md);
65
+ }
66
+ ```
67
+
68
+ ## Conditions and custom properties
69
+
70
+ Variants such as `hover:` stay in CSS. A JavaScript condition only chooses which
71
+ compiled class the element gets. A custom property becomes part of the inline
72
+ style.
73
+
74
+ ### Source
75
+
76
+ ```tsx
77
+ import { style } from "stillwind/react";
78
+
79
+ declare const active: boolean;
80
+ export const props = style("p-4", active && "bg-blue-500", {
81
+ "--progress": 0.5,
82
+ });
83
+ ```
84
+
85
+ ### Compiled code
86
+
87
+ ```ts
88
+ import { stillwindClsx } from "stillwind/runtime/class-name-object";
89
+
90
+ declare const active: boolean;
91
+ export const props = {className:stillwindClsx("sw_4td0b",(active) && ("sw_dq3t9")),style:{"--progress":"0.5"}};
92
+ ```
93
+
94
+ ### Generated CSS
95
+
96
+
97
+ ```css
98
+ .sw_4td0b {
99
+ padding: calc(var(--spacing) * 4);
100
+ }
101
+
102
+ .sw_dq3t9 {
103
+ background-color: var(--color-blue-500);
104
+ }
105
+ ```
106
+
107
+ The compiled code imports `stillwindClsx` to join class names. In development,
108
+ Stillwind imports a checked version that reports invalid values.
109
+
110
+ ## Base styles
111
+
112
+ A stored `style()` result passed to another call is a base. The compiler places
113
+ the base's CSS before the CSS generated by the call that receives it. The later
114
+ declarations win when the other cascade criteria, such as specificity and
115
+ importance, are equal. See [CSS ordering](../concepts/css-ordering.md).
116
+
117
+ ### Source
118
+
119
+ ```tsx
120
+ import { style } from "stillwind/react";
121
+
122
+ const base = style("rounded-md p-2");
123
+ export const props = style(base, "p-4 bg-blue-600 text-white");
124
+ ```
125
+
126
+ ### Compiled code
127
+
128
+ ```ts
129
+ import { stillwindClassKey, stillwindMerge, stillwindToFragment } from "stillwind/runtime/class-name-object";
130
+
131
+ const base = {className:"sw_lqeqi"};
132
+ export const props = stillwindMerge({[stillwindClassKey]:"sw_cb2cz"},stillwindToFragment((base)));
133
+ ```
134
+
135
+ ### Generated CSS
136
+
137
+
138
+ ```css
139
+ .sw_lqeqi {
140
+ padding: calc(var(--spacing) * 2);
141
+ border-radius: var(--radius-md);
142
+ }
143
+
144
+ .sw_cb2cz {
145
+ padding: calc(var(--spacing) * 4);
146
+ color: var(--color-white);
147
+ background-color: var(--color-blue-600);
148
+ }
149
+ ```
150
+
151
+ A base can come from any framework entrypoint and passes on its classes only.
152
+ The receiving call returns its own framework's props. The base's inline style and
153
+ custom properties do not carry over, and [invalid-style-composition](../lints/invalid-style-composition.md)
154
+ reports them. Set them in the call that receives the base.
155
+
156
+ When two independent bases in one call set the same property, their argument
157
+ order does not decide which one wins.
158
+ [ambiguous-style-base-order](../lints/ambiguous-style-base-order.md) reports
159
+ this case.
160
+
161
+ Store a base in a variable before you pass it. A `style()` call written
162
+ directly inside another call produces no CSS, and
163
+ [invalid-style-input](../lints/invalid-style-input.md) reports it.
164
+
165
+ ## How props combine at runtime
166
+
167
+ When the compiler cannot reduce a call to a plain object, a runtime helper
168
+ combines the inputs:
169
+
170
+ - Classes keep their order.
171
+ - A later inline style replaces an earlier one.
172
+ - A later custom property replaces an earlier one with the same name.
173
+ - Custom properties apply on top of an inline style.
174
+
175
+ ## Side effects in arguments
176
+
177
+ The compiler can evaluate arguments in any order, and it can skip arguments
178
+ whose result is not used. Arguments must not perform I/O, change shared state,
179
+ or depend on how often they run. Calculate such values before the call.
180
+ [mutating-macro-argument](../lints/mutating-macro-argument.md) and
181
+ [suspending-macro-argument](../lints/suspending-macro-argument.md) report the
182
+ cases that the CLI can detect.
183
+
184
+ See [The basics of style()](../guides/style.md) and
185
+ [Reusable styles](../guides/reusable-styles.md) for task-based guides.
@@ -0,0 +1,159 @@
1
+ ---
2
+ title: "style.viewTransition()"
3
+ description: "Define view transition snapshot styles, and give each element a transition name with .for()."
4
+ ---
5
+
6
+ # style.viewTransition()
7
+
8
+ `style.viewTransition(definition)` defines the styles of view transition
9
+ snapshots. Passing the result to `style()` adds its transition class to the
10
+ element. Calling `.for(key)` also gives the element a `view-transition-name`.
11
+
12
+ ## Example
13
+
14
+ ### Source
15
+
16
+ ```tsx
17
+ import { style } from "stillwind/react";
18
+
19
+ const transition = style.viewTransition({
20
+ old: "duration-150",
21
+ new: "delay-150 duration-150",
22
+ });
23
+ export const props = style(transition.for("product-42"));
24
+ ```
25
+
26
+ ### Compiled code
27
+
28
+ ```ts
29
+ const transition = undefined;
30
+ export const props = {className:"sw_krt7u"};
31
+ ```
32
+
33
+ ### Generated CSS
34
+
35
+
36
+ ```css
37
+ ::view-transition-old(.sw-vt-szy06) {
38
+ animation-duration: .15s;
39
+ }
40
+
41
+ ::view-transition-new(.sw-vt-szy06) {
42
+ animation-delay: .15s;
43
+ animation-duration: .15s;
44
+ }
45
+
46
+ .sw_krt7u {
47
+ view-transition-class: sw-vt-szy06;
48
+ }
49
+
50
+ .sw_krt7u {
51
+ view-transition-name: sw-vt-szy06-product-42;
52
+ }
53
+ ```
54
+
55
+ ## Define the snapshot styles
56
+
57
+ Write `style.viewTransition()` as the initial value of a variable, with an
58
+ object literal as its argument:
59
+
60
+ | Field | Styles |
61
+ | ----------- | ------------------------------------------------------------- |
62
+ | `group` | `::view-transition-group()` |
63
+ | `imagePair` | `::view-transition-image-pair()` |
64
+ | `old` | `::view-transition-old()` |
65
+ | `new` | `::view-transition-new()` |
66
+ | `label` | An optional string literal that appears in the generated name |
67
+
68
+ Each field except `label` is a utility string literal. Timing utilities set
69
+ animation properties, such as `animation-duration`. Media and `supports-*`
70
+ variants can condition a utility. State and container variants are not
71
+ supported.
72
+
73
+ The declaration can be at the top level of a module, in a function, or in a
74
+ callback. Each `style.viewTransition()` call in the source creates one class,
75
+ and the class stays the same in every render and function call. You can export
76
+ the definition and import it in other modules.
77
+
78
+ ## Name the element
79
+
80
+ `transition.for(key)` adds the transition class and sets
81
+ `view-transition-name` from the key. The key is a string or a number. Without a
82
+ key, Stillwind uses an empty string.
83
+
84
+ Use a key that stays the same for the same item before and after the update.
85
+ Items on the page at the same time need different keys. Stillwind cannot check
86
+ that keys are unique across the page or that the old and new snapshots pair
87
+ correctly. Rendering a component many times does not create new names.
88
+
89
+ Write `.for()` directly in `style()`. You cannot store its result in a variable
90
+ and use it later.
91
+
92
+ ## Dynamic keys
93
+
94
+ With a literal key, the compiler writes the name into the CSS. With a key that
95
+ is known only at runtime, a helper builds the name, and the element receives it
96
+ as an inline style.
97
+
98
+ ### Source
99
+
100
+ ```tsx
101
+ import { style } from "stillwind/react";
102
+
103
+ const transition = style.viewTransition({
104
+ old: "duration-150",
105
+ new: "duration-150",
106
+ });
107
+
108
+ declare const id: string;
109
+ export const props = style(transition.for(id));
110
+ ```
111
+
112
+ ### Compiled code
113
+
114
+ ```ts
115
+ import { stillwindViewTransitionName } from "stillwind/runtime/class-name-object";
116
+
117
+ const transition = undefined;
118
+
119
+ declare const id: string;
120
+ export const props = {className:"sw_zhaz3",style:{"view-transition-name":stillwindViewTransitionName("sw-vt-szy06",id)}};
121
+ ```
122
+
123
+ ### Generated CSS
124
+
125
+
126
+ ```css
127
+ ::view-transition-old(.sw-vt-szy06) {
128
+ animation-duration: .15s;
129
+ }
130
+
131
+ ::view-transition-new(.sw-vt-szy06) {
132
+ animation-duration: .15s;
133
+ }
134
+
135
+ .sw_zhaz3 {
136
+ view-transition-class: sw-vt-szy06;
137
+ }
138
+ ```
139
+
140
+ When a variant conditions a dynamic name, such as `{ "md:": transition.for(id) }`,
141
+ the name goes through a custom property so that CSS can apply it only under the
142
+ condition.
143
+
144
+ A dynamic key follows the same rules as other `style()` arguments: it must not
145
+ have side effects. Neither helper starts a view transition.
146
+
147
+ ## Combine transitions on one element
148
+
149
+ One `style()` call can add several transition classes, but only one `.for()`.
150
+ Pass the other definitions without `.for()`, such as `style(fade, slide.for(id))`.
151
+
152
+ Transition classes from separate `style()` calls do not combine. Each call sets
153
+ the whole `view-transition-class` list, so one list replaces the other.
154
+ [split-view-transition-class](../lints/split-view-transition-class.md) and
155
+ [duplicate-view-transition-name](../lints/duplicate-view-transition-name.md)
156
+ report these cases.
157
+
158
+ See [View transitions](../guides/view-transitions.md) to start a transition
159
+ from your application.
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: "Built-in utilities"
3
+ description: "Look up the CSS of a utility, or find the canonical utility for CSS declarations."
4
+ ---
5
+
6
+ # Built-in utilities
7
+
8
+ Type a utility to see its CSS, or type CSS declarations to find the utility that
9
+ produces them. Arbitrary values, such as `p-[16px]`, resolve to their canonical
10
+ spelling. The URL keeps your input, so you can share the results.
11
+
12
+ ## Read the results
13
+
14
+ Each result shows one utility and its declarations. `&` stands for the styled
15
+ element. Comments show the resolved theme values and pixel sizes. A result for
16
+ CSS declarations names the declaration that it comes from.
17
+
18
+ The results leave out the theme variables and other supporting CSS that the full
19
+ stylesheet contains. The [macro reference](macros/index.md) shows complete
20
+ generated stylesheets.
21
+
22
+ A declaration without a matching utility becomes an arbitrary property, such as
23
+ `[hyphens:manual]`. Variants and shorthand properties can change what a utility
24
+ does, so compare its declarations with your CSS before you replace it.
25
+
26
+ ## What the lookup covers
27
+
28
+ The lookup runs the Stillwind compiler in your browser with the default theme.
29
+ It downloads the compiler when the page opens. Utilities from your own `@theme`
30
+ tokens, such as `bg-brand`, do not resolve here. See
31
+ [Design systems](guides/design-systems.md) to add them, and hover over a
32
+ utility in the editor to check it in your project.
33
+
34
+ The editor and the CLI report non-canonical spellings with
35
+ [prefer-canonical-utilities](lints/prefer-canonical-utilities.md).
package/docs/why.md ADDED
@@ -0,0 +1,144 @@
1
+ ---
2
+ title: "Why Stillwind"
3
+ description: "Keep Tailwind-style code consistent as AI agents write more of it."
4
+ ---
5
+
6
+ # Why Stillwind
7
+
8
+ Tailwind CSS makes styles fast to write, and you can write its classes anywhere.
9
+ As AI agents write more of your code, it becomes harder to keep theme values,
10
+ breakpoints, and names shared between elements consistent by hand.
11
+
12
+ Stillwind keeps the Tailwind CSS v4 utilities that you already know. It compiles
13
+ them at build time and checks them, so you can keep styling code in order.
14
+
15
+ ## Keep values in your theme
16
+
17
+ A utility can produce the right appearance while using values outside your theme:
18
+
19
+ ```tsx
20
+ style("bg-[#3b82f6] p-[13px] min-[713px]:flex");
21
+ ```
22
+
23
+ You can enable rules that report arbitrary colors, spacing, and breakpoints.
24
+ Then every value has to come from the theme in your stylesheet:
25
+
26
+ ```ts
27
+ lint: {
28
+ extends: [lintPresets.recommended],
29
+ rules: {
30
+ "no-arbitrary-colors": "deny",
31
+ "no-arbitrary-spacing": "deny",
32
+ "no-arbitrary-breakpoints": "deny",
33
+ },
34
+ },
35
+ ```
36
+
37
+ To use a breakpoint in JavaScript, call [`style.media()`](macros/media.md) with its name. You do
38
+ not need to copy the breakpoint value into your code.
39
+
40
+ ## Connect elements through variables
41
+
42
+ Tailwind connects elements by name: `group/card` on the parent and
43
+ `group-hover/card:` on the child. Tailwind reads these names as strings, so it
44
+ does not check that the two names agree.
45
+
46
+ In Stillwind, you create the name as a variable with [`style.ref()`](macros/ref/index.md):
47
+
48
+ ```tsx
49
+ import { style } from "stillwind/react";
50
+
51
+ const card = style.ref("card");
52
+
53
+ export function Card() {
54
+ return (
55
+ <article {...style(card, "rounded-lg p-4")}>
56
+ <h2 {...style({ [card("hover")]: "text-blue-600" })}>Project</h2>
57
+ </article>
58
+ );
59
+ }
60
+ ```
61
+
62
+ A misspelled ref is an undefined variable, so TypeScript reports it. Each ref
63
+ gets a generated name, so refs with the same label in different components do
64
+ not affect each other.
65
+
66
+ ## Define animations next to the component
67
+
68
+ With Tailwind, as with plain CSS, keyframes and view transition names live in a
69
+ global stylesheet. In a large codebase, it takes effort to find which component
70
+ uses which name.
71
+
72
+ In Stillwind, you define them in the component that uses them:
73
+
74
+ ```tsx
75
+ import { style } from "stillwind/react";
76
+
77
+ const enter = style.keyframes({
78
+ from: "opacity-0",
79
+ to: "opacity-100",
80
+ });
81
+
82
+ export function Notice() {
83
+ return <aside {...style(enter("duration-300"))}>Your changes are saved.</aside>;
84
+ }
85
+ ```
86
+
87
+ The compiler generates a unique animation name. When you delete the component,
88
+ its animation goes with it.
89
+
90
+ ## Override styles predictably
91
+
92
+ When you combine two styles, the later one wins:
93
+
94
+ ```tsx
95
+ import { style } from "stillwind/react";
96
+
97
+ const button = style("rounded-md bg-blue-600 px-4 py-2 text-white");
98
+ const dangerButton = style(button, "bg-red-600");
99
+ ```
100
+
101
+ `dangerButton` is always red. The compiler fixes the order of the generated CSS,
102
+ so the result does not depend on the order of class names or on how the bundler
103
+ loads modules. You do not need `tailwind-merge`.
104
+
105
+ ## Check styles in the editor and the CLI
106
+
107
+ The CLI reports unknown utilities, conflicting utilities such as `p-2 p-4`, and
108
+ the rules that you enable. It also fixes and sorts utilities:
109
+
110
+ ```sh
111
+ stillwind lint
112
+ stillwind lint --fix
113
+ stillwind fmt
114
+ ```
115
+
116
+ AI agents can run the same commands as you, and CI can run them on every change.
117
+ The VS Code extension shows the same findings while you edit.
118
+
119
+ ## Ship static CSS
120
+
121
+ The compiler turns static utilities into CSS files and class names at build time.
122
+ These styles need no JavaScript at runtime. Conditions and dynamic values add
123
+ only the small runtime helpers that they use. See
124
+ [How styles compile](concepts/how-styles-compile.md) for the generated code.
125
+
126
+ ## What changes from Tailwind
127
+
128
+ Stillwind supports Tailwind CSS v4 utilities, variants, and plugins. You write
129
+ them in a different place:
130
+
131
+ - You pass utilities to `style()` and spread the result onto the element,
132
+ instead of writing a `className` string.
133
+ - Stillwind needs a build tool. It supports Vite, Astro, Next.js, SvelteKit,
134
+ Nuxt, webpack, Rspack, Rsbuild, and Turbopack.
135
+ - Some Tailwind settings move to `stillwind.config.ts`.
136
+
137
+ Tailwind CSS remains the better fit when a project has no build tool, or when
138
+ classes come from places that Stillwind does not compile, such as HTML from a
139
+ CMS. [Tailwind CSS compatibility](guides/tailwind-compatibility.md) lists the
140
+ tested plugins and the differences.
141
+
142
+ [Getting started](index.md) adds Stillwind to a new application.
143
+ [Migrating from Tailwind CSS](guides/migrating-from-tailwind.md) moves an
144
+ existing Tailwind project.
package/index.css ADDED
@@ -0,0 +1,7 @@
1
+ @layer properties, theme, base, components, utilities;
2
+
3
+ @import "./css/theme.css" layer(theme);
4
+ @import "./css/preflight.css" layer(base);
5
+ @import "./css/utilities.css" layer(utilities);
6
+ @import "./css/builtins.css";
7
+ @import "./css/templates.css";
package/package.json CHANGED
@@ -1,11 +1,138 @@
1
1
  {
2
2
  "name": "stillwind",
3
- "version": "0.0.0",
4
- "description": "Placeholder for stillwind",
5
- "main": "index.js",
6
- "scripts": {},
7
- "keywords": [],
8
- "author": "segararai (https://www.npmjs.com/~segararai)",
9
- "license": "UNLICENSED",
10
- "private": false
3
+ "version": "0.1.0",
4
+ "description": "CSS definitions and framework adapters for Stillwind",
5
+ "homepage": "https://stillwind.dev/",
6
+ "bugs": {
7
+ "url": "https://github.com/SegaraRai/stillwind/issues"
8
+ },
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/SegaraRai/stillwind.git",
13
+ "directory": "packages/core"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "index.css",
18
+ "css",
19
+ "docs",
20
+ "skills",
21
+ "AGENTS_TEMPLATE.md",
22
+ "TAILWINDCSS-MIT-LICENSE"
23
+ ],
24
+ "type": "module",
25
+ "sideEffects": [
26
+ "**/*.css"
27
+ ],
28
+ "exports": {
29
+ ".": "./index.css",
30
+ "./builtins.css": "./css/builtins.css",
31
+ "./preflight.css": "./css/preflight.css",
32
+ "./templates.css": "./css/templates.css",
33
+ "./theme.css": "./css/theme.css",
34
+ "./utilities.css": "./css/utilities.css",
35
+ "./config": {
36
+ "types": "./dist/config.d.ts",
37
+ "default": "./dist/config.js"
38
+ },
39
+ "./css": {
40
+ "types": "./dist/css.d.ts",
41
+ "default": "./dist/css.js"
42
+ },
43
+ "./module-css": {
44
+ "types": "./dist/module-css.d.ts",
45
+ "default": "./dist/module-css.js"
46
+ },
47
+ "./macro": {
48
+ "types": "./dist/macro/index.d.ts",
49
+ "default": "./dist/macro/index.js"
50
+ },
51
+ "./alpine": {
52
+ "types": "./dist/frameworks/alpine.d.ts",
53
+ "default": "./dist/frameworks/alpine.js"
54
+ },
55
+ "./astro": {
56
+ "types": "./dist/frameworks/astro.d.ts",
57
+ "default": "./dist/frameworks/astro.js"
58
+ },
59
+ "./lit": {
60
+ "types": "./dist/frameworks/lit.d.ts",
61
+ "default": "./dist/frameworks/lit.js"
62
+ },
63
+ "./preact": {
64
+ "types": "./dist/frameworks/preact.d.ts",
65
+ "default": "./dist/frameworks/preact.js"
66
+ },
67
+ "./qwik": {
68
+ "types": "./dist/frameworks/qwik.d.ts",
69
+ "default": "./dist/frameworks/qwik.js"
70
+ },
71
+ "./react": {
72
+ "types": "./dist/frameworks/react.d.ts",
73
+ "default": "./dist/frameworks/react.js"
74
+ },
75
+ "./solid": {
76
+ "types": "./dist/frameworks/solid.d.ts",
77
+ "default": "./dist/frameworks/solid.js"
78
+ },
79
+ "./svelte": {
80
+ "types": "./dist/frameworks/svelte.d.ts",
81
+ "default": "./dist/frameworks/svelte.js"
82
+ },
83
+ "./vanilla": {
84
+ "types": "./dist/frameworks/vanilla.d.ts",
85
+ "default": "./dist/frameworks/vanilla.js"
86
+ },
87
+ "./vue": {
88
+ "types": "./dist/frameworks/vue.d.ts",
89
+ "default": "./dist/frameworks/vue.js"
90
+ },
91
+ "./runtime/class-name-object": {
92
+ "types": "./dist/runtime/class-name-object.d.ts",
93
+ "default": "./dist/runtime/class-name-object.js"
94
+ },
95
+ "./runtime/class-name-object-development": {
96
+ "types": "./dist/runtime/class-name-object-development.d.ts",
97
+ "default": "./dist/runtime/class-name-object-development.js"
98
+ },
99
+ "./runtime/class-object": {
100
+ "types": "./dist/runtime/class-object.d.ts",
101
+ "default": "./dist/runtime/class-object.js"
102
+ },
103
+ "./runtime/class-object-development": {
104
+ "types": "./dist/runtime/class-object-development.d.ts",
105
+ "default": "./dist/runtime/class-object-development.js"
106
+ },
107
+ "./runtime/class-string": {
108
+ "types": "./dist/runtime/class-string.d.ts",
109
+ "default": "./dist/runtime/class-string.js"
110
+ },
111
+ "./runtime/class-string-development": {
112
+ "types": "./dist/runtime/class-string-development.d.ts",
113
+ "default": "./dist/runtime/class-string-development.js"
114
+ },
115
+ "./package.json": "./package.json"
116
+ },
117
+ "dependencies": {
118
+ "@stillwind/config": "0.1.0",
119
+ "@stillwind/native": "0.1.0",
120
+ "@stillwind/projection": "0.1.0"
121
+ },
122
+ "devDependencies": {
123
+ "@stillwind-internal/tools-workspace": "0.0.0",
124
+ "@types/node": "^26.6.5",
125
+ "lit": "^3.3.3",
126
+ "typescript": "^6.0.3",
127
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
128
+ "vite-plus": "1.4.0"
129
+ },
130
+ "peerDependencies": {
131
+ "lit": "^3.3.0"
132
+ },
133
+ "peerDependenciesMeta": {
134
+ "lit": {
135
+ "optional": true
136
+ }
137
+ }
11
138
  }