Skip to content

Commit 109c9e1

Browse files
committed
Add instruction on use of theme colors
1 parent a9d6d2c commit 109c9e1

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
applyTo: "**"
3+
---
4+
5+
# Theme color token policy
6+
7+
The source of truth for **all** colors in this repo is:
8+
- `src/styles/theme-inline.css`
9+
10+
## Rules
11+
12+
- Only use colors that are defined as `--color-*` tokens in `src/styles/theme-inline.css`.
13+
- Do not use Tailwind default palette classes (e.g., `bg-gray-100`, `text-blue-600`, `border-red-500`) unless the corresponding `--color-...` token exists in `src/styles/theme-inline.css`.
14+
- When using Tailwind color utilities, the color name must match a defined token in `src/styles/theme-inline.css`. This includes (non-exhaustive):
15+
- `text-*`, `bg-*`, `border-*`, `ring-*`, `outline-*`, `decoration-*`
16+
- `fill-*`, `stroke-*`
17+
- gradient tokens: `from-*`, `via-*`, `to-*`
18+
- When using CSS variables, only reference `var(--color-...)` tokens that are defined in `src/styles/theme-inline.css`.
19+
20+
## Permission required
21+
22+
- If a future change requires a new color token (a new `--color-*` or a new Tailwind color utility name that would require adding a token), **stop and ask for explicit permission before adding it**.

0 commit comments

Comments
 (0)