stillwind 0.7.0 → 0.9.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 (232) hide show
  1. package/CHANGELOG.md +193 -0
  2. package/css/builtin-variants/sw-conditional.css +10 -1
  3. package/css/builtin-variants/tw-relationship.css +4 -4
  4. package/css/builtins.css +1 -1
  5. package/dist/{class-object-D7ZGJOf_.d.ts → class-object-BaK8uudd.d.ts} +2 -2
  6. package/dist/class-object-DNcjzcfH.js +6 -0
  7. package/dist/{class-object-D24FFYqO.js.map → class-object-DNcjzcfH.js.map} +1 -1
  8. package/dist/{class-string-CQHnc9GN.d.ts → class-string-C5YFtXQn.d.ts} +2 -2
  9. package/dist/class-string-KnYInbiw.js +6 -0
  10. package/dist/{class-string-Db8-oI4q.js.map → class-string-KnYInbiw.js.map} +1 -1
  11. package/dist/{cva-BwX07CFw.js → formats-Ctf2WFc-.js} +87 -2
  12. package/dist/formats-Ctf2WFc-.js.map +1 -0
  13. package/dist/formats-aeLCNAXl.d.ts +73 -0
  14. package/dist/frameworks/alpine.d.ts +3 -3
  15. package/dist/frameworks/alpine.js +1 -1
  16. package/dist/frameworks/alpine.js.map +1 -1
  17. package/dist/frameworks/astro.d.ts +3 -3
  18. package/dist/frameworks/astro.js +1 -1
  19. package/dist/frameworks/lit.d.ts +3 -3
  20. package/dist/frameworks/lit.js +1 -1
  21. package/dist/frameworks/lit.js.map +1 -1
  22. package/dist/frameworks/preact.d.ts +3 -3
  23. package/dist/frameworks/preact.js +1 -1
  24. package/dist/frameworks/qwik.d.ts +3 -3
  25. package/dist/frameworks/qwik.js +1 -1
  26. package/dist/frameworks/react.d.ts +2 -2
  27. package/dist/frameworks/react.js +1 -1
  28. package/dist/frameworks/solid.d.ts +3 -3
  29. package/dist/frameworks/solid.js +1 -1
  30. package/dist/frameworks/svelte.d.ts +3 -3
  31. package/dist/frameworks/svelte.js +1 -1
  32. package/dist/frameworks/vanilla.d.ts +3 -3
  33. package/dist/frameworks/vanilla.js +1 -1
  34. package/dist/frameworks/vue.d.ts +3 -3
  35. package/dist/frameworks/vue.js +1 -1
  36. package/dist/{index-RwVFpxhE.d.ts → index-DBpgaaD7.d.ts} +54 -5
  37. package/dist/macro/index.d.ts +2 -2
  38. package/dist/macro/index.js +1 -1
  39. package/dist/runtime/development.d.ts +47 -0
  40. package/dist/{development-J-JCSIm0.js → runtime/development.js} +41 -5
  41. package/dist/runtime/development.js.map +1 -0
  42. package/dist/runtime/index.d.ts +2 -0
  43. package/dist/runtime/index.js +1 -0
  44. package/dist/{style-fTQbsVWZ.js → style-BE8vuLiO.js} +4 -1
  45. package/dist/style-BE8vuLiO.js.map +1 -0
  46. package/docs/at-rules/apply.md +5 -5
  47. package/docs/at-rules/custom-variant.md +12 -12
  48. package/docs/at-rules/index.md +19 -19
  49. package/docs/at-rules/plugin.md +7 -7
  50. package/docs/at-rules/registry-directives.md +9 -9
  51. package/docs/at-rules/slot.md +6 -6
  52. package/docs/at-rules/stillwind-css-template.md +7 -7
  53. package/docs/at-rules/stillwind-property.md +10 -10
  54. package/docs/at-rules/stillwind-registry.md +18 -18
  55. package/docs/at-rules/stillwind-require-properties.md +9 -9
  56. package/docs/at-rules/stillwind-slot.md +6 -6
  57. package/docs/at-rules/stillwind-undef-arbitrary-property.md +9 -9
  58. package/docs/at-rules/stillwind-undef-utility.md +10 -10
  59. package/docs/at-rules/stillwind-undef-variant.md +6 -6
  60. package/docs/at-rules/theme.md +23 -23
  61. package/docs/at-rules/utility.md +30 -30
  62. package/docs/at-rules/variant.md +6 -6
  63. package/docs/cli.md +11 -8
  64. package/docs/concepts/css-ordering.md +19 -19
  65. package/docs/concepts/how-styles-compile.md +17 -17
  66. package/docs/concepts/stylesheets.md +4 -4
  67. package/docs/configuration.md +34 -34
  68. package/docs/editors.md +9 -8
  69. package/docs/errors/SW01003.md +1 -1
  70. package/docs/errors/SW10001.md +1 -1
  71. package/docs/errors/SW10002.md +1 -1
  72. package/docs/errors/SW10004.md +7 -6
  73. package/docs/errors/SW10005.md +1 -1
  74. package/docs/errors/SW11001.md +1 -1
  75. package/docs/errors/SW11003.md +1 -1
  76. package/docs/errors/SW12001.md +2 -2
  77. package/docs/errors/SW12002.md +1 -1
  78. package/docs/errors/SW13001.md +1 -1
  79. package/docs/errors/SW13003.md +2 -2
  80. package/docs/errors/SW14001.md +1 -1
  81. package/docs/errors/SW14003.md +4 -4
  82. package/docs/errors/SW14004.md +2 -2
  83. package/docs/errors/SW14005.md +1 -1
  84. package/docs/errors/SW14006.md +1 -1
  85. package/docs/errors/SW14007.md +2 -2
  86. package/docs/errors/SW14008.md +1 -1
  87. package/docs/errors/SW30001.md +1 -1
  88. package/docs/errors/SW31001.md +1 -1
  89. package/docs/errors/SW31004.md +1 -1
  90. package/docs/errors/SW33005.md +1 -1
  91. package/docs/errors/SW34002.md +1 -1
  92. package/docs/errors/SW90001.md +1 -1
  93. package/docs/errors/SW90005.md +1 -1
  94. package/docs/errors/SW90006.md +1 -1
  95. package/docs/errors/index.md +72 -72
  96. package/docs/formatters.md +5 -5
  97. package/docs/guides/animations.md +7 -8
  98. package/docs/guides/design-systems.md +7 -7
  99. package/docs/guides/element-relationships.md +15 -19
  100. package/docs/guides/lint-adoption.md +5 -5
  101. package/docs/guides/migrating-from-css.md +11 -11
  102. package/docs/guides/migrating-from-tailwind.md +16 -16
  103. package/docs/guides/recommended-practices.md +18 -18
  104. package/docs/guides/responsive-styles.md +7 -7
  105. package/docs/guides/reusable-styles.md +10 -5
  106. package/docs/guides/runtime-conditions.md +6 -6
  107. package/docs/guides/style.md +42 -10
  108. package/docs/guides/tailwind-compatibility.md +23 -22
  109. package/docs/guides/view-transitions.md +9 -11
  110. package/docs/guides/web-components.md +4 -4
  111. package/docs/index.md +14 -12
  112. package/docs/integrations.md +3 -3
  113. package/docs/lints/ambiguous-style-base-order.md +4 -2
  114. package/docs/lints/bypassed-undefinition.md +3 -3
  115. package/docs/lints/clamped-value.md +1 -1
  116. package/docs/lints/conflicting-provider-properties.md +2 -2
  117. package/docs/lints/conflicting-utilities.md +45 -3
  118. package/docs/lints/document-scoped-selector.md +1 -1
  119. package/docs/lints/duplicate-definition.md +3 -3
  120. package/docs/lints/duplicate-utility.md +2 -2
  121. package/docs/lints/duplicate-view-transition-name.md +3 -3
  122. package/docs/lints/ignored-definition-condition.md +2 -2
  123. package/docs/lints/ignored-tailwind-feature.md +3 -3
  124. package/docs/lints/implicit-nesting-selector.md +2 -2
  125. package/docs/lints/incompatible-property-value.md +3 -3
  126. package/docs/lints/incompatible-theme-value.md +1 -1
  127. package/docs/lints/index.md +74 -73
  128. package/docs/lints/ineffective-anchor-scope.md +2 -2
  129. package/docs/lints/interfering-imported-style-base.md +22 -4
  130. package/docs/lints/invalid-animation-option.md +3 -3
  131. package/docs/lints/invalid-css-directive.md +3 -3
  132. package/docs/lints/invalid-css-import.md +2 -2
  133. package/docs/lints/invalid-css-input.md +4 -4
  134. package/docs/lints/invalid-cva-config.md +2 -2
  135. package/docs/lints/invalid-cva-input.md +4 -4
  136. package/docs/lints/invalid-keyframes-definition.md +2 -2
  137. package/docs/lints/invalid-keyframes-use.md +2 -2
  138. package/docs/lints/invalid-keyframes-variant.md +4 -4
  139. package/docs/lints/invalid-lint-suppression.md +3 -3
  140. package/docs/lints/invalid-marker-use.md +2 -2
  141. package/docs/lints/invalid-media-query.md +4 -4
  142. package/docs/lints/invalid-ref-input.md +4 -4
  143. package/docs/lints/invalid-rule-group-input.md +2 -2
  144. package/docs/lints/invalid-runtime-condition.md +3 -3
  145. package/docs/lints/invalid-stored-variant.md +52 -0
  146. package/docs/lints/invalid-style-composition.md +2 -2
  147. package/docs/lints/invalid-style-input.md +2 -2
  148. package/docs/lints/invalid-theme-reference.md +3 -3
  149. package/docs/lints/invalid-utility.md +3 -3
  150. package/docs/lints/invalid-variant.md +2 -2
  151. package/docs/lints/invalid-view-transition-definition.md +2 -2
  152. package/docs/lints/invalid-view-transition-use.md +2 -2
  153. package/docs/lints/invalid-view-transition-variant.md +3 -3
  154. package/docs/lints/mismatched-framework-import.md +3 -3
  155. package/docs/lints/missing-document-target.md +2 -2
  156. package/docs/lints/missing-ref-attachment.md +4 -4
  157. package/docs/lints/missing-view-transition-name.md +3 -3
  158. package/docs/lints/mutating-macro-argument.md +2 -2
  159. package/docs/lints/no-arbitrary-breakpoints.md +2 -2
  160. package/docs/lints/no-arbitrary-colors.md +2 -2
  161. package/docs/lints/no-arbitrary-spacing.md +1 -1
  162. package/docs/lints/no-class-property.md +3 -3
  163. package/docs/lints/no-important.md +2 -2
  164. package/docs/lints/no-restricted-declarations.md +1 -1
  165. package/docs/lints/no-restricted-length-units.md +1 -1
  166. package/docs/lints/no-restricted-theme-tokens.md +1 -1
  167. package/docs/lints/no-restricted-utilities.md +2 -2
  168. package/docs/lints/prefer-canonical-utilities.md +2 -2
  169. package/docs/lints/prefer-direct-styling.md +3 -3
  170. package/docs/lints/prefer-logical-properties.md +3 -3
  171. package/docs/lints/prefer-sorted-utilities.md +2 -2
  172. package/docs/lints/prefer-typed-relationships.md +3 -3
  173. package/docs/lints/prefer-typed-variables.md +1 -1
  174. package/docs/lints/prefer-variant-directive.md +3 -3
  175. package/docs/lints/redundant-variant.md +2 -2
  176. package/docs/lints/repeated-nesting-selector.md +2 -2
  177. package/docs/lints/runtime-condition-requires-css-if.md +3 -3
  178. package/docs/lints/split-view-transition-class.md +3 -3
  179. package/docs/lints/suspending-macro-argument.md +2 -2
  180. package/docs/lints/unknown-utility.md +4 -4
  181. package/docs/lints/unknown-variant.md +2 -2
  182. package/docs/lints/unmatched-host-selector.md +2 -2
  183. package/docs/lints/unsatisfiable-variants.md +1 -1
  184. package/docs/lints/unused-lint-suppression.md +1 -1
  185. package/docs/lints/unverified-style-base.md +2 -2
  186. package/docs/macros/anchor-scope.md +13 -13
  187. package/docs/macros/css.md +7 -7
  188. package/docs/macros/cva.md +17 -16
  189. package/docs/macros/index.md +10 -9
  190. package/docs/macros/keyframes.md +9 -9
  191. package/docs/macros/media.md +2 -2
  192. package/docs/macros/ref/as-anchor.md +11 -11
  193. package/docs/macros/ref/as-container.md +8 -8
  194. package/docs/macros/ref/at.md +10 -10
  195. package/docs/macros/ref/condition.md +9 -8
  196. package/docs/macros/ref/in.md +11 -11
  197. package/docs/macros/ref/index.md +17 -16
  198. package/docs/macros/ref/position-anchor.md +9 -9
  199. package/docs/macros/style.md +53 -27
  200. package/docs/macros/view-transition.md +17 -17
  201. package/docs/macros/when.md +129 -0
  202. package/docs/plugins/iconify.md +5 -5
  203. package/docs/plugins/index.md +4 -4
  204. package/docs/utilities-and-variants.md +6 -6
  205. package/docs/why.md +13 -15
  206. package/package.json +14 -28
  207. package/dist/class-object-D24FFYqO.js +0 -6
  208. package/dist/class-string-Db8-oI4q.js +0 -6
  209. package/dist/cva-BwX07CFw.js.map +0 -1
  210. package/dist/cva-DSpDNBYi.d.ts +0 -9
  211. package/dist/development-DttPQc71.d.ts +0 -27
  212. package/dist/development-J-JCSIm0.js.map +0 -1
  213. package/dist/runtime/class-name-object-development.d.ts +0 -10
  214. package/dist/runtime/class-name-object-development.js +0 -18
  215. package/dist/runtime/class-name-object-development.js.map +0 -1
  216. package/dist/runtime/class-name-object.d.ts +0 -16
  217. package/dist/runtime/class-name-object.js +0 -31
  218. package/dist/runtime/class-name-object.js.map +0 -1
  219. package/dist/runtime/class-object-development.d.ts +0 -10
  220. package/dist/runtime/class-object-development.js +0 -18
  221. package/dist/runtime/class-object-development.js.map +0 -1
  222. package/dist/runtime/class-object.d.ts +0 -16
  223. package/dist/runtime/class-object.js +0 -31
  224. package/dist/runtime/class-object.js.map +0 -1
  225. package/dist/runtime/class-string-development.d.ts +0 -10
  226. package/dist/runtime/class-string-development.js +0 -18
  227. package/dist/runtime/class-string-development.js.map +0 -1
  228. package/dist/runtime/class-string.d.ts +0 -16
  229. package/dist/runtime/class-string.js +0 -31
  230. package/dist/runtime/class-string.js.map +0 -1
  231. package/dist/shared-B9IQXU6P.d.ts +0 -32
  232. package/dist/style-fTQbsVWZ.js.map +0 -1
