docs: update CLAUDE.md CSS section for build.rs integration
Replace the manual dev workflow instructions with documentation of
the automatic build.rs Tailwind pipeline added in 33c27ed.
This commit is contained in:
parent
d2a3ee190b
commit
70cbb76c3e
1 changed files with 12 additions and 7 deletions
19
CLAUDE.md
19
CLAUDE.md
|
|
@ -376,20 +376,25 @@ There is no `tower-http` static file serving — all assets are embedded at comp
|
||||||
The UI uses **Tailwind CSS v4** built via the standalone CLI (no Node.js required). The Nix flake provides `tailwindcss_4` in both the devShell and the package `preBuild`.
|
The UI uses **Tailwind CSS v4** built via the standalone CLI (no Node.js required). The Nix flake provides `tailwindcss_4` in both the devShell and the package `preBuild`.
|
||||||
|
|
||||||
**Source file**: `templates/input.css` — the single source of truth for all styles.
|
**Source file**: `templates/input.css` — the single source of truth for all styles.
|
||||||
**Generated file**: `templates/styles.css` — gitignored, built by Tailwind CLI.
|
**Generated file**: `templates/styles.css` — gitignored, built automatically by `build.rs`.
|
||||||
|
|
||||||
#### Dev workflow
|
#### Build integration
|
||||||
|
|
||||||
|
`build.rs` runs `tailwindcss` automatically during `cargo build`. It watches all files under `templates/` and re-runs when any change. Release builds pass `--minify`. If `tailwindcss` is not found on `PATH`, the build prints a warning but continues (useful for CI without the CLI installed).
|
||||||
|
|
||||||
|
There is **no need to run `tailwindcss` manually** — `cargo build` / `cargo run` handles it. You can still run it directly for validation or to check output without a full Rust compile:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tailwindcss -i templates/input.css -o templates/styles.css
|
||||||
|
```
|
||||||
|
|
||||||
|
For continuous CSS-only iteration, the `--watch` flag is useful alongside `cargo watch`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
tailwindcss -i templates/input.css -o templates/styles.css --watch # terminal 1
|
tailwindcss -i templates/input.css -o templates/styles.css --watch # terminal 1
|
||||||
cargo watch -x run # terminal 2
|
cargo watch -x run # terminal 2
|
||||||
```
|
```
|
||||||
|
|
||||||
After any template or CSS change, regenerate with:
|
|
||||||
```bash
|
|
||||||
tailwindcss -i templates/input.css -o templates/styles.css
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Design Tokens
|
#### Design Tokens
|
||||||
|
|
||||||
Colors are defined as raw CSS custom properties in `:root` (light) and `[data-theme="dark"]` (dark), then mapped to Tailwind utilities via `@theme`:
|
Colors are defined as raw CSS custom properties in `:root` (light) and `[data-theme="dark"]` (dark), then mapped to Tailwind utilities via `@theme`:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue