Skip to content

Commit ecdb393

Browse files
itspradecursoragent
andcommitted
feat(theme): explicit accent tiers, palette template, and appearance icons
Organise palette CSS into numbered tiers (Brand → Shell → Derived → System → Palette → Semantic → Structural) with `_template.css` as the new-palette checklist. Set explicit `--accent` per palette and mode for reliable sidebar/menu selection. Add `--alert-*` tokens to default palette CSS. Replace AppearanceSwitcher menu swatches with Sun/Moon/Monitor icons. Add Color demo page and styling-theming docs for palette authoring. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c1501c8 commit ecdb393

11 files changed

Lines changed: 678 additions & 117 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tailor-platform/app-shell": patch
3+
---
4+
5+
Update `AppearanceSwitcher` menu options to use Sun, Moon, and Monitor icons instead of color swatches for light, dark, and system modes.

.changeset/theme-token-tiers.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tailor-platform/app-shell": patch
3+
---
4+
5+
Set explicit `--accent` values per palette and mode, reorganise palette CSS into numbered tiers with a `_template.css` authoring guide, and add `--alert-*` semantic tokens to the default palette.

docs/concepts/styling-theming.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,21 @@ These properties are defined in `:root` and can be overridden in your own CSS:
6060
--z-popup: 100;
6161
}
6262
```
63+
64+
## Adding a palette
65+
66+
Theme tokens live in `packages/core/src/assets/themes/`. Copy `_template.css` to start a new palette — it lists exactly which sections to fill in for light and dark mode.
67+
68+
| Section | Required? | What to set |
69+
| --------------------- | --------------------- | ------------------------------------------------------------- |
70+
| **1. Brand** | Yes | `primary`, `secondary`, `accent` (+ foregrounds) — both modes |
71+
| **2. Shell gradient** | Branded palettes only | `--shell-gradient-base`, `--shell-gradient-tint` |
72+
| **3. Derived** | Copy verbatim | Ring, sidebar aliases, gradient stops — do not edit |
73+
| **4. System** | Tune or copy default | Surfaces: background, card, popover, muted, borders |
74+
| **5. Palette** | Optional | Radius, chart colors, shadows |
75+
| **6. Semantic** | Do not duplicate | Status and alert tokens inherit from `default.css` |
76+
| **7. Structural** | Branded palettes | Copy `@layer` blocks from `bloom.css` for gradient shell |
77+
78+
Then `@import` the new file in `theme.css` and set `defaultThemePalette` on `<AppShell />`.
79+
80+
Preview token values at `/custom-page/color` in the Next.js example app.

examples/nextjs-app/src/modules/custom-module.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { dropdownComponentsDemoResource } from "./pages/dropdown-demo";
2121
import { formComponentsDemoResource, zodRHFFormDemoResource } from "./pages/form-demo";
2222
import { csvImporterDemoResource } from "./pages/csv-importer-demo";
2323
import { dataTableDemoResource } from "./pages/data-table-demo";
24+
import { colorDemoResource } from "./pages/color-demo";
2425

2526
export const customPageModule = defineModule({
2627
path: "custom-page",
@@ -40,6 +41,17 @@ export const customPageModule = defineModule({
4041
<p>
4142
<Link to="/custom-page/sub1/sub1-1/123">{t("goToDynamicPage")}</Link>
4243
</p>
44+
<p>
45+
<Link
46+
to="/custom-page/color"
47+
style={{
48+
color: "hsl(var(--primary))",
49+
textDecoration: "underline",
50+
}}
51+
>
52+
Color tokens (swatches & layers)
53+
</Link>
54+
</p>
4355
<p>
4456
<Link
4557
to="/custom-page/purchase-order-demo"
@@ -217,6 +229,7 @@ export const customPageModule = defineModule({
217229
subPageResource,
218230
hiddenResource,
219231
adminOnlyResource,
232+
colorDemoResource,
220233
purchaseOrderDemoResource,
221234
actionPanelDemoResource,
222235
metricCardDemoResource,

0 commit comments

Comments
 (0)