@@ -11,14 +11,15 @@ and it shows the generated JavaScript and CSS for its examples.
11
11
 
12
12
  | Macro | Use it to | Guide |
13
13
  | -------------------------------------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------- |
14
- | [`style()`](style.md) | Style an element | [The basics of style()](../guides/style.md) |
15
- | [`style.ref()`](ref/index.md) | Style an element from another element's state, size, or position | [Element relationships](../guides/element-relationships.md) |
16
- | [`style.anchorScope()`](anchor-scope.md) | Limit where an anchor name is visible | [Element relationships](../guides/element-relationships.md) |
17
- | [`style.keyframes()`](keyframes.md) | Define an animation in a component | [Animations](../guides/animations.md) |
18
- | [`style.viewTransition()`](view-transition.md) | Style view transition snapshots and name each item | [View transitions](../guides/view-transitions.md) |
19
- | [`style.media()`](media.md) | Use a named breakpoint as a media query in JavaScript | [Responsive styles](../guides/responsive-styles.md) |
20
- | [`style.css()`](css.md) | Compile utilities into a CSS string for a shadow root | [Web Components](../guides/web-components.md) |
21
- | [`style.cva()`](cva.md) | Migrate components that use `cva` | [Migrating from Tailwind CSS](../guides/migrating-from-tailwind.md) |
14
+ | [`style()`](https://stillwind.dev/docs/macros/style) | Style an element | [The basics of style()](https://stillwind.dev/docs/guides/style) |
15
+ | [`style.ref()`](https://stillwind.dev/docs/macros/ref) | Style an element from another element's state, size, or position | [Element relationships](https://stillwind.dev/docs/guides/element-relationships) |
16
+ | [`style.anchorScope()`](https://stillwind.dev/docs/macros/anchor-scope) | Limit where an anchor name is visible | [Element relationships](https://stillwind.dev/docs/guides/element-relationships) |
17
+ | [`style.keyframes()`](https://stillwind.dev/docs/macros/keyframes) | Define an animation in a component | [Animations](https://stillwind.dev/docs/guides/animations) |
18
+ | [`style.viewTransition()`](https://stillwind.dev/docs/macros/view-transition) | Style view transition snapshots and name each item | [View transitions](https://stillwind.dev/docs/guides/view-transitions) |
19
+ | [`style.when()`](https://stillwind.dev/docs/macros/when) | Reuse a variant sequence, such as a ref condition | [Element relationships](https://stillwind.dev/docs/guides/element-relationships) |
20
+ | [`style.media()`](https://stillwind.dev/docs/macros/media) | Use a named breakpoint as a media query in JavaScript | [Responsive styles](https://stillwind.dev/docs/guides/responsive-styles) |
21
+ | [`style.css()`](https://stillwind.dev/docs/macros/css) | Compile utilities into a CSS string for a shadow root | [Web Components](https://stillwind.dev/docs/guides/web-components) |
22
+ | [`style.cva()`](https://stillwind.dev/docs/macros/cva) | Migrate components that use `cva` | [Migrating from Tailwind CSS](https://stillwind.dev/docs/guides/migrating-from-tailwind) |
22
23
 
23
24
  Import the macros from the entrypoint of your framework, such as
24
25
  `stillwind/react`. The examples on these pages use React.
@@ -26,5 +27,5 @@ Import the macros from the entrypoint of your framework, such as
26
27
  Each example shows the source, the compiled code, and the CSS that it adds to
27
28
  the stylesheet. In development, Stillwind also adds checks that report invalid
28
29
  values at runtime. The compiled code on these pages leaves them out.
29
- [How styles compile](../concepts/how-styles-compile.md) explains the generated code in
30
+ [How styles compile](https://stillwind.dev/docs/concepts/how-styles-compile) explains the generated code in
30
31
  general.
@@ -6,7 +6,7 @@ description: "Define keyframes in a component, and apply them with animation opt
6
6
  # style.keyframes()
7
7
 
8
8
  `style.keyframes(definition)` defines an animation. Calling the result inside
9
- [`style()`](style.md) applies the animation, and its argument sets
9
+ [`style()`](https://stillwind.dev/docs/macros/style) applies the animation, and its argument sets
10
10
  the animation's options. The compiler generates a unique animation name.
11
11
 
12
12
  ## Example
@@ -27,14 +27,14 @@ export const props = style(fade("duration-300 ease-in-out"));
27
27
 
28
28
  ```ts
29
29
  const fade = undefined;
30
- export const props = {className:"sw_4y7y6"};
30
+ export const props = {className:"sw_tcsva"};
31
31
  ```
32
32
 
33
33
  ### Generated CSS
34
34
 
35
35
 
36
36
  ```css
37
- @keyframes sw-kf-74r1m {
37
+ @keyframes sw-kf-zylc1 {
38
38
  from {
39
39
  opacity: 0;
40
40
  }
@@ -44,8 +44,8 @@ export const props = {className:"sw_4y7y6"};
44
44
  }
45
45
  }
46
46
 
47
- .sw_4y7y6 {
48
- animation-name: sw-kf-74r1m;
47
+ .sw_tcsva {
48
+ animation-name: sw-kf-zylc1;
49
49
  animation-duration: .3s;
50
50
  animation-timing-function: var(--ease-in-out);
51
51
  }
@@ -78,10 +78,10 @@ The argument is a string literal of animation options. Timing utilities set
78
78
  animation properties here: `duration-300` sets `animation-duration`, not
79
79
  `transition-duration`. A utility that is not an animation option, such as
80
80
  `p-4`, produces no CSS, and
81
- [invalid-animation-option](../lints/invalid-animation-option.md) reports it.
81
+ [invalid-animation-option](https://stillwind.dev/docs/lints/invalid-animation-option) reports it.
82
82
 
83
83
  Write the call directly in `style()`. Storing `fade("duration-300")` in a
84
- variable causes [SW10004](../errors/SW10004.md).
84
+ variable causes [SW10004](https://stillwind.dev/docs/errors/SW10004).
85
85
 
86
86
  To turn the animation on or off by condition, put the call under a variant, such
87
87
  as `{ "motion-safe:": fade("duration-300") }`.
@@ -94,6 +94,6 @@ The compiler writes every
94
94
  [`@keyframes`](https://developer.mozilla.org/docs/Web/CSS/Reference/At-rules/@keyframes)
95
95
  rule that the calls need, together with the theme values that the frames use.
96
96
 
97
- See [Animations](../guides/animations.md) for task-based examples, and
98
- [invalid-keyframes-variant](../lints/invalid-keyframes-variant.md) for
97
+ See [Animations](https://stillwind.dev/docs/guides/animations) for task-based examples, and
98
+ [invalid-keyframes-variant](https://stillwind.dev/docs/lints/invalid-keyframes-variant) for
99
99
  unsupported variants.
@@ -48,7 +48,7 @@ It contains one or more variants. The final colon is optional.
48
48
  Only variants that are media conditions are accepted. `hover` and other element
49
49
  states, `supports-*`, and container queries are not media conditions. An
50
50
  argument that is not a media condition is left out, and
51
- [invalid-media-query](../lints/invalid-media-query.md) reports it. When no
51
+ [invalid-media-query](https://stillwind.dev/docs/lints/invalid-media-query) reports it. When no
52
52
  argument remains, the result is `not all`.
53
53
 
54
54
  Write `style.media()` outside other Stillwind calls.
@@ -63,4 +63,4 @@ time the module compiles.
63
63
 
64
64
  `matchMedia()` is a browser API. Call it on the client, and remove its
65
65
  listeners when their component unmounts. See
66
- [Responsive styles](../guides/responsive-styles.md).
66
+ [Responsive styles](https://stillwind.dev/docs/guides/responsive-styles).
@@ -8,7 +8,7 @@ description: "Make the element that has a ref a named anchor for CSS anchor posi
8
8
  `trigger.asAnchor(scope?)` sets
9
9
  [`anchor-name`](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/anchor-name)
10
10
  on the element. Position another element against it with
11
- [`trigger.positionAnchor()`](position-anchor.md).
11
+ [`trigger.positionAnchor()`](https://stillwind.dev/docs/macros/ref/position-anchor).
12
12
 
13
13
  ## Example
14
14
 
@@ -26,20 +26,20 @@ export const popover = style("absolute", trigger.positionAnchor(), "top-[anchor(
26
26
 
27
27
  ```ts
28
28
  const trigger = undefined;
29
- export const button = {className:"sw_l9spr sw_trigger_xnn7w"};
30
- export const popover = {className:"sw_mqosh"};
29
+ export const button = {className:"sw_6x3gz sw_trigger_xnhw0"};
30
+ export const popover = {className:"sw_e3wyz"};
31
31
  ```
32
32
 
33
33
  ### Generated CSS
34
34
 
35
35
 
36
36
  ```css
37
- .sw_l9spr:where(.sw_trigger_xnn7w) {
38
- anchor-name: --sw-a-trigger-xnn7w;
37
+ .sw_6x3gz:where(.sw_trigger_xnhw0) {
38
+ anchor-name: --sw-a-trigger-xnhw0;
39
39
  }
40
40
 
41
- .sw_mqosh {
42
- position-anchor: --sw-a-trigger-xnn7w;
41
+ .sw_e3wyz {
42
+ position-anchor: --sw-a-trigger-xnhw0;
43
43
  position: absolute;
44
44
  top: anchor(bottom);
45
45
  }
@@ -60,16 +60,16 @@ on the element:
60
60
 
61
61
  Write the array directly in the call. The array includes the `trigger` ref only
62
62
  when you list it. An empty array sets nothing, and
63
- [ineffective-anchor-scope](../../lints/ineffective-anchor-scope.md) reports it.
63
+ [ineffective-anchor-scope](https://stillwind.dev/docs/lints/ineffective-anchor-scope) reports it.
64
64
 
65
65
  ## Behavior
66
66
 
67
67
  Pass `trigger` and `trigger.asAnchor()` in the same
68
- [`style()`](../style.md) call. The anchor name applies only to an
68
+ [`style()`](https://stillwind.dev/docs/macros/style) call. The anchor name applies only to an
69
69
  element that has the ref, and
70
- [missing-ref-attachment](../../lints/missing-ref-attachment.md) reports a call
70
+ [missing-ref-attachment](https://stillwind.dev/docs/lints/missing-ref-attachment) reports a call
71
71
  without it.
72
72
 
73
73
  To limit the anchor name from an ancestor instead, use
74
- [`style.anchorScope()`](../anchor-scope.md). Stillwind generates CSS
74
+ [`style.anchorScope()`](https://stillwind.dev/docs/macros/anchor-scope). Stillwind generates CSS
75
75
  only, so check that the browsers you support implement anchor positioning.
@@ -10,7 +10,7 @@ description: "Make the element that has a ref a named container for ref.at() que
10
10
  on the element, and it sets
11
11
  [`container-type`](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/container-type)
12
12
  when you pass a type. Query the container with
13
- [`card.at()`](at.md).
13
+ [`card.at()`](https://stillwind.dev/docs/macros/ref/at).
14
14
 
15
15
  ## Example
16
16
 
@@ -27,19 +27,19 @@ export const container = style(card, card.asContainer("inline-size"), "p-4");
27
27
 
28
28
  ```ts
29
29
  const card = undefined;
30
- export const container = {className:"sw_j0tj8 sw_card_uryy0"};
30
+ export const container = {className:"sw_9kism sw_card_nudp9"};
31
31
  ```
32
32
 
33
33
  ### Generated CSS
34
34
 
35
35
 
36
36
  ```css
37
- .sw_j0tj8 {
37
+ .sw_9kism {
38
38
  padding: calc(var(--spacing) * 4);
39
39
  }
40
40
 
41
- .sw_j0tj8:where(.sw_card_uryy0) {
42
- container-name: sw-c-card-uryy0;
41
+ .sw_9kism:where(.sw_card_nudp9) {
42
+ container-name: sw-c-card-nudp9;
43
43
  container-type: inline-size;
44
44
  }
45
45
  ```
@@ -57,11 +57,11 @@ its value. A type stored in a variable is not accepted.
57
57
 
58
58
  ## Behavior
59
59
 
60
- Pass `card` and `card.asContainer()` in the same [`style()`](../style.md)
60
+ Pass `card` and `card.asContainer()` in the same [`style()`](https://stillwind.dev/docs/macros/style)
61
61
  call. The container declarations apply only to an element that has the ref, and
62
- [missing-ref-attachment](../../lints/missing-ref-attachment.md) reports a call
62
+ [missing-ref-attachment](https://stillwind.dev/docs/lints/missing-ref-attachment) reports a call
63
63
  without it.
64
64
 
65
65
  When another rule on the element also sets `container-name` or `container-type`,
66
- [conflicting-provider-properties](../../lints/conflicting-provider-properties.md)
66
+ [conflicting-provider-properties](https://stillwind.dev/docs/lints/conflicting-provider-properties)
67
67
  reports it.
@@ -8,7 +8,7 @@ description: "Style an element with a container query on the element that has a
8
8
  `card.at(query?)` creates
9
9
  [a container query](https://developer.mozilla.org/docs/Web/CSS/Guides/Containment/Container_queries)
10
10
  on the container that the `card` ref names. Make that element a container with
11
- [`card.asContainer()`](as-container.md).
11
+ [`card.asContainer()`](https://stillwind.dev/docs/macros/ref/as-container).
12
12
 
13
13
  ## Example
14
14
 
@@ -26,21 +26,21 @@ export const child = style({ [card.at("width >= 40rem")]: "grid-cols-2" });
26
26
 
27
27
  ```ts
28
28
  const card = undefined;
29
- export const container = {className:"sw_28iqw sw_card_uryy0"};
30
- export const child = {className:"sw_cunr1"};
29
+ export const container = {className:"sw_osnwd sw_card_nudp9"};
30
+ export const child = {className:"sw_hzszw"};
31
31
  ```
32
32
 
33
33
  ### Generated CSS
34
34
 
35
35
 
36
36
  ```css
37
- .sw_28iqw:where(.sw_card_uryy0) {
38
- container-name: sw-c-card-uryy0;
37
+ .sw_osnwd:where(.sw_card_nudp9) {
38
+ container-name: sw-c-card-nudp9;
39
39
  container-type: inline-size;
40
40
  }
41
41
 
42
- @container sw-c-card-uryy0 (width >= 40rem) {
43
- .sw_cunr1 {
42
+ @container sw-c-card-nudp9 (width >= 40rem) {
43
+ .sw_hzszw {
44
44
  grid-template-columns: repeat(2, minmax(0, 1fr));
45
45
  }
46
46
  }
@@ -62,8 +62,8 @@ Leave out the outer parentheses.
62
62
  Without a query, the condition matches whenever the styled element is inside a
63
63
  container with the name.
64
64
 
65
- Write the call directly as a computed key in [`style()`](../style.md).
66
- You cannot store it in a variable and use it later.
65
+ Write the call directly as a computed key in [`style()`](https://stillwind.dev/docs/macros/style).
66
+ To use it in several places, store it with [`style.when()`](https://stillwind.dev/docs/macros/when).
67
67
 
68
- See [Element relationships](../../guides/element-relationships.md#react-to-a-containers-size)
68
+ See [Element relationships](https://stillwind.dev/docs/guides/element-relationships#react-to-a-containers-size)
69
69
  for a task-based example.
@@ -25,21 +25,21 @@ export const title = style({ [card("hover")]: "text-blue-600" });
25
25
 
26
26
  ```ts
27
27
  const card = undefined;
28
- export const container = {className:"sw_vw9g3 sw_card_uryy0"};
29
- export const title = {className:"sw_c67by"};
28
+ export const container = {className:"sw_gky8e sw_card_nudp9"};
29
+ export const title = {className:"sw_0m922"};
30
30
  ```
31
31
 
32
32
  ### Generated CSS
33
33
 
34
34
 
35
35
  ```css
36
- .sw_vw9g3 {
36
+ .sw_gky8e {
37
37
  padding: calc(var(--spacing) * 4);
38
38
  border-radius: var(--radius-lg);
39
39
  }
40
40
 
41
41
  @media (hover: hover) {
42
- .sw_c67by:is(:where(.sw_card_uryy0):hover *) {
42
+ .sw_0m922:is(:where(.sw_card_nudp9):hover *) {
43
43
  color: var(--color-blue-600);
44
44
  }
45
45
  }
@@ -59,7 +59,7 @@ The final colon is optional.
59
59
 
60
60
  ## Where to write it
61
61
 
62
- Write the condition as a computed key of an object in [`style()`](../style.md):
62
+ Write the condition as a computed key of an object in [`style()`](https://stillwind.dev/docs/macros/style):
63
63
 
64
64
  ```ts
65
65
  style({ [card("hover")]: "text-blue-600" });
@@ -72,15 +72,16 @@ You can also write it as a variant segment inside a utility template, followed b
72
72
  style(`${card("hover")}:text-blue-600`);
73
73
  ```
74
74
 
75
- You cannot store the condition in a variable and use it later.
75
+ To use the same condition in several places, store it with
76
+ [`style.when()`](https://stillwind.dev/docs/macros/when).
76
77
 
77
78
  ## Behavior
78
79
 
79
80
  The ref element must be an ancestor of the styled element. To match a sibling or
80
- another element inside a shared ancestor, add [`.in()`](in.md).
81
+ another element inside a shared ancestor, add [`.in()`](https://stillwind.dev/docs/macros/ref/in).
81
82
 
82
83
  The condition only selects elements. It does not attach the ref, so attach it with
83
84
  `style(card)` on the ancestor.
84
85
 
85
- See [Element relationships](../../guides/element-relationships.md#react-to-a-parents-state)
86
+ See [Element relationships](https://stillwind.dev/docs/guides/element-relationships#react-to-a-parents-state)
86
87
  for a task-based example.
@@ -28,27 +28,27 @@ export const text = style({ [trigger("hover").in(card)]: "text-blue-600" });
28
28
  ```ts
29
29
  const card = undefined;
30
30
  const trigger = undefined;
31
- export const container = {className:"sw_fxivy sw_card_uryy0"};
32
- export const button = {className:"sw_92u2q sw_trigger_fvqcy"};
33
- export const text = {className:"sw_yz349"};
31
+ export const container = {className:"sw_dsyoo sw_card_nudp9"};
32
+ export const button = {className:"sw_zycpr sw_trigger_xnhw0"};
33
+ export const text = {className:"sw_hfcxb"};
34
34
  ```
35
35
 
36
36
  ### Generated CSS
37
37
 
38
38
 
39
39
  ```css
40
- .sw_fxivy {
40
+ .sw_dsyoo {
41
41
  padding: calc(var(--spacing) * 4);
42
42
  }
43
43
 
44
- .sw_92u2q {
44
+ .sw_zycpr {
45
45
  padding-inline: calc(var(--spacing) * 4);
46
46
  padding-block: calc(var(--spacing) * 2);
47
47
  border-radius: var(--radius-md);
48
48
  }
49
49
 
50
50
  @media (hover: hover) {
51
- .sw_yz349:is(:where(.sw_card_uryy0):has(:where(.sw_trigger_fvqcy):hover) *) {
51
+ .sw_hfcxb:is(:where(.sw_card_nudp9):has(:where(.sw_trigger_xnhw0):hover) *) {
52
52
  color: var(--color-blue-600);
53
53
  }
54
54
  }
@@ -56,7 +56,7 @@ export const text = {className:"sw_yz349"};
56
56
 
57
57
  ## Inputs
58
58
 
59
- The receiver is a [ref condition](condition.md), such as
59
+ The receiver is a [ref condition](https://stillwind.dev/docs/macros/ref/condition), such as
60
60
  `trigger("hover")` or `trigger()`. The argument is one of these:
61
61
 
62
62
  | Argument | The scope element |
@@ -64,7 +64,7 @@ The receiver is a [ref condition](condition.md), such as
64
64
  | `card` | Has the `card` ref |
65
65
  | `card("focus-within")` | Has the `card` ref and matches the variants |
66
66
 
67
- The argument cannot use `.in()` or [`.at()`](at.md) itself.
67
+ The argument cannot use `.in()` or [`.at()`](https://stillwind.dev/docs/macros/ref/at) itself.
68
68
 
69
69
  ## Behavior
70
70
 
@@ -74,8 +74,8 @@ styled element itself.
74
74
  Calling `.in()` more than once adds each scope as another condition, and every
75
75
  condition must match.
76
76
 
77
- Write the whole chain directly as a computed key in [`style()`](../style.md).
78
- You cannot store it in a variable and use it later.
77
+ Write the whole chain directly as a computed key in [`style()`](https://stillwind.dev/docs/macros/style).
78
+ To use it in several places, store it with [`style.when()`](https://stillwind.dev/docs/macros/when).
79
79
 
80
- See [Element relationships](../../guides/element-relationships.md#react-to-a-siblings-state)
80
+ See [Element relationships](https://stillwind.dev/docs/guides/element-relationships#react-to-a-siblings-state)
81
81
  for a task-based example.
@@ -28,27 +28,27 @@ export const child = style({
28
28
 
29
29
  ```ts
30
30
  const card = undefined;
31
- export const container = {className:"sw_28iqw sw_card_uryy0"};
32
- export const child = {className:"sw_6hxbo"};
31
+ export const container = {className:"sw_osnwd sw_card_nudp9"};
32
+ export const child = {className:"sw_duzby"};
33
33
  ```
34
34
 
35
35
  ### Generated CSS
36
36
 
37
37
 
38
38
  ```css
39
- .sw_28iqw:where(.sw_card_uryy0) {
40
- container-name: sw-c-card-uryy0;
39
+ .sw_osnwd:where(.sw_card_nudp9) {
40
+ container-name: sw-c-card-nudp9;
41
41
  container-type: inline-size;
42
42
  }
43
43
 
44
- @container sw-c-card-uryy0 (width >= 40rem) {
45
- .sw_6hxbo {
44
+ @container sw-c-card-nudp9 (width >= 40rem) {
45
+ .sw_duzby {
46
46
  grid-template-columns: repeat(2, minmax(0, 1fr));
47
47
  }
48
48
  }
49
49
 
50
50
  @media (hover: hover) {
51
- .sw_6hxbo:is(:where(.sw_card_uryy0):hover *) {
51
+ .sw_duzby:is(:where(.sw_card_nudp9):hover *) {
52
52
  color: var(--color-blue-600);
53
53
  }
54
54
  }
@@ -92,16 +92,17 @@ nearest one.
92
92
 
93
93
  | Method | Where to write it | Effect |
94
94
  | ---------------------------------------------------------- | ------------------------------------------ | ------------------------------------------------------ |
95
- | `ref` | A [`style()`](../style.md) argument | Attaches the ref to the element |
96
- | [`ref()`](condition.md) | A computed key in `style()` | Matches inside the ref element, optionally in a state |
97
- | [`ref().in()`](in.md) | After a ref condition | Matches inside a shared ancestor, such as for siblings |
98
- | [`ref.at()`](at.md) | A computed key in `style()` | Matches a container query on the ref element |
99
- | [`ref.asContainer()`](as-container.md) | A `style()` argument | Makes the ref element a named container |
100
- | [`ref.asAnchor()`](as-anchor.md) | A `style()` argument | Makes the ref element a named anchor |
101
- | [`ref.positionAnchor()`](position-anchor.md) | A `style()` argument | Positions the styled element against the anchor |
95
+ | `ref` | A [`style()`](https://stillwind.dev/docs/macros/style) argument | Attaches the ref to the element |
96
+ | [`ref()`](https://stillwind.dev/docs/macros/ref/condition) | A computed key in `style()` | Matches inside the ref element, optionally in a state |
97
+ | [`ref().in()`](https://stillwind.dev/docs/macros/ref/in) | After a ref condition | Matches inside a shared ancestor, such as for siblings |
98
+ | [`ref.at()`](https://stillwind.dev/docs/macros/ref/at) | A computed key in `style()` | Matches a container query on the ref element |
99
+ | [`ref.asContainer()`](https://stillwind.dev/docs/macros/ref/as-container) | A `style()` argument | Makes the ref element a named container |
100
+ | [`ref.asAnchor()`](https://stillwind.dev/docs/macros/ref/as-anchor) | A `style()` argument | Makes the ref element a named anchor |
101
+ | [`ref.positionAnchor()`](https://stillwind.dev/docs/macros/ref/position-anchor) | A `style()` argument | Positions the styled element against the anchor |
102
102
 
103
103
  Write each method call directly in `style()`. You cannot store the result of a
104
- method call in a variable and use it later.
104
+ method call in a variable and use it later. To reuse a ref condition or a
105
+ container query, store it with [`style.when()`](https://stillwind.dev/docs/macros/when).
105
106
 
106
107
  ## Generated code
107
108
 
@@ -111,5 +112,5 @@ call chooses among several refs at runtime, the generated code keeps the fields
111
112
  that the choice needs. The compiled code reads those fields directly. In
112
113
  development, Stillwind checks them first. The code does not watch the DOM.
113
114
 
114
- See [Element relationships](../../guides/element-relationships.md) for task-based
115
+ See [Element relationships](https://stillwind.dev/docs/guides/element-relationships) for task-based
115
116
  examples.
@@ -31,20 +31,20 @@ export const popover = style(
31
31
 
32
32
  ```ts
33
33
  const trigger = undefined;
34
- export const button = {className:"sw_l9spr sw_trigger_xnn7w"};
35
- export const popover = {className:"sw_fu7et"};
34
+ export const button = {className:"sw_6x3gz sw_trigger_xnhw0"};
35
+ export const popover = {className:"sw_6gq48"};
36
36
  ```
37
37
 
38
38
  ### Generated CSS
39
39
 
40
40
 
41
41
  ```css
42
- .sw_l9spr:where(.sw_trigger_xnn7w) {
43
- anchor-name: --sw-a-trigger-xnn7w;
42
+ .sw_6x3gz:where(.sw_trigger_xnhw0) {
43
+ anchor-name: --sw-a-trigger-xnhw0;
44
44
  }
45
45
 
46
- .sw_fu7et {
47
- position-anchor: --sw-a-trigger-xnn7w;
46
+ .sw_6gq48 {
47
+ position-anchor: --sw-a-trigger-xnhw0;
48
48
  position: absolute;
49
49
  top: anchor(bottom);
50
50
  left: anchor(left);
@@ -58,10 +58,10 @@ export const popover = {className:"sw_fu7et"};
58
58
  ## Behavior
59
59
 
60
60
  The styled element does not need the `trigger` ref. The anchor element needs it,
61
- together with [`trigger.asAnchor()`](as-anchor.md).
61
+ together with [`trigger.asAnchor()`](https://stillwind.dev/docs/macros/ref/as-anchor).
62
62
 
63
- Write the call directly in [`style()`](../style.md). You cannot store it
63
+ Write the call directly in [`style()`](https://stillwind.dev/docs/macros/style). You cannot store it
64
64
  in a variable and use it later.
65
65
 
66
- See [Element relationships](../../guides/element-relationships.md#position-an-element-at-an-anchor)
66
+ See [Element relationships](https://stillwind.dev/docs/guides/element-relationships#position-an-element-at-an-anchor)
67
67
  for a complete example with an anchor scope.