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:
1 parent
ab7a10073b
commit
faecc76384
4 files changed
+277
-2
No files matched your search
@@ -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>({
|
||||
|
||||
Reference in new issue
Block a user