stillwind 0.1.0 → 0.3.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/README.md CHANGED
@@ -1,13 +1,11 @@
1
1
  # Stillwind
2
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/).
3
+ [Stillwind](https://stillwind.dev/) 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 AI agents write much of it.
5
+ See the [documentation](https://stillwind.dev/docs) and try it in the [Playground](https://play.stillwind.dev/).
7
6
 
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.
7
+ `stillwind` is the main Stillwind package. It provides CSS defaults, configuration helpers, and style APIs for
8
+ Alpine, Astro, Lit, Preact, Qwik, React, Solid, Svelte, Vue, and vanilla JavaScript.
11
9
 
12
10
  ## Install
13
11
 
@@ -52,18 +50,18 @@ JSX transform. The integration reads the project configuration and delivers its
52
50
 
53
51
  Import `style` from the entrypoint for your framework:
54
52
 
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"` |
53
+ | Framework | Import | Applying props |
54
+ | ---------- | ------------------- | ---------------------------- |
55
+ | Alpine | `stillwind/alpine` | `x-sw="props"` |
56
+ | Astro | `stillwind/astro` | `{...props}` |
57
+ | Lit | `stillwind/lit` | `${applyStyle(props)}` |
58
+ | Preact | `stillwind/preact` | `{...props}` |
59
+ | Qwik | `stillwind/qwik` | `{...props}` |
60
+ | React | `stillwind/react` | `{...props}` |
61
+ | Solid | `stillwind/solid` | `{...props}` |
62
+ | Svelte | `stillwind/svelte` | `{...props}` |
63
+ | Vue | `stillwind/vue` | `v-bind="props"` |
64
+ | Vanilla JS | `stillwind/vanilla` | `applyStyle(element, props)` |
67
65
 
68
66
  Gatsby uses `stillwind/react`. Fresh 2 with Vite uses `stillwind/preact`.
69
67
 
@@ -155,6 +153,8 @@ The default stylesheet imports the theme, preflight, utility slot, builtins, and
155
153
  templates. Custom CSS entries receive only the definitions they import. Individual
156
154
  stylesheets are available as `stillwind/theme.css`, `stillwind/preflight.css`,
157
155
  `stillwind/utilities.css`, `stillwind/builtins.css`, and `stillwind/templates.css`.
156
+ Import a file from `stillwind/logical/`, such as `stillwind/logical/overflow.css`,
157
+ after them to make the axis utilities of that property write logical properties.
158
158
 
159
159
  Use `stillwind/config` for project settings and lint presets. `stillwind/css`
160
160
  provides helpers for explicit stylesheet placement, and `stillwind/module-css`
@@ -48,7 +48,7 @@
48
48
 
49
49
  /* MARK: Screen reader visibility */
50
50
 
51
- @stillwind-utility sr-only {
51
+ @stillwind-utility sr-only (implementation) {
52
52
  position: absolute;
53
53
  width: 1px;
54
54
  height: 1px;
@@ -60,7 +60,7 @@
60
60
  border-width: 0;
61
61
  }
62
62
 
63
- @stillwind-utility not-sr-only {
63
+ @stillwind-utility not-sr-only (implementation) {
64
64
  position: static;
65
65
  width: auto;
66
66
  height: auto;
@@ -0,0 +1,67 @@
1
+ /*
2
+ Makes `divide-y-*` write logical properties, as `divide-x-*` writes `border-inline-*`. `stillwind`
3
+ keeps the physical properties for Tailwind CSS compatibility, so a project opts in by importing
4
+ this file.
5
+
6
+ Import it after `stillwind` or `stillwind/builtins.css`, because an undefinition removes only
7
+ definitions that register before it. Each replacement keeps the name of the removed definition,
8
+ and therefore its cascade position before `divide-dashed` and the other style utilities. The
9
+ `divide-y-*` pattern also removes `divide-y-reverse` and `divide-y-[initial]`, so this file
10
+ defines them again.
11
+ */
12
+
13
+ @stillwind-undef-utility divide-y;
14
+ @stillwind-undef-utility divide-y-*;
15
+
16
+ @stillwind-utility divide-y (tw-sort: divide-y-width) {
17
+ :where(& > :not(:last-child)) {
18
+ --tw-divide-y-reverse: 0;
19
+ border-block-style: var(--tw-border-style);
20
+ border-block-start-width: calc(1px * var(--tw-divide-y-reverse));
21
+ border-block-end-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
22
+ }
23
+ }
24
+
25
+ @stillwind-utility divide-y-[initial] (tw-sort: divide-y-width) {
26
+ :where(& > :not(:last-child)) {
27
+ --tw-divide-y-reverse: 0;
28
+ border-block-style: var(--tw-border-style);
29
+ border-block-start-width: calc(initial * var(--tw-divide-y-reverse));
30
+ border-block-end-width: calc(initial * calc(1 - var(--tw-divide-y-reverse)));
31
+ }
32
+ }
33
+
34
+ @stillwind-utility divide-y-reverse {
35
+ :where(& > :not(:last-child)) {
36
+ --tw-divide-y-reverse: 1;
37
+ }
38
+ }
39
+
40
+ @stillwind-utility divide-y-* (tw-sort: divide-y-width) {
41
+ :where(& > :not(:last-child)) {
42
+ border-block-end-style: var(--tw-border-style);
43
+ border-block-end-width: --value([line-width]);
44
+ }
45
+ }
46
+
47
+ @stillwind-utility divide-y-* (tw-sort: divide-y-width) {
48
+ :where(& > :not(:last-child)) {
49
+ --tw-divide-y-reverse: 0;
50
+ border-block-style: var(--tw-border-style);
51
+ border-block-start-width: calc(
52
+ --value(--divide-width-*, --border-width-*) * var(--tw-divide-y-reverse)
53
+ );
54
+ border-block-end-width: calc(
55
+ --value(--divide-width-*, --border-width-*) * calc(1 - var(--tw-divide-y-reverse))
56
+ );
57
+ }
58
+ }
59
+
60
+ @stillwind-utility divide-y-* (tw-sort: divide-y-width) {
61
+ :where(& > :not(:last-child)) {
62
+ --tw-divide-y-reverse: 0;
63
+ border-block-style: var(--tw-border-style);
64
+ border-block-start-width: calc(--value(integer) * 1px * var(--tw-divide-y-reverse));
65
+ border-block-end-width: calc(--value(integer) * 1px * calc(1 - var(--tw-divide-y-reverse)));
66
+ }
67
+ }
@@ -0,0 +1,57 @@
1
+ /*
2
+ Makes `overflow-x-*` and `overflow-y-*` write logical properties, as `px-*` and `py-*` write
3
+ `padding-inline` and `padding-block`. `stillwind` keeps the physical properties for Tailwind
4
+ CSS compatibility, so a project opts in by importing this file.
5
+
6
+ Import it after `stillwind` or `stillwind/builtins.css`, because an undefinition removes only
7
+ definitions that register before it. Each replacement keeps the name of the removed definition,
8
+ and therefore its cascade position after `overflow`, so an axis utility still overrides the
9
+ shorthand that `overflow-*`, `truncate`, and `sr-only` write. Arbitrary properties stay as
10
+ written.
11
+ */
12
+
13
+ @stillwind-undef-utility overflow-x-*;
14
+ @stillwind-undef-utility overflow-y-*;
15
+
16
+ @stillwind-arbitrary-property overflow-inline;
17
+ @stillwind-arbitrary-property overflow-block;
18
+
19
+ @stillwind-utility overflow-x-auto (tw-sort: overflow-x) {
20
+ overflow-inline: auto;
21
+ }
22
+
23
+ @stillwind-utility overflow-x-clip (tw-sort: overflow-x) {
24
+ overflow-inline: clip;
25
+ }
26
+
27
+ @stillwind-utility overflow-x-hidden (tw-sort: overflow-x) {
28
+ overflow-inline: hidden;
29
+ }
30
+
31
+ @stillwind-utility overflow-x-scroll (tw-sort: overflow-x) {
32
+ overflow-inline: scroll;
33
+ }
34
+
35
+ @stillwind-utility overflow-x-visible (tw-sort: overflow-x) {
36
+ overflow-inline: visible;
37
+ }
38
+
39
+ @stillwind-utility overflow-y-auto (tw-sort: overflow-y) {
40
+ overflow-block: auto;
41
+ }
42
+
43
+ @stillwind-utility overflow-y-clip (tw-sort: overflow-y) {
44
+ overflow-block: clip;
45
+ }
46
+
47
+ @stillwind-utility overflow-y-hidden (tw-sort: overflow-y) {
48
+ overflow-block: hidden;
49
+ }
50
+
51
+ @stillwind-utility overflow-y-scroll (tw-sort: overflow-y) {
52
+ overflow-block: scroll;
53
+ }
54
+
55
+ @stillwind-utility overflow-y-visible (tw-sort: overflow-y) {
56
+ overflow-block: visible;
57
+ }
@@ -0,0 +1,40 @@
1
+ /*
2
+ Makes `overscroll-x-*` and `overscroll-y-*` write logical properties, as `px-*` and `py-*` write
3
+ `padding-inline` and `padding-block`. `stillwind` keeps the physical properties for Tailwind
4
+ CSS compatibility, so a project opts in by importing this file.
5
+
6
+ Import it after `stillwind` or `stillwind/builtins.css`, because an undefinition removes only
7
+ definitions that register before it. Each replacement keeps the name of the removed definition,
8
+ and therefore its cascade position after `overscroll-*`, so an axis utility still overrides the
9
+ shorthand. Arbitrary properties stay as written.
10
+ */
11
+
12
+ @stillwind-undef-utility overscroll-x-*;
13
+ @stillwind-undef-utility overscroll-y-*;
14
+
15
+ @stillwind-arbitrary-property overscroll-behavior-inline;
16
+ @stillwind-arbitrary-property overscroll-behavior-block;
17
+
18
+ @stillwind-utility overscroll-x-auto (tw-sort: overscroll-behavior-x) {
19
+ overscroll-behavior-inline: auto;
20
+ }
21
+
22
+ @stillwind-utility overscroll-x-contain (tw-sort: overscroll-behavior-x) {
23
+ overscroll-behavior-inline: contain;
24
+ }
25
+
26
+ @stillwind-utility overscroll-x-none (tw-sort: overscroll-behavior-x) {
27
+ overscroll-behavior-inline: none;
28
+ }
29
+
30
+ @stillwind-utility overscroll-y-auto (tw-sort: overscroll-behavior-y) {
31
+ overscroll-behavior-block: auto;
32
+ }
33
+
34
+ @stillwind-utility overscroll-y-contain (tw-sort: overscroll-behavior-y) {
35
+ overscroll-behavior-block: contain;
36
+ }
37
+
38
+ @stillwind-utility overscroll-y-none (tw-sort: overscroll-behavior-y) {
39
+ overscroll-behavior-block: none;
40
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ Makes `resize-x` and `resize-y` select the logical axes of `resize`. `stillwind` keeps the
3
+ physical axes for Tailwind CSS compatibility, so a project opts in by importing this file.
4
+
5
+ Import it after `stillwind` or `stillwind/builtins.css`, because an undefinition removes only
6
+ definitions that register before it. Each replacement keeps the name of the removed definition,
7
+ and therefore its cascade position.
8
+ */
9
+
10
+ @stillwind-undef-utility resize-x;
11
+ @stillwind-undef-utility resize-y;
12
+
13
+ @stillwind-utility resize-x {
14
+ resize: inline;
15
+ }
16
+
17
+ @stillwind-utility resize-y {
18
+ resize: block;
19
+ }
@@ -0,0 +1,20 @@
1
+ /*
2
+ Makes `snap-x` and `snap-y` select the logical axes of `scroll-snap-type`. `stillwind` keeps the
3
+ physical axes for Tailwind CSS compatibility, so a project opts in by importing this file.
4
+
5
+ Import it after `stillwind` or `stillwind/builtins.css`, because an undefinition removes only
6
+ definitions that register before it. Each replacement keeps the name of the removed definition,
7
+ and therefore its cascade position. `snap-mandatory` and `snap-proximity` keep working through
8
+ `--tw-scroll-snap-strictness`.
9
+ */
10
+
11
+ @stillwind-undef-utility snap-x;
12
+ @stillwind-undef-utility snap-y;
13
+
14
+ @stillwind-utility snap-x {
15
+ scroll-snap-type: inline var(--tw-scroll-snap-strictness);
16
+ }
17
+
18
+ @stillwind-utility snap-y {
19
+ scroll-snap-type: block var(--tw-scroll-snap-strictness);
20
+ }
@@ -83,7 +83,7 @@ around `@slot`.
83
83
  selector without `&` selects descendants:
84
84
  `@custom-variant expanded ([aria-expanded="true"])` means
85
85
  `& [aria-expanded="true"]`.
86
- [prefer-explicit-nesting-selector](../lints/prefer-explicit-nesting-selector.md)
86
+ [implicit-nesting-selector](../lints/implicit-nesting-selector.md)
87
87
  reports such a selector, and its fix writes the `&` without changing the
88
88
  meaning.
89
89
 
@@ -22,9 +22,8 @@ replaces the statement. Write it at the top level of the stylesheet.
22
22
  @plugin "@stillwind/plugin-iconify";
23
23
  ```
24
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.
25
+ [`@stillwind/plugin-iconify`](../plugins/iconify.md) adds icon utilities such as
26
+ `icon-mdi--close`. Only the icons that your modules use reach the stylesheet.
28
27
 
29
28
  ## Finding the plugin
30
29
 
@@ -80,6 +80,13 @@ source order. An undefinition removes only definitions that register before it:
80
80
  - It does not remove a `@utility` that comes after it, so you can remove a
81
81
  built-in utility and define your own utility with the same name.
82
82
 
83
+ A replacement with the same name keeps the cascade position of the removed
84
+ definition, so it wins against the same utilities as before. A definition with
85
+ another name takes the position where you write it. A definition without `*`
86
+ does not take the position of a removed `prefix-*` definition.
87
+ The [logical stylesheets](../concepts/stylesheets.md#logical-axis-utilities) replace
88
+ utilities in this way.
89
+
83
90
  Outside a block, the statement changes the `default`, `keyframe`, and
84
91
  `view-transition` registries.
85
92
 
@@ -276,7 +276,8 @@ export const icon = {className:"sw_smxmp"};
276
276
  ```
277
277
 
278
278
  Declarations that read the candidate through `--value()` or `--modifier()` are
279
- still checked.
279
+ still checked. The built-in `sr-only` and `not-sr-only` utilities also use this
280
+ descriptor.
280
281
 
281
282
  ## Conditions
282
283
 
package/docs/cli.md ADDED
@@ -0,0 +1,244 @@
1
+ ---
2
+ title: "CLI"
3
+ description: "Commands, options, file selection, exit codes, and output formats of the Stillwind CLI."
4
+ ---
5
+
6
+ # CLI
7
+
8
+ `@stillwind/cli` sorts utilities, reports lint findings, applies automatic fixes,
9
+ and starts the language server. It reads the same `stillwind.config.ts` as the
10
+ build integration and the editor.
11
+
12
+ ```sh
13
+ vp i -D @stillwind/cli
14
+ ```
15
+
16
+ To run the CLI in CI, see [Checks in the editor and CI](guides/lint-adoption.md).
17
+
18
+ ## Commands
19
+
20
+ | Command | Action |
21
+ | ---------------- | ---------------------------------------------------- |
22
+ | `stillwind fmt` | Sorts utilities |
23
+ | `stillwind lint` | Reports lint findings, and can apply automatic fixes |
24
+ | `stillwind lsp` | Starts the language server |
25
+
26
+ `stillwind --help` lists the commands, and `stillwind <command> --help` lists the
27
+ options of a command. `stillwind --version` prints the package version. The short
28
+ forms of these options are `-h` and `-v`.
29
+
30
+ ## stillwind fmt
31
+
32
+ ```sh
33
+ vp exec stillwind fmt
34
+ vp exec stillwind fmt --check
35
+ ```
36
+
37
+ `fmt` sorts utilities with the configured theme and
38
+ [`sort` options](configuration.md#sorting), and saves the changed files. It keeps
39
+ the source layout and the spelling of each token. Lint severity and suppression
40
+ comments do not affect `fmt`.
41
+
42
+ `fmt` does not change whitespace. To format whitespace too, see
43
+ [Formatters](formatters.md).
44
+
45
+ | Option | Effect |
46
+ | --------- | ------------------------------------------------------- |
47
+ | `--check` | Reports the files that need sorting, and saves no files |
48
+
49
+ `fmt` also accepts the [shared options](#shared-options) and
50
+ [globs](#select-files).
51
+
52
+ Text output shows a status for each listed file and a summary.
53
+
54
+ ## stillwind lint
55
+
56
+ ```sh
57
+ vp exec stillwind lint
58
+ vp exec stillwind lint --fix
59
+ vp exec stillwind lint --max-warnings 0
60
+ ```
61
+
62
+ `lint` reports findings and saves no files. Text output shows a `help:` message when
63
+ a finding has a suggested edit. Not every suggested edit is an automatic fix.
64
+
65
+ | Option | Effect |
66
+ | -------------------- | --------------------------------------------------------------------- |
67
+ | `--fix` | Applies the enabled automatic fixes, and saves the changed files |
68
+ | `--quiet` | Hides warnings, and keeps their count in the summary |
69
+ | `--max-warnings <n>` | Fails when the number of warnings exceeds `n`, a non-negative integer |
70
+
71
+ `lint` also accepts the [shared options](#shared-options) and
72
+ [globs](#select-files).
73
+
74
+ `--fix` respects suppression comments. It sorts utilities only when
75
+ [prefer-sorted-utilities](lints/prefer-sorted-utilities.md) is enabled. It
76
+ repeats until the files stop changing, with at most ten changing passes per file.
77
+ Findings and the exit code describe the files after the last pass.
78
+
79
+ `--max-warnings` counts distinct warnings in each project, including warnings that
80
+ `--quiet` hides. When hidden warnings exceed the limit, the CLI still prints the
81
+ reason for the failure.
82
+
83
+ ## stillwind lsp
84
+
85
+ ```sh
86
+ vp exec stillwind lsp --stdio
87
+ ```
88
+
89
+ `lsp` starts the [language server](editors.md#other-editors) over stdin and
90
+ stdout. `--stdio` is required, and stdout carries only protocol messages. `lsp`
91
+ accepts `--config`, but no globs.
92
+
93
+ ## Shared options
94
+
95
+ `fmt` and `lint` accept these options:
96
+
97
+ | Option | Effect |
98
+ | ----------------------- | --------------------------------------------------- |
99
+ | `-c`, `--config <path>` | Uses this [configuration file](#select-files) |
100
+ | `--format <format>` | Selects the [output format](#output-formats) |
101
+ | `--color <mode>` | Controls [colors](#colors-and-links) |
102
+ | `--hyperlinks <mode>` | Controls [links to source files](#colors-and-links) |
103
+
104
+ An unknown option, a missing value, or an unsupported value returns exit code `2`.
105
+
106
+ ## Select files
107
+
108
+ The CLI searches upward from the working directory for `stillwind.config.*`. In each
109
+ directory, it tries the extensions `ts`, `mts`, `cts`, `js`, `mjs`, `cjs`, and `json`
110
+ in that order. `--config` selects a file directly.
111
+
112
+ The CLI checks every file that `files` selects in each project, including files that
113
+ your application never imports. It can read other imported files for analysis, but
114
+ it does not change them.
115
+
116
+ Globs narrow this selection to some of these files. A glob is relative to each project
117
+ root, and it cannot add files outside `files`. You can pass several globs:
118
+
119
+ ```sh
120
+ vp exec stillwind lint 'src/**/*.tsx' 'src/**/*.css'
121
+ ```
122
+
123
+ A leading `./` is accepted. An absolute path selects that file when `files` includes
124
+ it. When nothing matches, the CLI returns exit code `2`.
125
+
126
+ ## Saving files
127
+
128
+ `fmt` and `lint --fix` work out the changes for all selected files before they save
129
+ the first file. The CLI then saves only the files whose content changed, so
130
+ modification times of other files stay the same.
131
+
132
+ Outside edited ranges, UTF-8 BOMs, line endings, and trailing newlines stay intact.
133
+ Files must contain valid UTF-8.
134
+
135
+ When something fails:
136
+
137
+ - A file that cannot be read, analyzed, or rewritten stays unchanged. The CLI
138
+ continues with the other files, even after a saving failure.
139
+ - A file that changed while the CLI worked is rejected and stays as it is.
140
+ - A configuration or CSS failure affects every file that needs that configuration
141
+ or CSS.
142
+ - When projects overlap, every project that owns a file must produce the same final
143
+ text.
144
+
145
+ The CLI reports all failures and all saved files, and it returns exit code `2`.
146
+
147
+ ## Exit codes
148
+
149
+ | Code | Meaning |
150
+ | ---- | ------------------------------------------------------------------------------------------------- |
151
+ | `0` | The command succeeded. `lint` may still report warnings when you set no `--max-warnings` limit |
152
+ | `1` | `fmt --check` found files to sort, `lint` found errors, or the warnings exceeded `--max-warnings` |
153
+ | `2` | The options were invalid, no files matched, or configuration, analysis, or file access failed |
154
+
155
+ Code `2` takes priority over code `1`.
156
+
157
+ ## Output formats
158
+
159
+ | Format | Output |
160
+ | -------- | ------------------------------------------------------------------------------------- |
161
+ | `text` | Messages for reading in a terminal; the default outside GitHub Actions |
162
+ | `github` | Annotations that link findings to files; the default when `GITHUB_ACTIONS=true` |
163
+ | `json` | [One JSON object](#json-output) for scripts and AI agents |
164
+ | `files` | One path per line for each file that `fmt` changes or needs to change; only for `fmt` |
165
+
166
+ Results use stdout, and execution failures in `text` and `files` formats use stderr.
167
+ Configuration logs use stderr in every format. Only `text` output contains colors
168
+ and links.
169
+
170
+ ### Positions and paths
171
+
172
+ `text` and `github` output count lines and columns from one. Columns count UTF-16
173
+ code units.
174
+
175
+ `text` paths are relative to the working directory. `github` paths are relative to
176
+ `GITHUB_WORKSPACE`, or to the working directory when that variable is not set.
177
+ A path on another filesystem volume stays absolute.
178
+
179
+ ### Source excerpts
180
+
181
+ A finding at a source range shows a source excerpt, related locations, notes, and
182
+ suggestions. Excerpts show tabs as four spaces, and they align wide characters and
183
+ emoji. A long range shows its first four lines.
184
+
185
+ A finding about a whole document has no position or excerpt. The CLI also omits the
186
+ excerpt when it cannot read the source, or when the source changed after the
187
+ analysis.
188
+
189
+ ## Colors and links
190
+
191
+ `--color` and `--hyperlinks` accept `auto`, `always`, and `never`. `always` and
192
+ `never` ignore the environment.
193
+
194
+ With `--color auto`, the CLI uses colors in terminals and supported CI logs. It
195
+ respects `NO_COLOR`, `FORCE_COLOR`, and `TERM=dumb`.
196
+
197
+ `--hyperlinks` controls OSC 8 links, which open local source files from the
198
+ terminal. With `auto`, the CLI uses them in recognized terminals, including VS Code
199
+ and Windows Terminal, and not in CI or redirected output. Terminals without OSC 8
200
+ support can still detect the printed `path:line:column` locations.
201
+
202
+ ## JSON output
203
+
204
+ `--format json` prints one object with the same fields in every case, including
205
+ failures:
206
+
207
+ ```json
208
+ {
209
+ "command": "lint",
210
+ "config": "/project/stillwind.config.ts",
211
+ "diagnostics": [],
212
+ "failures": [],
213
+ "changed": [],
214
+ "summary": {
215
+ "files": 1,
216
+ "errors": 0,
217
+ "warnings": 0,
218
+ "failures": 0,
219
+ "changed": 0,
220
+ "suggestions": 0,
221
+ "warningLimitExceeded": false
222
+ },
223
+ "exitCode": 0
224
+ }
225
+ ```
226
+
227
+ | Field | Value |
228
+ | ------------- | ---------------------------------------------------------------------------------- |
229
+ | `command` | `"fmt"` or `"lint"`, or `null` when the CLI failed before it selected a command |
230
+ | `config` | The configuration path, or `null` when the CLI failed before the analysis |
231
+ | `diagnostics` | The findings; `--quiet` removes warnings from this list |
232
+ | `failures` | The execution failures |
233
+ | `changed` | The files that the command changed; with `--check`, the files that it would change |
234
+ | `summary` | Counts for the fields above; `warnings` includes warnings that `--quiet` hides |
235
+ | `exitCode` | The [exit code](#exit-codes) |
236
+
237
+ Each diagnostic contains `project`, a zero-based project index, and `report`. The
238
+ report contains the message, its locations, notes, and suggested edits.
239
+
240
+ Each failure contains `message` and `details`, and it can contain `project` and
241
+ `file`. `details` lists the dependency problems that caused the failure.
242
+
243
+ File paths are absolute. Locations in reports use URIs and zero-based UTF-16
244
+ positions, and their ends are exclusive.
@@ -0,0 +1,89 @@
1
+ ---
2
+ title: "Stylesheets"
3
+ description: "See which CSS files the stillwind package provides, how to import them separately, and which optional files change built-in utilities."
4
+ ---
5
+
6
+ # Stylesheets
7
+
8
+ Most projects need one line:
9
+
10
+ ```css
11
+ @import "stillwind";
12
+ ```
13
+
14
+ This page lists the CSS files behind that import. Read it when you leave out part
15
+ of the default stylesheet or add an optional file.
16
+
17
+ ## Stylesheets of the package
18
+
19
+ | Import | Content |
20
+ | ------------------------- | -------------------------------------------------------- |
21
+ | `stillwind` | All of the files below except the optional ones |
22
+ | `stillwind/theme.css` | Theme tokens |
23
+ | `stillwind/preflight.css` | The reset of default element styles |
24
+ | `stillwind/utilities.css` | The slot where compiled utility rules go |
25
+ | `stillwind/builtins.css` | Built-in utilities and variants |
26
+ | `stillwind/templates.css` | Output templates of `style.css()` |
27
+ | `stillwind/logical/*.css` | Optional: logical properties for built-in axis utilities |
28
+
29
+ ## Import the files separately
30
+
31
+ `@import "stillwind"` has the same effect as these lines:
32
+
33
+ ```css
34
+ @layer properties, theme, base, components, utilities;
35
+
36
+ @import "stillwind/theme.css" layer(theme);
37
+ @import "stillwind/preflight.css" layer(base);
38
+ @import "stillwind/utilities.css" layer(utilities);
39
+ @import "stillwind/builtins.css";
40
+ @import "stillwind/templates.css";
41
+ ```
42
+
43
+ Write the `@layer` statement and keep the `layer()` assignments when you remove a
44
+ line. They decide how these files compete with the rest of your CSS. For example,
45
+ [Migrating from CSS](../guides/migrating-from-css.md) leaves out `preflight.css`
46
+ until the old styles are gone.
47
+
48
+ ## Optional stylesheets
49
+
50
+ An optional stylesheet changes built-in utilities, so `stillwind` does not include
51
+ it. The default definitions stay compatible with Tailwind CSS.
52
+
53
+ Import an optional stylesheet after `stillwind` or `stillwind/builtins.css`. It
54
+ replaces only the definitions that come before it:
55
+
56
+ ```css
57
+ @import "stillwind";
58
+ @import "stillwind/logical/overflow.css";
59
+ ```
60
+
61
+ ### Logical axis utilities
62
+
63
+ The files in `stillwind/logical/` make built-in axis utilities follow the writing
64
+ direction, as `px-*` and `py-*` do. Your class names stay the same, and each file
65
+ changes only its own utilities. Import the files that you need:
66
+
67
+ | File | Utility | Without the file | With the file |
68
+ | ---------------- | ---------------- | --------------------------------- | -------------------------------------------- |
69
+ | `overflow.css` | `overflow-x-*` | `overflow-x` | `overflow-inline` |
70
+ | `overflow.css` | `overflow-y-*` | `overflow-y` | `overflow-block` |
71
+ | `overscroll.css` | `overscroll-x-*` | `overscroll-behavior-x` | `overscroll-behavior-inline` |
72
+ | `overscroll.css` | `overscroll-y-*` | `overscroll-behavior-y` | `overscroll-behavior-block` |
73
+ | `divide.css` | `divide-y-*` | `border-top-*`, `border-bottom-*` | `border-block-start-*`, `border-block-end-*` |
74
+ | `snap.css` | `snap-x` | `scroll-snap-type: x` | `scroll-snap-type: inline` |
75
+ | `snap.css` | `snap-y` | `scroll-snap-type: y` | `scroll-snap-type: block` |
76
+ | `resize.css` | `resize-x` | `resize: horizontal` | `resize: inline` |
77
+ | `resize.css` | `resize-y` | `resize: vertical` | `resize: block` |
78
+
79
+ In a horizontal writing mode, the result is the same. In a vertical writing mode,
80
+ the utilities change axes, so `overflow-x-auto` scrolls vertically.
81
+
82
+ [prefer-logical-properties](../lints/prefer-logical-properties.md) does not report
83
+ the `overflow`, `overscroll`, and `divide` utilities after you import their files.
84
+ It still reports arbitrary properties such as `[overflow-x:auto]`, because these
85
+ files do not change them. Their logical forms, such as `[overflow-inline:auto]`,
86
+ are available.
87
+
88
+ The utilities keep their cascade order, so `overflow-x-auto` still overrides
89
+ `overflow-hidden`.