stillwind 0.0.0 → 0.1.0-rc.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
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
## Stillwind
|
|
2
|
+
|
|
3
|
+
- This project styles elements with [Stillwind](https://stillwind.dev/). Stillwind compiles Tailwind CSS v4 utilities in `style()` calls into element props and static CSS.
|
|
4
|
+
- Before you change styles, read the relevant Markdown docs in `node_modules/stillwind/docs/`. Start with `guides/recommended-practices.md`. `node_modules/stillwind/skills/stillwind/SKILL.md` lists the page for each task.
|
|
5
|
+
- After you change styles, run `stillwind lint --fix` and `stillwind fmt` through the project's package manager, and fix the remaining findings.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Stillwind contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Stillwind
|
|
2
|
+
|
|
3
|
+
Stillwind compiles Tailwind CSS v4 utilities into component props and static CSS.
|
|
4
|
+
It uses theme rules and compiler checks to keep styling code in order, even when
|
|
5
|
+
AI agents write much of it. See the [documentation](https://stillwind.dev/docs)
|
|
6
|
+
and try it in the [Playground](https://play.stillwind.dev/).
|
|
7
|
+
|
|
8
|
+
`stillwind` is the main Stillwind package. It provides CSS defaults, configuration
|
|
9
|
+
helpers, and style APIs for Alpine, Astro, Lit, Preact, Qwik, React, Solid, Svelte,
|
|
10
|
+
vanilla JavaScript, and Vue.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
vp i stillwind
|
|
16
|
+
vp i -D @stillwind/integration
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configure a project
|
|
20
|
+
|
|
21
|
+
Create a CSS entrypoint:
|
|
22
|
+
|
|
23
|
+
```css
|
|
24
|
+
/* src/stillwind.css */
|
|
25
|
+
@import "stillwind";
|
|
26
|
+
|
|
27
|
+
@theme {
|
|
28
|
+
--color-accent: oklch(0.6 0.2 250);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Select that stylesheet and your source files in `stillwind.config.ts`:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { defineConfig } from "stillwind/config";
|
|
36
|
+
|
|
37
|
+
export default defineConfig({
|
|
38
|
+
projects: [
|
|
39
|
+
{
|
|
40
|
+
css: "./src/stillwind.css",
|
|
41
|
+
files: ["src/**/*.{js,jsx,ts,tsx,vue,svelte,astro}"],
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Register the [integration for your build tool](https://stillwind.dev/docs/integrations).
|
|
48
|
+
For Vite, add `stillwind()` from `@stillwind/integration/vite` before the framework's
|
|
49
|
+
JSX transform. The integration reads the project configuration and delivers its CSS.
|
|
50
|
+
|
|
51
|
+
## Write styles
|
|
52
|
+
|
|
53
|
+
Import `style` from the entrypoint for your framework:
|
|
54
|
+
|
|
55
|
+
| Framework | Import | Applying props |
|
|
56
|
+
| --------- | ------------------- | ---------------------------- |
|
|
57
|
+
| Alpine | `stillwind/alpine` | `x-sw="props"` |
|
|
58
|
+
| Astro | `stillwind/astro` | `{...props}` |
|
|
59
|
+
| Lit | `stillwind/lit` | `${applyStyle(props)}` |
|
|
60
|
+
| Preact | `stillwind/preact` | `{...props}` |
|
|
61
|
+
| Qwik | `stillwind/qwik` | `{...props}` |
|
|
62
|
+
| React | `stillwind/react` | `{...props}` |
|
|
63
|
+
| Solid | `stillwind/solid` | `{...props}` |
|
|
64
|
+
| Svelte | `stillwind/svelte` | `{...props}` |
|
|
65
|
+
| Vanilla | `stillwind/vanilla` | `applyStyle(element, props)` |
|
|
66
|
+
| Vue | `stillwind/vue` | `v-bind="props"` |
|
|
67
|
+
|
|
68
|
+
Gatsby uses `stillwind/react`. Fresh 2 with Vite uses `stillwind/preact`.
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
import { style } from "stillwind/react";
|
|
72
|
+
|
|
73
|
+
const base = style("rounded-md bg-accent px-4 py-2 text-white");
|
|
74
|
+
|
|
75
|
+
<button {...style(base, loading && "opacity-60")}>Save</button>;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Style arguments must be pure. The compiler does not guarantee their evaluation
|
|
79
|
+
order or count, and it can omit unused evaluations. Perform effects outside style
|
|
80
|
+
calls. Static styles emit CSS; dynamic values and conditions can require runtime helpers.
|
|
81
|
+
Composed styles retain ordinary CSS specificity and importance.
|
|
82
|
+
|
|
83
|
+
For vanilla JavaScript, import the macro and DOM helpers from `stillwind/vanilla`:
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import { applyStyle, clearStyle, style } from "stillwind/vanilla";
|
|
87
|
+
|
|
88
|
+
const button = document.querySelector("button")!;
|
|
89
|
+
applyStyle(
|
|
90
|
+
button,
|
|
91
|
+
style("rounded-md px-4 py-2", {
|
|
92
|
+
"--accent": accent,
|
|
93
|
+
}),
|
|
94
|
+
);
|
|
95
|
+
clearStyle(button);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Call `applyStyle` again to replace the element's previous Stillwind contribution.
|
|
99
|
+
The helper preserves existing classes and unrelated inline styles. `clearStyle`, or
|
|
100
|
+
`applyStyle(element, {})`, removes the contribution and restores overwritten inline
|
|
101
|
+
values and priorities. Inline values changed externally after the last application
|
|
102
|
+
are preserved. HTML and SVG elements use the same helpers. The build integration
|
|
103
|
+
delivers the generated CSS.
|
|
104
|
+
|
|
105
|
+
For Alpine, register the plugin before starting Alpine. Write macro calls in JavaScript
|
|
106
|
+
or TypeScript modules and pass their results to `x-sw`:
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
import Alpine from "alpinejs";
|
|
110
|
+
import { stillwind, style } from "stillwind/alpine";
|
|
111
|
+
|
|
112
|
+
Alpine.plugin(stillwind);
|
|
113
|
+
Alpine.data("button", () => ({
|
|
114
|
+
active: false,
|
|
115
|
+
get props() {
|
|
116
|
+
return style("px-4 py-2", this.active && "bg-blue-500");
|
|
117
|
+
},
|
|
118
|
+
}));
|
|
119
|
+
Alpine.start();
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```html
|
|
123
|
+
<button x-data="button" x-sw="props" @click="active = !active">Toggle</button>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
For Lit, pass the props to an element directive. Include the module's CSS in the
|
|
127
|
+
component's shadow root:
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
import { html, LitElement, unsafeCSS } from "lit";
|
|
131
|
+
import { applyStyle, style } from "stillwind/lit";
|
|
132
|
+
import { css } from "stillwind/module-css";
|
|
133
|
+
|
|
134
|
+
class SaveButton extends LitElement {
|
|
135
|
+
static styles = unsafeCSS(css);
|
|
136
|
+
|
|
137
|
+
render() {
|
|
138
|
+
return html`<button ${applyStyle(style("px-4 py-2"))}>Save</button>`;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Lit's directive supports browser rendering. Lit SSR is unsupported. Use
|
|
144
|
+
`stillwind({ automatic: false })` when styles belong only in shadow roots.
|
|
145
|
+
Alpine and Lit updates replace the helper's previous contribution and preserve
|
|
146
|
+
unrelated classes and inline styles. Removing the directive clears its contribution.
|
|
147
|
+
Lit reapplies its latest props when the directive reconnects.
|
|
148
|
+
|
|
149
|
+
Qwik uses ordinary JSX spreads. Keep Stillwind before the Qwik optimizer in the Vite
|
|
150
|
+
plugin list. Compiled props contain plain class and style values that Qwik can serialize.
|
|
151
|
+
|
|
152
|
+
## Customize and extend
|
|
153
|
+
|
|
154
|
+
The default stylesheet imports the theme, preflight, utility slot, builtins, and
|
|
155
|
+
templates. Custom CSS entries receive only the definitions they import. Individual
|
|
156
|
+
stylesheets are available as `stillwind/theme.css`, `stillwind/preflight.css`,
|
|
157
|
+
`stillwind/utilities.css`, `stillwind/builtins.css`, and `stillwind/templates.css`.
|
|
158
|
+
|
|
159
|
+
Use `stillwind/config` for project settings and lint presets. `stillwind/css`
|
|
160
|
+
provides helpers for explicit stylesheet placement, and `stillwind/module-css`
|
|
161
|
+
exposes the compiled CSS of a producer module.
|
|
162
|
+
|
|
163
|
+
- [Macro reference](https://stillwind.dev/docs/macros): refs, conditions, CVA, keyframes, and composition.
|
|
164
|
+
- [Configuration](https://stillwind.dev/docs/configuration): scopes, lint rules, sorting, and namespaces.
|
|
165
|
+
- [CSS ordering](https://stillwind.dev/docs/concepts/css-ordering): precedence when styles are composed.
|
|
166
|
+
- [CSS delivery](https://github.com/SegaraRai/stillwind/blob/main/docs/css-emission.md): SSR, explicit CSS values, and Shadow DOM.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Tailwind Labs, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Interpolable custom property registrations for the `keyframe` registry context.
|
|
3
|
+
|
|
4
|
+
A keyframe interpolates a custom property only when its registration has a typed
|
|
5
|
+
`syntax`. The Tailwind registrations use `syntax: "*"`, so a frame that sets
|
|
6
|
+
`--tw-translate-y` switches its value halfway through the animation. The keyframe
|
|
7
|
+
definitions in `sw-motion-contexts.css` write these properties instead.
|
|
8
|
+
|
|
9
|
+
Each initial value is the identity of its transform or filter function, so a frame
|
|
10
|
+
that sets one axis or one filter function keeps the others at their identity.
|
|
11
|
+
Elements never set these properties; only keyframes do.
|
|
12
|
+
`value-for` applies translation and filter length policies to their stored values.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
@stillwind-property --sw-motion-translate-x {
|
|
16
|
+
value-for: translate;
|
|
17
|
+
syntax: "<length-percentage>";
|
|
18
|
+
inherits: false;
|
|
19
|
+
initial-value: 0px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@stillwind-property --sw-motion-translate-y {
|
|
23
|
+
value-for: translate;
|
|
24
|
+
syntax: "<length-percentage>";
|
|
25
|
+
inherits: false;
|
|
26
|
+
initial-value: 0px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@stillwind-property --sw-motion-translate-z {
|
|
30
|
+
value-for: translate;
|
|
31
|
+
syntax: "<length>";
|
|
32
|
+
inherits: false;
|
|
33
|
+
initial-value: 0px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@stillwind-property --sw-motion-scale-x {
|
|
37
|
+
syntax: "<number>";
|
|
38
|
+
inherits: false;
|
|
39
|
+
initial-value: 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@stillwind-property --sw-motion-scale-y {
|
|
43
|
+
syntax: "<number>";
|
|
44
|
+
inherits: false;
|
|
45
|
+
initial-value: 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@stillwind-property --sw-motion-scale-z {
|
|
49
|
+
syntax: "<number>";
|
|
50
|
+
inherits: false;
|
|
51
|
+
initial-value: 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@stillwind-property --sw-motion-rotate-x {
|
|
55
|
+
syntax: "<angle>";
|
|
56
|
+
inherits: false;
|
|
57
|
+
initial-value: 0deg;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@stillwind-property --sw-motion-rotate-y {
|
|
61
|
+
syntax: "<angle>";
|
|
62
|
+
inherits: false;
|
|
63
|
+
initial-value: 0deg;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@stillwind-property --sw-motion-rotate-z {
|
|
67
|
+
syntax: "<angle>";
|
|
68
|
+
inherits: false;
|
|
69
|
+
initial-value: 0deg;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@stillwind-property --sw-motion-skew-x {
|
|
73
|
+
syntax: "<angle>";
|
|
74
|
+
inherits: false;
|
|
75
|
+
initial-value: 0deg;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@stillwind-property --sw-motion-skew-y {
|
|
79
|
+
syntax: "<angle>";
|
|
80
|
+
inherits: false;
|
|
81
|
+
initial-value: 0deg;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@stillwind-property --sw-motion-blur {
|
|
85
|
+
value-for: filter;
|
|
86
|
+
syntax: "<length>";
|
|
87
|
+
inherits: false;
|
|
88
|
+
initial-value: 0px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@stillwind-property --sw-motion-brightness {
|
|
92
|
+
syntax: "<number>";
|
|
93
|
+
inherits: false;
|
|
94
|
+
initial-value: 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@stillwind-property --sw-motion-contrast {
|
|
98
|
+
syntax: "<number>";
|
|
99
|
+
inherits: false;
|
|
100
|
+
initial-value: 1;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@stillwind-property --sw-motion-grayscale {
|
|
104
|
+
syntax: "<number>";
|
|
105
|
+
inherits: false;
|
|
106
|
+
initial-value: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@stillwind-property --sw-motion-hue-rotate {
|
|
110
|
+
syntax: "<angle>";
|
|
111
|
+
inherits: false;
|
|
112
|
+
initial-value: 0deg;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@stillwind-property --sw-motion-invert {
|
|
116
|
+
syntax: "<number>";
|
|
117
|
+
inherits: false;
|
|
118
|
+
initial-value: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@stillwind-property --sw-motion-saturate {
|
|
122
|
+
syntax: "<number>";
|
|
123
|
+
inherits: false;
|
|
124
|
+
initial-value: 1;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@stillwind-property --sw-motion-sepia {
|
|
128
|
+
syntax: "<number>";
|
|
129
|
+
inherits: false;
|
|
130
|
+
initial-value: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@stillwind-property --sw-motion-backdrop-blur {
|
|
134
|
+
value-for: backdrop-filter;
|
|
135
|
+
syntax: "<length>";
|
|
136
|
+
inherits: false;
|
|
137
|
+
initial-value: 0px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@stillwind-property --sw-motion-backdrop-brightness {
|
|
141
|
+
syntax: "<number>";
|
|
142
|
+
inherits: false;
|
|
143
|
+
initial-value: 1;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@stillwind-property --sw-motion-backdrop-contrast {
|
|
147
|
+
syntax: "<number>";
|
|
148
|
+
inherits: false;
|
|
149
|
+
initial-value: 1;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@stillwind-property --sw-motion-backdrop-grayscale {
|
|
153
|
+
syntax: "<number>";
|
|
154
|
+
inherits: false;
|
|
155
|
+
initial-value: 0;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@stillwind-property --sw-motion-backdrop-hue-rotate {
|
|
159
|
+
syntax: "<angle>";
|
|
160
|
+
inherits: false;
|
|
161
|
+
initial-value: 0deg;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@stillwind-property --sw-motion-backdrop-invert {
|
|
165
|
+
syntax: "<number>";
|
|
166
|
+
inherits: false;
|
|
167
|
+
initial-value: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@stillwind-property --sw-motion-backdrop-opacity {
|
|
171
|
+
syntax: "<number>";
|
|
172
|
+
inherits: false;
|
|
173
|
+
initial-value: 1;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@stillwind-property --sw-motion-backdrop-saturate {
|
|
177
|
+
syntax: "<number>";
|
|
178
|
+
inherits: false;
|
|
179
|
+
initial-value: 1;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@stillwind-property --sw-motion-backdrop-sepia {
|
|
183
|
+
syntax: "<number>";
|
|
184
|
+
inherits: false;
|
|
185
|
+
initial-value: 0;
|
|
186
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Legacy Tailwind spellings that canonical lint rewrites to their current form.
|
|
3
|
+
|
|
4
|
+
`@stillwind-legacy-utility old new;` renames a utility. A trailing `*` in both names
|
|
5
|
+
keeps the rest of the name, so `start-*` to `inset-s-*` rewrites `start-4` to
|
|
6
|
+
`inset-s-4`. The rewrite is used only when the old name does not resolve, or when both
|
|
7
|
+
names produce the same CSS.
|
|
8
|
+
|
|
9
|
+
`@stillwind-legacy-theme-key key --namespace-* [exposure];` names the theme namespace
|
|
10
|
+
that a Tailwind v3 config key reads, as in Tailwind's compatibility layer. A config key
|
|
11
|
+
without a statement reads the namespace with the kebab-case name of the key. The
|
|
12
|
+
optional exposure decides how plugin configuration sees the CSS values of the namespace:
|
|
13
|
+
`replace` replaces the v3 default values of the key, and `extend` adds the CSS values
|
|
14
|
+
to them. Without an exposure, plugin configuration sees only the v3 default values.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
@stillwind-legacy-utility bg-gradient-to-* bg-linear-to-*;
|
|
18
|
+
@stillwind-legacy-utility order-none order-0;
|
|
19
|
+
@stillwind-legacy-utility overflow-ellipsis text-ellipsis;
|
|
20
|
+
@stillwind-legacy-utility break-words wrap-break-word;
|
|
21
|
+
@stillwind-legacy-utility start-* inset-s-*;
|
|
22
|
+
@stillwind-legacy-utility end-* inset-e-*;
|
|
23
|
+
|
|
24
|
+
@stillwind-legacy-theme-key animation --animate-* extend;
|
|
25
|
+
@stillwind-legacy-theme-key aspectRatio --aspect-* extend;
|
|
26
|
+
@stillwind-legacy-theme-key borderRadius --radius-* extend;
|
|
27
|
+
@stillwind-legacy-theme-key boxShadow --shadow-* extend;
|
|
28
|
+
@stillwind-legacy-theme-key colors --color-* replace;
|
|
29
|
+
@stillwind-legacy-theme-key containers --container-*;
|
|
30
|
+
@stillwind-legacy-theme-key fontFamily --font-*;
|
|
31
|
+
@stillwind-legacy-theme-key fontSize --text-* extend;
|
|
32
|
+
@stillwind-legacy-theme-key letterSpacing --tracking-* extend;
|
|
33
|
+
@stillwind-legacy-theme-key lineHeight --leading-* extend;
|
|
34
|
+
@stillwind-legacy-theme-key maxWidth --container-* extend;
|
|
35
|
+
@stillwind-legacy-theme-key screens --breakpoint-* extend;
|
|
36
|
+
@stillwind-legacy-theme-key transitionTimingFunction --ease-*;
|