Site colours: saved swatches + live brand-colour tokens in design model

design.swatches [{id,label,hex,brand,slot}]; brand ones are published as
--wsb-brand-N appended inside :root (canvas and export share buildTokenVarDecls).
Sites without brand colours emit identical bytes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-01 09:49:53 -08:00
1 parent ab7a10073b
commit faecc76384
4 files changed
+277 -2

No files matched your search

+5
View File
@@ -1,4 +1,5 @@
import React, { createContext, useContext, useState, useCallback, ReactNode } from 'react';
import type { SavedSwatch } from '../utils/swatches';
export interface SiteDesign {
// Basic
@@ -27,6 +28,9 @@ export interface SiteDesign {
/** Site-wide favicon URL (one per site, not per-page). Empty string = none. */
favicon: string;
/** Site-wide saved colours (labelled hex). Those marked `brand` are published as live `--wsb-brand-N` tokens. */
swatches: SavedSwatch[];
}
export interface SiteDesignContextValue {
@@ -56,6 +60,7 @@ export const DEFAULT_SITE_DESIGN: SiteDesign = {
navStyle: 'light',
headCode: '',
favicon: '',
swatches: [],
};
const SiteDesignContext = createContext<SiteDesignContextValue>({