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.
- package/AGENTS_TEMPLATE.md +5 -0
- package/LICENSE +21 -0
- package/README.md +166 -0
- package/TAILWINDCSS-MIT-LICENSE +21 -0
- package/css/builtin-metadata/sw-motion-properties.css +186 -0
- package/css/builtin-metadata/tw-legacy-metadata.css +36 -0
- package/css/builtin-metadata/tw-properties.css +944 -0
- package/css/builtin-metadata/tw-registry-metadata.css +52 -0
- package/css/builtin-metadata/tw-relationship-metadata.css +10 -0
- package/css/builtin-utilities/sw-motion-contexts.css +1043 -0
- package/css/builtin-utilities/tw-backgrounds.css +606 -0
- package/css/builtin-utilities/tw-borders.css +954 -0
- package/css/builtin-utilities/tw-effects.css +1209 -0
- package/css/builtin-utilities/tw-flex-grid.css +749 -0
- package/css/builtin-utilities/tw-interactivity.css +680 -0
- package/css/builtin-utilities/tw-layout.css +943 -0
- package/css/builtin-utilities/tw-masks.css +1268 -0
- package/css/builtin-utilities/tw-motion.css +142 -0
- package/css/builtin-utilities/tw-spacing-sizing.css +621 -0
- package/css/builtin-utilities/tw-svg.css +50 -0
- package/css/builtin-utilities/tw-transforms.css +652 -0
- package/css/builtin-utilities/tw-typography.css +720 -0
- package/css/builtin-variants/sw-conditional.css +5 -0
- package/css/builtin-variants/sw-document.css +13 -0
- package/css/builtin-variants/tw-conditional.css +187 -0
- package/css/builtin-variants/tw-dynamic-selector.css +49 -0
- package/css/builtin-variants/tw-relationship.css +41 -0
- package/css/builtin-variants/tw-state.css +159 -0
- package/css/builtin-variants/tw-structural.css +121 -0
- package/css/builtins.css +111 -0
- package/css/preflight.css +401 -0
- package/css/templates.css +40 -0
- package/css/theme.css +546 -0
- package/css/utilities.css +9 -0
- package/dist/class-object-D24FFYqO.js +6 -0
- package/dist/class-object-D24FFYqO.js.map +1 -0
- package/dist/class-object-D7ZGJOf_.d.ts +9 -0
- package/dist/class-string-CQHnc9GN.d.ts +9 -0
- package/dist/class-string-Db8-oI4q.js +6 -0
- package/dist/class-string-Db8-oI4q.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +2 -0
- package/dist/css.d.ts +100 -0
- package/dist/css.js +143 -0
- package/dist/css.js.map +1 -0
- package/dist/cva-BwX07CFw.js +204 -0
- package/dist/cva-BwX07CFw.js.map +1 -0
- package/dist/cva-DSpDNBYi.d.ts +9 -0
- package/dist/development-DttPQc71.d.ts +27 -0
- package/dist/development-J-JCSIm0.js +111 -0
- package/dist/development-J-JCSIm0.js.map +1 -0
- package/dist/frameworks/alpine.d.ts +20 -0
- package/dist/frameworks/alpine.js +18 -0
- package/dist/frameworks/alpine.js.map +1 -0
- package/dist/frameworks/astro.d.ts +3 -0
- package/dist/frameworks/astro.js +1 -0
- package/dist/frameworks/lit.d.ts +21 -0
- package/dist/frameworks/lit.js +38 -0
- package/dist/frameworks/lit.js.map +1 -0
- package/dist/frameworks/preact.d.ts +3 -0
- package/dist/frameworks/preact.js +1 -0
- package/dist/frameworks/qwik.d.ts +3 -0
- package/dist/frameworks/qwik.js +1 -0
- package/dist/frameworks/react.d.ts +10 -0
- package/dist/frameworks/react.js +6 -0
- package/dist/frameworks/react.js.map +1 -0
- package/dist/frameworks/solid.d.ts +3 -0
- package/dist/frameworks/solid.js +1 -0
- package/dist/frameworks/svelte.d.ts +3 -0
- package/dist/frameworks/svelte.js +1 -0
- package/dist/frameworks/vanilla.d.ts +27 -0
- package/dist/frameworks/vanilla.js +3 -0
- package/dist/frameworks/vue.d.ts +3 -0
- package/dist/frameworks/vue.js +1 -0
- package/dist/index-RwVFpxhE.d.ts +815 -0
- package/dist/macro/index.d.ts +2 -0
- package/dist/macro/index.js +1 -0
- package/dist/module-css.d.ts +30 -0
- package/dist/module-css.js +23 -0
- package/dist/module-css.js.map +1 -0
- package/dist/runtime/class-name-object-development.d.ts +10 -0
- package/dist/runtime/class-name-object-development.js +18 -0
- package/dist/runtime/class-name-object-development.js.map +1 -0
- package/dist/runtime/class-name-object.d.ts +16 -0
- package/dist/runtime/class-name-object.js +31 -0
- package/dist/runtime/class-name-object.js.map +1 -0
- package/dist/runtime/class-object-development.d.ts +10 -0
- package/dist/runtime/class-object-development.js +18 -0
- package/dist/runtime/class-object-development.js.map +1 -0
- package/dist/runtime/class-object.d.ts +16 -0
- package/dist/runtime/class-object.js +31 -0
- package/dist/runtime/class-object.js.map +1 -0
- package/dist/runtime/class-string-development.d.ts +10 -0
- package/dist/runtime/class-string-development.js +18 -0
- package/dist/runtime/class-string-development.js.map +1 -0
- package/dist/runtime/class-string.d.ts +16 -0
- package/dist/runtime/class-string.js +31 -0
- package/dist/runtime/class-string.js.map +1 -0
- package/dist/shared-B9IQXU6P.d.ts +32 -0
- package/dist/style-BV4ctkni.js +78 -0
- package/dist/style-BV4ctkni.js.map +1 -0
- package/dist/style-fTQbsVWZ.js +41 -0
- package/dist/style-fTQbsVWZ.js.map +1 -0
- package/docs/agents.md +76 -0
- package/docs/at-rules/apply.md +93 -0
- package/docs/at-rules/custom-variant.md +127 -0
- package/docs/at-rules/index.md +75 -0
- package/docs/at-rules/plugin.md +71 -0
- package/docs/at-rules/registry-directives.md +181 -0
- package/docs/at-rules/slot.md +58 -0
- package/docs/at-rules/stillwind-css-template.md +126 -0
- package/docs/at-rules/stillwind-property.md +133 -0
- package/docs/at-rules/stillwind-registry.md +115 -0
- package/docs/at-rules/stillwind-require-properties.md +91 -0
- package/docs/at-rules/stillwind-slot.md +85 -0
- package/docs/at-rules/stillwind-undef-arbitrary-property.md +75 -0
- package/docs/at-rules/stillwind-undef-utility.md +87 -0
- package/docs/at-rules/stillwind-undef-variant.md +55 -0
- package/docs/at-rules/theme.md +304 -0
- package/docs/at-rules/utility.md +286 -0
- package/docs/at-rules/variant.md +91 -0
- package/docs/concepts/css-ordering.md +245 -0
- package/docs/concepts/how-styles-compile.md +132 -0
- package/docs/configuration.md +298 -0
- package/docs/errors/SW01001.md +51 -0
- package/docs/errors/SW01002.md +52 -0
- package/docs/errors/SW01003.md +69 -0
- package/docs/errors/SW02001.md +23 -0
- package/docs/errors/SW02002.md +51 -0
- package/docs/errors/SW03001.md +71 -0
- package/docs/errors/SW03002.md +79 -0
- package/docs/errors/SW03003.md +36 -0
- package/docs/errors/SW10001.md +34 -0
- package/docs/errors/SW10002.md +36 -0
- package/docs/errors/SW10003.md +30 -0
- package/docs/errors/SW10004.md +39 -0
- package/docs/errors/SW10005.md +35 -0
- package/docs/errors/SW11001.md +37 -0
- package/docs/errors/SW11002.md +65 -0
- package/docs/errors/SW11003.md +20 -0
- package/docs/errors/SW12001.md +43 -0
- package/docs/errors/SW12002.md +42 -0
- package/docs/errors/SW13001.md +35 -0
- package/docs/errors/SW13002.md +33 -0
- package/docs/errors/SW13003.md +18 -0
- package/docs/errors/SW13004.md +45 -0
- package/docs/errors/SW14001.md +44 -0
- package/docs/errors/SW14002.md +47 -0
- package/docs/errors/SW14003.md +38 -0
- package/docs/errors/SW14004.md +48 -0
- package/docs/errors/SW14005.md +51 -0
- package/docs/errors/SW14006.md +19 -0
- package/docs/errors/SW14007.md +35 -0
- package/docs/errors/SW14008.md +41 -0
- package/docs/errors/SW15001.md +18 -0
- package/docs/errors/SW15002.md +19 -0
- package/docs/errors/SW15003.md +16 -0
- package/docs/errors/SW30001.md +21 -0
- package/docs/errors/SW30002.md +18 -0
- package/docs/errors/SW30003.md +17 -0
- package/docs/errors/SW30004.md +18 -0
- package/docs/errors/SW31001.md +20 -0
- package/docs/errors/SW31002.md +17 -0
- package/docs/errors/SW31003.md +18 -0
- package/docs/errors/SW31004.md +20 -0
- package/docs/errors/SW31005.md +18 -0
- package/docs/errors/SW31006.md +17 -0
- package/docs/errors/SW31007.md +18 -0
- package/docs/errors/SW31008.md +16 -0
- package/docs/errors/SW31009.md +18 -0
- package/docs/errors/SW31010.md +16 -0
- package/docs/errors/SW31011.md +17 -0
- package/docs/errors/SW32001.md +18 -0
- package/docs/errors/SW32002.md +45 -0
- package/docs/errors/SW32003.md +43 -0
- package/docs/errors/SW32004.md +17 -0
- package/docs/errors/SW32005.md +40 -0
- package/docs/errors/SW32006.md +18 -0
- package/docs/errors/SW32007.md +20 -0
- package/docs/errors/SW33001.md +17 -0
- package/docs/errors/SW33002.md +17 -0
- package/docs/errors/SW33003.md +17 -0
- package/docs/errors/SW33004.md +17 -0
- package/docs/errors/SW33005.md +20 -0
- package/docs/errors/SW34001.md +18 -0
- package/docs/errors/SW34002.md +17 -0
- package/docs/errors/SW34003.md +18 -0
- package/docs/errors/SW90001.md +17 -0
- package/docs/errors/SW90002.md +18 -0
- package/docs/errors/SW90003.md +17 -0
- package/docs/errors/SW90004.md +17 -0
- package/docs/errors/SW90005.md +16 -0
- package/docs/errors/SW90006.md +17 -0
- package/docs/errors/SW90007.md +17 -0
- package/docs/errors/SW90008.md +17 -0
- package/docs/errors/index.md +125 -0
- package/docs/guides/animations.md +73 -0
- package/docs/guides/design-systems.md +119 -0
- package/docs/guides/element-relationships.md +136 -0
- package/docs/guides/lint-adoption.md +128 -0
- package/docs/guides/migrating-from-css.md +126 -0
- package/docs/guides/migrating-from-tailwind.md +179 -0
- package/docs/guides/recommended-practices.md +338 -0
- package/docs/guides/responsive-styles.md +103 -0
- package/docs/guides/reusable-styles.md +110 -0
- package/docs/guides/style.md +181 -0
- package/docs/guides/tailwind-compatibility.md +126 -0
- package/docs/guides/view-transitions.md +84 -0
- package/docs/guides/web-components.md +216 -0
- package/docs/index.md +136 -0
- package/docs/integrations.md +190 -0
- package/docs/lints/ambiguous-style-base-order.md +50 -0
- package/docs/lints/bypassed-undefinition.md +50 -0
- package/docs/lints/clamped-value.md +44 -0
- package/docs/lints/conflicting-provider-properties.md +47 -0
- package/docs/lints/conflicting-utilities.md +55 -0
- package/docs/lints/document-scoped-selector.md +45 -0
- package/docs/lints/duplicate-definition.md +44 -0
- package/docs/lints/duplicate-utility.md +44 -0
- package/docs/lints/duplicate-view-transition-name.md +45 -0
- package/docs/lints/ignored-definition-condition.md +51 -0
- package/docs/lints/ignored-tailwind-feature.md +62 -0
- package/docs/lints/incompatible-property-value.md +60 -0
- package/docs/lints/incompatible-theme-value.md +46 -0
- package/docs/lints/index.md +140 -0
- package/docs/lints/ineffective-anchor-scope.md +46 -0
- package/docs/lints/interfering-imported-style-base.md +57 -0
- package/docs/lints/invalid-animation-option.md +47 -0
- package/docs/lints/invalid-css-directive.md +43 -0
- package/docs/lints/invalid-css-import.md +43 -0
- package/docs/lints/invalid-css-input.md +45 -0
- package/docs/lints/invalid-cva-config.md +46 -0
- package/docs/lints/invalid-cva-input.md +50 -0
- package/docs/lints/invalid-keyframes-definition.md +47 -0
- package/docs/lints/invalid-keyframes-use.md +47 -0
- package/docs/lints/invalid-keyframes-variant.md +48 -0
- package/docs/lints/invalid-lint-suppression.md +47 -0
- package/docs/lints/invalid-marker-use.md +53 -0
- package/docs/lints/invalid-media-query.md +52 -0
- package/docs/lints/invalid-ref-input.md +49 -0
- package/docs/lints/invalid-rule-group-input.md +58 -0
- package/docs/lints/invalid-runtime-condition.md +67 -0
- package/docs/lints/invalid-style-composition.md +52 -0
- package/docs/lints/invalid-style-input.md +47 -0
- package/docs/lints/invalid-theme-reference.md +52 -0
- package/docs/lints/invalid-utility.md +44 -0
- package/docs/lints/invalid-variant.md +45 -0
- package/docs/lints/invalid-view-transition-definition.md +46 -0
- package/docs/lints/invalid-view-transition-use.md +46 -0
- package/docs/lints/invalid-view-transition-variant.md +51 -0
- package/docs/lints/mismatched-framework-import.md +47 -0
- package/docs/lints/missing-document-target.md +44 -0
- package/docs/lints/missing-ref-attachment.md +44 -0
- package/docs/lints/missing-view-transition-name.md +46 -0
- package/docs/lints/mutating-macro-argument.md +48 -0
- package/docs/lints/no-arbitrary-breakpoints.md +50 -0
- package/docs/lints/no-arbitrary-colors.md +51 -0
- package/docs/lints/no-arbitrary-spacing.md +57 -0
- package/docs/lints/no-class-property.md +58 -0
- package/docs/lints/no-important.md +50 -0
- package/docs/lints/no-restricted-declarations.md +76 -0
- package/docs/lints/no-restricted-length-units.md +73 -0
- package/docs/lints/no-restricted-theme-tokens.md +73 -0
- package/docs/lints/no-restricted-utilities.md +73 -0
- package/docs/lints/prefer-canonical-utilities.md +69 -0
- package/docs/lints/prefer-direct-styling.md +47 -0
- package/docs/lints/prefer-explicit-nesting-selector.md +42 -0
- package/docs/lints/prefer-logical-properties.md +49 -0
- package/docs/lints/prefer-sorted-utilities.md +46 -0
- package/docs/lints/prefer-typed-relationships.md +48 -0
- package/docs/lints/prefer-typed-variables.md +43 -0
- package/docs/lints/prefer-variant-directive.md +59 -0
- package/docs/lints/redundant-variant.md +50 -0
- package/docs/lints/repeated-nesting-selector.md +59 -0
- package/docs/lints/runtime-condition-requires-css-if.md +59 -0
- package/docs/lints/split-view-transition-class.md +47 -0
- package/docs/lints/suspending-macro-argument.md +46 -0
- package/docs/lints/unknown-utility.md +47 -0
- package/docs/lints/unknown-variant.md +42 -0
- package/docs/lints/unsatisfiable-variants.md +42 -0
- package/docs/lints/unused-lint-suppression.md +57 -0
- package/docs/lints/unverified-style-base.md +64 -0
- package/docs/macros/anchor-scope.md +90 -0
- package/docs/macros/css.md +68 -0
- package/docs/macros/cva.md +153 -0
- package/docs/macros/index.md +30 -0
- package/docs/macros/keyframes.md +98 -0
- package/docs/macros/media.md +65 -0
- package/docs/macros/ref/as-anchor.md +70 -0
- package/docs/macros/ref/as-container.md +64 -0
- package/docs/macros/ref/at.md +68 -0
- package/docs/macros/ref/condition.md +86 -0
- package/docs/macros/ref/in.md +81 -0
- package/docs/macros/ref/index.md +115 -0
- package/docs/macros/ref/position-anchor.md +64 -0
- package/docs/macros/style.md +185 -0
- package/docs/macros/view-transition.md +159 -0
- package/docs/utilities.md +35 -0
- package/docs/why.md +144 -0
- package/index.css +7 -0
- package/package.json +135 -8
- package/skills/migrate-to-stillwind/SKILL.md +81 -0
- package/skills/setup-stillwind/SKILL.md +51 -0
- package/skills/stillwind/SKILL.md +54 -0
- package/index.js +0 -1
package/docs/agents.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Coding agents"
|
|
3
|
+
description: "Let a coding agent set up Stillwind or migrate a project, using the documentation and skills in the stillwind package."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Coding agents
|
|
7
|
+
|
|
8
|
+
The `stillwind` package includes this documentation as Markdown files in
|
|
9
|
+
`node_modules/stillwind/docs/`. It also includes skills for coding agents. An
|
|
10
|
+
agent that reads these files uses the documentation of the installed version.
|
|
11
|
+
|
|
12
|
+
## Start with a prompt
|
|
13
|
+
|
|
14
|
+
Give this prompt to your agent in a new or an existing project:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
Set up Stillwind in this project. If the stillwind package is not installed,
|
|
18
|
+
install it with the project's package manager. Then read
|
|
19
|
+
node_modules/stillwind/docs/agents.md and follow its instructions for agents.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The agent decides whether the project needs a new setup or a migration. Before
|
|
23
|
+
it migrates existing styles, it explains the options and asks how far to go.
|
|
24
|
+
|
|
25
|
+
## What the package includes
|
|
26
|
+
|
|
27
|
+
| Path | Content |
|
|
28
|
+
| ------------------------------ | ------------------------------------------------------------ |
|
|
29
|
+
| `docs/` | This documentation as Markdown |
|
|
30
|
+
| `skills/setup-stillwind/` | A skill that sets up Stillwind in a project without styles |
|
|
31
|
+
| `skills/migrate-to-stillwind/` | A skill that migrates Tailwind CSS or other CSS to Stillwind |
|
|
32
|
+
| `skills/stillwind/` | A skill for everyday work in a project that uses Stillwind |
|
|
33
|
+
| `AGENTS_TEMPLATE.md` | A section for the instruction file of your project |
|
|
34
|
+
|
|
35
|
+
## Instructions for agents
|
|
36
|
+
|
|
37
|
+
1. Inspect the project. Find the package manager, the build tool, the framework,
|
|
38
|
+
and the current styling. In a monorepo, find the application that the user
|
|
39
|
+
means.
|
|
40
|
+
2. Choose a skill and follow its `SKILL.md`. The skills are in
|
|
41
|
+
`node_modules/stillwind/skills/`:
|
|
42
|
+
- Use `setup-stillwind` when the project has no styles to migrate, such as a
|
|
43
|
+
new project.
|
|
44
|
+
- Use `migrate-to-stillwind` when the project uses Tailwind CSS, plain CSS,
|
|
45
|
+
CSS Modules, a preprocessor, or CSS-in-JS.
|
|
46
|
+
3. Tell the user which skill you chose and why, in one sentence.
|
|
47
|
+
|
|
48
|
+
For later work in a project that uses Stillwind, follow `skills/stillwind/SKILL.md`.
|
|
49
|
+
|
|
50
|
+
## Install the skills
|
|
51
|
+
|
|
52
|
+
Agents can read the skills from `node_modules/stillwind/skills/` without
|
|
53
|
+
installation. To let your agent load them automatically, link them into its
|
|
54
|
+
skill directory, such as `.claude/skills/` for Claude Code or `.agents/skills/`
|
|
55
|
+
for Codex:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
mkdir -p .claude/skills
|
|
59
|
+
ln -s ../../node_modules/stillwind/skills/stillwind .claude/skills/stillwind
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
A link keeps the skill in sync with the installed version. Copy the directory
|
|
63
|
+
instead when your system does not support links.
|
|
64
|
+
|
|
65
|
+
## Add project instructions
|
|
66
|
+
|
|
67
|
+
Add the contents of `node_modules/stillwind/AGENTS_TEMPLATE.md` to the instruction
|
|
68
|
+
file of your project, such as `AGENTS.md` or `CLAUDE.md`. The section tells
|
|
69
|
+
agents in later sessions that the project uses Stillwind and where its
|
|
70
|
+
documentation is.
|
|
71
|
+
|
|
72
|
+
## Read the documentation online
|
|
73
|
+
|
|
74
|
+
Every page of this website has a **View as Markdown** link. Give your agent the
|
|
75
|
+
[documentation index](https://stillwind.dev/docs/llms.txt), or retrieve the
|
|
76
|
+
[full documentation](https://stillwind.dev/llms-full.txt) in one request.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@apply"
|
|
3
|
+
description: "Insert the declarations of utilities, including their variants, into a rule of your stylesheet."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @apply
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
selector {
|
|
10
|
+
@apply utilities;
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`@apply` replaces itself with the declarations of the listed utilities. Write it
|
|
15
|
+
inside a style rule or a utility definition. Whitespace separates the utilities.
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
### Stylesheet
|
|
20
|
+
|
|
21
|
+
```css
|
|
22
|
+
.button {
|
|
23
|
+
@apply rounded-md px-4 py-2 hover:bg-blue-600 focus-visible:outline-2;
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Generated stylesheet without preflight
|
|
28
|
+
|
|
29
|
+
```css
|
|
30
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
31
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
32
|
+
@layer properties, theme, base, components, utilities;
|
|
33
|
+
|
|
34
|
+
@layer theme {
|
|
35
|
+
:root, :host {
|
|
36
|
+
--color-blue-600: oklch(54.6% .245 262.881);
|
|
37
|
+
--spacing: .25rem;
|
|
38
|
+
--radius-md: .375rem;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@layer properties {
|
|
43
|
+
@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
|
|
44
|
+
*, :before, :after, ::backdrop {
|
|
45
|
+
--tw-outline-style: solid;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@property --tw-outline-style {
|
|
51
|
+
syntax: "*";
|
|
52
|
+
inherits: false;
|
|
53
|
+
initial-value: solid;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.button {
|
|
57
|
+
padding-inline: calc(var(--spacing) * 4);
|
|
58
|
+
padding-block: calc(var(--spacing) * 2);
|
|
59
|
+
border-radius: var(--radius-md);
|
|
60
|
+
|
|
61
|
+
&:hover {
|
|
62
|
+
@media (hover: hover) {
|
|
63
|
+
background-color: var(--color-blue-600);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:focus-visible {
|
|
68
|
+
outline-style: var(--tw-outline-style);
|
|
69
|
+
outline-width: 2px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
A utility with variants becomes nested rules, and the selector of the enclosing
|
|
75
|
+
rule takes the place of the generated class. Utilities without variants come
|
|
76
|
+
first in utility order. Utilities with variants follow in variant order.
|
|
77
|
+
|
|
78
|
+
The stylesheet declares the theme values and registered properties that the
|
|
79
|
+
applied utilities need, as it does for `style()`.
|
|
80
|
+
|
|
81
|
+
## Rules
|
|
82
|
+
|
|
83
|
+
- A utility that does not resolve adds nothing. `.button { @apply unknown-x; }`
|
|
84
|
+
becomes `.button {}`.
|
|
85
|
+
- An applied utility can apply other utilities. A circular application is a
|
|
86
|
+
compilation error.
|
|
87
|
+
- In a utility definition, `@apply` expands after the variants of the utility
|
|
88
|
+
apply, so the applied declarations stay under them.
|
|
89
|
+
- `@apply` adds no class to any element. `@apply group` does not make the
|
|
90
|
+
element a `group` for `group-hover:`.
|
|
91
|
+
|
|
92
|
+
To apply a condition to your own declarations, use
|
|
93
|
+
[@variant](variant.md) instead.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@custom-variant"
|
|
3
|
+
description: "Define a variant with a selector, or with a block that marks the styled content with @slot."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @custom-variant
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@custom-variant name (selector);
|
|
10
|
+
@custom-variant name {
|
|
11
|
+
selector {
|
|
12
|
+
@slot;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
@custom-variant name scope(document) ...;
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`@custom-variant` defines a variant. Write it at the top level of the
|
|
19
|
+
stylesheet.
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
|
|
23
|
+
The short form takes a selector in parentheses. The block form wraps the
|
|
24
|
+
content with any rules, and `@slot` marks where the content goes.
|
|
25
|
+
|
|
26
|
+
### Stylesheet
|
|
27
|
+
|
|
28
|
+
```css
|
|
29
|
+
@custom-variant theme-dark (&:where([data-theme="dark"], [data-theme="dark"] *));
|
|
30
|
+
|
|
31
|
+
@custom-variant hocus {
|
|
32
|
+
&:hover,
|
|
33
|
+
&:focus-visible {
|
|
34
|
+
@slot;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Source
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { style } from "stillwind/react";
|
|
43
|
+
|
|
44
|
+
export const link = style("theme-dark:text-white hocus:underline");
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Compiled code
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
export const link = {className:"sw_r7v8w"};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Generated stylesheet without preflight
|
|
54
|
+
|
|
55
|
+
```css
|
|
56
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
57
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
58
|
+
@layer properties, theme, base, components, utilities;
|
|
59
|
+
|
|
60
|
+
@layer theme {
|
|
61
|
+
:root, :host {
|
|
62
|
+
--color-white: #fff;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@layer utilities {
|
|
67
|
+
.sw_r7v8w:where([data-theme="dark"], [data-theme="dark"] *) {
|
|
68
|
+
color: var(--color-white);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.sw_r7v8w:hover, .sw_r7v8w:focus-visible {
|
|
72
|
+
text-decoration-line: underline;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The block form can also contain at-rules, such as `@media` or `@supports`,
|
|
78
|
+
around `@slot`.
|
|
79
|
+
|
|
80
|
+
## Selectors without &
|
|
81
|
+
|
|
82
|
+
`&` refers to the element that the utility styles. As in CSS Nesting, a
|
|
83
|
+
selector without `&` selects descendants:
|
|
84
|
+
`@custom-variant expanded ([aria-expanded="true"])` means
|
|
85
|
+
`& [aria-expanded="true"]`.
|
|
86
|
+
[prefer-explicit-nesting-selector](../lints/prefer-explicit-nesting-selector.md)
|
|
87
|
+
reports such a selector, and its fix writes the `&` without changing the
|
|
88
|
+
meaning.
|
|
89
|
+
|
|
90
|
+
## Document-level elements
|
|
91
|
+
|
|
92
|
+
`scope(document)` after the name keeps selectors without `&` as written, so the
|
|
93
|
+
variant can select a document-level element such as `:host` or `:root`.
|
|
94
|
+
|
|
95
|
+
### Stylesheet
|
|
96
|
+
|
|
97
|
+
```css
|
|
98
|
+
@custom-variant shell scope(document) (:host);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Source
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
import { style } from "stillwind/react";
|
|
105
|
+
|
|
106
|
+
export const css = style.css("shell:block shell:p-4 [button]:rounded-md");
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Compiled code
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
export const css = "/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n:where(:root, :host){--spacing:0.25rem;--radius-md:0.375rem;}:host{display:block;}:host{padding:calc(var(--spacing) * 4);}button{border-radius:var(--radius-md);}";
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
In `style.css()`, the first such variant selects the element that the utility
|
|
116
|
+
styles. In `style()`, the rule stays document-wide, and
|
|
117
|
+
[document-scoped-selector](../lints/document-scoped-selector.md) reports it.
|
|
118
|
+
|
|
119
|
+
## Definitions with the same name
|
|
120
|
+
|
|
121
|
+
A later variant definition with the same name replaces the earlier one.
|
|
122
|
+
[duplicate-definition](../lints/duplicate-definition.md) reports it. To match
|
|
123
|
+
several selectors, list them in one definition.
|
|
124
|
+
|
|
125
|
+
The order of variant definitions decides the output order of rules with
|
|
126
|
+
different variants. A definition in your stylesheet comes after the built-in
|
|
127
|
+
variants.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "At-rule reference"
|
|
3
|
+
description: "Find the at-rules that define tokens, utilities, and variants in your stylesheet, and read their syntax and output."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# At-rule reference
|
|
7
|
+
|
|
8
|
+
Your stylesheet defines the design system that `style()` uses. Besides ordinary
|
|
9
|
+
CSS, it can contain at-rules that define tokens, utilities, and variants, and
|
|
10
|
+
at-rules that control where the generated CSS goes. Some of them come from
|
|
11
|
+
Tailwind CSS v4, and Stillwind evaluates them with its own rules. The others
|
|
12
|
+
start with `@stillwind-`.
|
|
13
|
+
|
|
14
|
+
Each page shows the syntax of an at-rule and examples. An example shows the
|
|
15
|
+
stylesheet, the source that uses it, and the complete generated stylesheet. The
|
|
16
|
+
generated stylesheet on these pages leaves out the preflight reset.
|
|
17
|
+
|
|
18
|
+
## Define the design system
|
|
19
|
+
|
|
20
|
+
| At-rule | Use it to | Origin |
|
|
21
|
+
| ---------------------------------------------------------------------------- | ------------------------------------------------------------- | --------- |
|
|
22
|
+
| [@theme](theme.md) | Define design tokens and shared values | Tailwind |
|
|
23
|
+
| [@utility](utility.md) | Define a utility or add declarations to an existing one | Tailwind |
|
|
24
|
+
| [@custom-variant](custom-variant.md) | Define a variant | Tailwind |
|
|
25
|
+
| [@slot](slot.md) | Mark where a variant definition inserts the styled content | Tailwind |
|
|
26
|
+
| [@plugin](plugin.md) | Load a Stillwind or Tailwind CSS v4 plugin | Tailwind |
|
|
27
|
+
| [@stillwind-property](stillwind-property.md) | Register a custom property that utilities need | Stillwind |
|
|
28
|
+
| [@stillwind-require-properties](stillwind-require-properties.md) | Declare the registered custom properties that a utility needs | Stillwind |
|
|
29
|
+
|
|
30
|
+
## Use utilities in your own rules
|
|
31
|
+
|
|
32
|
+
| At-rule | Use it to | Origin |
|
|
33
|
+
| ---------------------------------- | ----------------------------------------------------- | -------- |
|
|
34
|
+
| [@apply](apply.md) | Insert the declarations of utilities into a rule | Tailwind |
|
|
35
|
+
| [@variant](variant.md) | Apply variants, such as `hover` or `dark`, to a block | Tailwind |
|
|
36
|
+
|
|
37
|
+
## Place the generated CSS
|
|
38
|
+
|
|
39
|
+
| At-rule | Use it to | Origin |
|
|
40
|
+
| ---------------------------------------------------------------- | ------------------------------------------------------ | --------- |
|
|
41
|
+
| [@stillwind-slot](stillwind-slot.md) | Place generated utilities, theme values, and other CSS | Stillwind |
|
|
42
|
+
| [@stillwind-css-template](stillwind-css-template.md) | Define the output of `style.css()` | Stillwind |
|
|
43
|
+
|
|
44
|
+
`@import "stillwind"` already places every slot. Use these at-rules when you
|
|
45
|
+
write your own entry stylesheet or change the output of `style.css()`.
|
|
46
|
+
|
|
47
|
+
## Remove or limit definitions
|
|
48
|
+
|
|
49
|
+
| At-rule | Use it to | Origin |
|
|
50
|
+
| ---------------------------------------------------------------------------------------- | -------------------------------------------------------- | --------- |
|
|
51
|
+
| [@stillwind-undef-utility](stillwind-undef-utility.md) | Remove built-in or plugin utilities | Stillwind |
|
|
52
|
+
| [@stillwind-undef-variant](stillwind-undef-variant.md) | Remove built-in or plugin variants | Stillwind |
|
|
53
|
+
| [@stillwind-undef-arbitrary-property](stillwind-undef-arbitrary-property.md) | Reject arbitrary properties such as `[color:red]` | Stillwind |
|
|
54
|
+
| [@stillwind-registry](stillwind-registry.md) | Change definitions only in keyframes or view transitions | Stillwind |
|
|
55
|
+
|
|
56
|
+
## Write a utility library
|
|
57
|
+
|
|
58
|
+
Stillwind's built-in utilities and variants use
|
|
59
|
+
[registry directives](registry-directives.md), such as
|
|
60
|
+
`@stillwind-utility` and `@stillwind-theme-namespace`. Read them when you write
|
|
61
|
+
a utility library or read the built-in definitions. Application stylesheets
|
|
62
|
+
normally do not need them.
|
|
63
|
+
|
|
64
|
+
## Tailwind CSS features that Stillwind ignores
|
|
65
|
+
|
|
66
|
+
Stillwind reads its settings from `stillwind.config.ts` and generates utilities
|
|
67
|
+
only from `style()` calls. It ignores `@config`, `@source`, `@reference`, the
|
|
68
|
+
`important`, `source`, and `prefix` modifiers of `@import`, and the `prefix()`
|
|
69
|
+
option of `@theme`. [ignored-tailwind-feature](../lints/ignored-tailwind-feature.md)
|
|
70
|
+
reports them.
|
|
71
|
+
|
|
72
|
+
When the loader cannot use a Stillwind at-rule, it skips the statement and
|
|
73
|
+
compiles the rest of the stylesheet.
|
|
74
|
+
[invalid-css-directive](../lints/invalid-css-directive.md) reports the skipped
|
|
75
|
+
statement.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@plugin"
|
|
3
|
+
description: "Load a Stillwind plugin or a Tailwind CSS v4 JavaScript plugin, with optional options."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @plugin
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@plugin "name";
|
|
10
|
+
@plugin "name" {
|
|
11
|
+
option: value;
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`@plugin` loads JavaScript that generates CSS definitions, and the generated CSS
|
|
16
|
+
replaces the statement. Write it at the top level of the stylesheet.
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```css
|
|
21
|
+
@import "stillwind";
|
|
22
|
+
@plugin "@stillwind/plugin-iconify";
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
[`@stillwind/plugin-iconify`](https://github.com/SegaraRai/stillwind/blob/main/plugins/iconify/README.md)
|
|
26
|
+
adds icon utilities such as `icon-mdi--close`. Only the icons that your modules
|
|
27
|
+
use reach the stylesheet.
|
|
28
|
+
|
|
29
|
+
## Finding the plugin
|
|
30
|
+
|
|
31
|
+
The host looks up `name` in the `plugins` field of the project in
|
|
32
|
+
`stillwind.config.ts` first. Otherwise, it imports the package or the local file
|
|
33
|
+
from the stylesheet and uses its default export. See
|
|
34
|
+
[Configuration](../configuration.md).
|
|
35
|
+
|
|
36
|
+
## Options
|
|
37
|
+
|
|
38
|
+
The block contains only `name: value;` declarations. Strings keep their quotes,
|
|
39
|
+
so a `;` inside a string does not end a declaration. The loader rejects other
|
|
40
|
+
statements and empty values.
|
|
41
|
+
|
|
42
|
+
## Tailwind CSS plugins
|
|
43
|
+
|
|
44
|
+
Tailwind CSS v4 JavaScript plugins use the same statement, including plugins
|
|
45
|
+
that `plugin.withOptions()` creates. The host supports `addBase`,
|
|
46
|
+
`addUtilities`, `addComponents`, `matchUtilities`, `matchComponents`,
|
|
47
|
+
`addVariant`, `matchVariant`, `theme`, `config`, and `prefix`. `prefix` returns
|
|
48
|
+
the class name unchanged, because Stillwind has no class prefix. These plugins need
|
|
49
|
+
the `tailwindcss` package.
|
|
50
|
+
|
|
51
|
+
The options block converts values as Tailwind does. `true`, `false`, `null`, and
|
|
52
|
+
numeric text become those values. A quoted string loses its quotes, other text stays
|
|
53
|
+
a string, and a comma-separated list becomes an array.
|
|
54
|
+
|
|
55
|
+
Definitions from a plugin register before the definitions of your stylesheet,
|
|
56
|
+
wherever the `@plugin` statement stands. A `@utility` in your stylesheet
|
|
57
|
+
therefore adds to a plugin utility with the same name, and
|
|
58
|
+
[@stillwind-undef-utility](stillwind-undef-utility.md) can remove
|
|
59
|
+
plugin utilities.
|
|
60
|
+
|
|
61
|
+
A plugin can select elements by fixed class names, such as `not-prose`. `style()`
|
|
62
|
+
keeps these class names, as
|
|
63
|
+
[Tailwind CSS compatibility](../guides/tailwind-compatibility.md#class-names-that-a-plugins-selectors-use)
|
|
64
|
+
describes. That page also lists the tested plugins.
|
|
65
|
+
|
|
66
|
+
A CSS package does not use `@plugin`. Load it with `@import`, such as
|
|
67
|
+
`@import "tw-animate-css";`.
|
|
68
|
+
|
|
69
|
+
[invalid-css-import](../lints/invalid-css-import.md) reports a plugin that the
|
|
70
|
+
host cannot find or load, and invalid options. The stylesheet loads without that
|
|
71
|
+
plugin.
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Registry directives"
|
|
3
|
+
description: "Read the at-rules that define Stillwind's built-in utilities, variants, and theme metadata."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Registry directives
|
|
7
|
+
|
|
8
|
+
Stillwind defines its built-in utilities and variants in CSS, in the files that
|
|
9
|
+
`@import "stillwind"` loads. These files use registry directives, which describe
|
|
10
|
+
cascade order, theme metadata, and other information that ordinary definitions
|
|
11
|
+
cannot express. Use them when you write a utility library. An application
|
|
12
|
+
stylesheet normally uses [@utility](utility.md) and
|
|
13
|
+
[@custom-variant](custom-variant.md) instead.
|
|
14
|
+
|
|
15
|
+
Editors suggest these directives inside definitions and registry blocks. The
|
|
16
|
+
[built-in definitions](https://github.com/SegaraRai/stillwind/tree/main/packages/core/css)
|
|
17
|
+
show complete examples.
|
|
18
|
+
|
|
19
|
+
## Definitions
|
|
20
|
+
|
|
21
|
+
### @stillwind-utility
|
|
22
|
+
|
|
23
|
+
```css
|
|
24
|
+
@stillwind-utility name-* (tw-sort: property) { ... }
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Defines a utility with the same body language as `@utility`. The position of the
|
|
28
|
+
definition decides its cascade order: a later definition wins over an earlier
|
|
29
|
+
one when both set the same property. The optional `tw-sort` descriptor names the
|
|
30
|
+
property that Tailwind-compatible class sorting uses for the definition. The
|
|
31
|
+
header also accepts `implementation`.
|
|
32
|
+
|
|
33
|
+
All `@stillwind-utility` definitions of a name register before plugin
|
|
34
|
+
definitions and the `@utility` definitions of the stylesheet.
|
|
35
|
+
|
|
36
|
+
### @stillwind-variant
|
|
37
|
+
|
|
38
|
+
```css
|
|
39
|
+
@stillwind-variant name (descriptors) { ... }
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Defines a variant with the body language of `@custom-variant`. Its position
|
|
43
|
+
decides the output order of variant rules. The optional header is a
|
|
44
|
+
comma-separated list:
|
|
45
|
+
|
|
46
|
+
| Descriptor | Value |
|
|
47
|
+
| ----------- | ----------------------------------------------------------------------------------------- |
|
|
48
|
+
| `value` | The accepted value type of a `*` name, such as `[supports-condition]` |
|
|
49
|
+
| `modifier` | The accepted modifier type |
|
|
50
|
+
| `scope` | `document`, which keeps selectors without `&` as written |
|
|
51
|
+
| `sort` | A theme namespace, such as `--breakpoint-*`, whose token values order the variants |
|
|
52
|
+
| `direction` | `asc` or `desc`, the order of the `sort` values |
|
|
53
|
+
| `group` | A group name. Variants of a group are ordered together, at the position of the first one. |
|
|
54
|
+
| `bare` | `true` when the variant also matches a bare token name, such as `lg` for `min-lg` |
|
|
55
|
+
|
|
56
|
+
```css
|
|
57
|
+
@stillwind-variant min-* (sort: --breakpoint-*, direction: asc, bare: true) {
|
|
58
|
+
@media (width >= --value(--breakpoint-*)) {
|
|
59
|
+
@slot;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### @stillwind-intrinsic
|
|
65
|
+
|
|
66
|
+
```css
|
|
67
|
+
@stillwind-intrinsic name;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Replaces the body of a `@stillwind-variant` with a behavior that the compiler
|
|
71
|
+
implements, such as `not-*`. The names are internal to Stillwind.
|
|
72
|
+
|
|
73
|
+
### @stillwind-arbitrary-property
|
|
74
|
+
|
|
75
|
+
```css
|
|
76
|
+
@stillwind-arbitrary-property pattern;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Places arbitrary-property candidates for the matching properties, such as
|
|
80
|
+
`[color:red]`, at this position in the cascade order of utilities. The built-in
|
|
81
|
+
definitions end with `@stillwind-arbitrary-property *;`, so other arbitrary
|
|
82
|
+
properties come after every built-in utility. The statement also accepts the
|
|
83
|
+
matching properties again after
|
|
84
|
+
[@stillwind-undef-arbitrary-property](stillwind-undef-arbitrary-property.md).
|
|
85
|
+
|
|
86
|
+
## Theme metadata
|
|
87
|
+
|
|
88
|
+
### @stillwind-theme-namespace
|
|
89
|
+
|
|
90
|
+
```css
|
|
91
|
+
@stillwind-theme-namespace --spacing-* [length] scale(px: 1px);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Declares a theme namespace. The bracketed types limit the arbitrary values and
|
|
95
|
+
typed variables that the namespace accepts.
|
|
96
|
+
[incompatible-theme-value](../lints/incompatible-theme-value.md) uses them to
|
|
97
|
+
check tokens.
|
|
98
|
+
|
|
99
|
+
`scale()` makes the token with the namespace name, such as `--spacing`, the scale
|
|
100
|
+
of the namespace. A numeric key then resolves to a multiple of the scale, and
|
|
101
|
+
`--spacing(4)` lowers to the same multiple. Each argument of `scale()` names a
|
|
102
|
+
key with a fixed value, such as `px` for `1px`.
|
|
103
|
+
|
|
104
|
+
### @stillwind-theme-exclude
|
|
105
|
+
|
|
106
|
+
```css
|
|
107
|
+
@stillwind-theme-exclude --text-* --text-shadow-*;
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Makes a `--value(--text-*)` pattern skip the tokens of the narrower namespaces
|
|
111
|
+
that follow the first one. Without it, `--text-shadow-lg` would be a value of
|
|
112
|
+
`--text-*`.
|
|
113
|
+
|
|
114
|
+
### @stillwind-theme-order
|
|
115
|
+
|
|
116
|
+
```css
|
|
117
|
+
@stillwind-theme-order spacing color;
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Sets the order of namespaces in the declarations that the `theme` slot emits.
|
|
121
|
+
|
|
122
|
+
### @stillwind-omit-token-prefix
|
|
123
|
+
|
|
124
|
+
```css
|
|
125
|
+
@stillwind-omit-token-prefix --shadow- --tw-shadow:;
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Leaves out the tokens with the prefix when the generated CSS contains the
|
|
129
|
+
condition text.
|
|
130
|
+
|
|
131
|
+
## Values and dependencies
|
|
132
|
+
|
|
133
|
+
### @stillwind-format
|
|
134
|
+
|
|
135
|
+
```css
|
|
136
|
+
@stillwind-format transform compose-space;
|
|
137
|
+
@stillwind-format --tw-translate-* zero-length;
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Declares how the compiler treats the values of the matching properties.
|
|
141
|
+
`compose-space` marks a property whose declarations compose space-separated
|
|
142
|
+
parts. `zero-length` gives a zero value the length type that `calc()` needs.
|
|
143
|
+
|
|
144
|
+
## Classes and relationships
|
|
145
|
+
|
|
146
|
+
### @stillwind-marker
|
|
147
|
+
|
|
148
|
+
```css
|
|
149
|
+
@stillwind-marker group (modifiable);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Declares a marker class: a class that a candidate adds to the element as
|
|
153
|
+
written, so that selectors such as `.group:hover &` can match it. `modifiable`
|
|
154
|
+
also accepts a named modifier, so `group/menu` adds the class `group/menu`.
|
|
155
|
+
|
|
156
|
+
The classes that the selectors of `@utility` and `@custom-variant` definitions
|
|
157
|
+
name are also marker classes.
|
|
158
|
+
[invalid-marker-use](../lints/invalid-marker-use.md) reports a candidate that
|
|
159
|
+
names a marker class but cannot add it, such as `hover:group`.
|
|
160
|
+
|
|
161
|
+
### @stillwind-marker-source
|
|
162
|
+
|
|
163
|
+
```css
|
|
164
|
+
@stillwind-marker-source ".card .title {}";
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Makes the classes that the rules in the string select marker classes, as a
|
|
168
|
+
definition body does. It defines and emits nothing. Plugins use it for classes
|
|
169
|
+
that their dynamic utilities use.
|
|
170
|
+
|
|
171
|
+
### @stillwind-relationship
|
|
172
|
+
|
|
173
|
+
```css
|
|
174
|
+
@stillwind-relationship group-*;
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Registers a pattern of utility or variant names that relate an element to
|
|
178
|
+
another element, such as `group-*` and `peer-*`.
|
|
179
|
+
[prefer-typed-relationships](../lints/prefer-typed-relationships.md) reports
|
|
180
|
+
candidates that match a pattern, because [style.ref()](../macros/ref/index.md) can
|
|
181
|
+
express the same relationship. The patterns do not change the generated CSS.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@slot"
|
|
3
|
+
description: "Mark where a variant definition inserts the styled content."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @slot
|
|
7
|
+
|
|
8
|
+
```css
|
|
9
|
+
@slot;
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`@slot` marks where the block form of a variant definition inserts the
|
|
13
|
+
declarations of the utility. Write it in the body of
|
|
14
|
+
[@custom-variant](custom-variant.md), or of a registry variant
|
|
15
|
+
definition.
|
|
16
|
+
|
|
17
|
+
### Stylesheet
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
@custom-variant hocus {
|
|
21
|
+
&:hover,
|
|
22
|
+
&:focus-visible {
|
|
23
|
+
@slot;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Source
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { style } from "stillwind/react";
|
|
32
|
+
|
|
33
|
+
export const link = style("hocus:underline");
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Compiled code
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
export const link = {className:"sw_4x5c3"};
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Generated stylesheet without preflight
|
|
43
|
+
|
|
44
|
+
```css
|
|
45
|
+
/*! stillwind v0.0.0 | MIT License | https://stillwind.dev */
|
|
46
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
47
|
+
@layer properties, theme, base, components, utilities;
|
|
48
|
+
|
|
49
|
+
@layer utilities {
|
|
50
|
+
.sw_4x5c3:hover, .sw_4x5c3:focus-visible {
|
|
51
|
+
text-decoration-line: underline;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`@slot` belongs to variant definitions only.
|
|
57
|
+
[@stillwind-slot](stillwind-slot.md) is a different at-rule: it
|
|
58
|
+
places generated CSS in your stylesheet.
|