diff --git a/FRONTEND.md b/FRONTEND.md index 7c17762..a2613a4 100644 --- a/FRONTEND.md +++ b/FRONTEND.md @@ -86,14 +86,16 @@ en `Editor.tsx` (clases `.dock-*`). La estética es **glassmorphism claro/transparente con animaciones high-end**. No introducir un look nuevo sin pedirlo. -### Tokens de color (CSS vars en `globals.css`) -La paleta del restaurante es **configurable en runtime** vía estas variables — úsalas, -no hardcodees colores de marca: +### Tokens de color (CSS vars en `globals.css`) — FIJOS (paleta retirada) +Los colores son **fijos** (hardcodeados del mockup); ya **no** se configuran por +restaurante. Definidos en `:root` (`globals.css`) y forzados por `paletteToCssVars()` +(que ignora la paleta guardada). Úsalos vía `var(--…)`: ``` ---bg, --bg-2 fondos --surface cristal ---accent acento --text texto --tab píldoras +--bg #ffffff --bg-2 #ffffff --surface rgba(255,255,255,.55) +--accent #dc2626 (rojo) --text #2a2520 --tab rgba(255,255,255,.45) ``` +> La sección de Paleta del editor se eliminará por completo (lo hará el dueño del repo). > **Acción primaria = rojo `#dc2626` hardcodeado** (rediseño): botones "Agregar a mi > orden", FAB "Orden", CTA de la landing, "Guardar y publicar", login, etc. NO usan diff --git a/src/app/globals.css b/src/app/globals.css index c3ff0f8..13a5f9d 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -3,11 +3,12 @@ @tailwind utilities; :root { - /* Default restaurant palette (overridden per-restaurant at runtime). */ - --bg: #f4f1ec; - --bg-2: #e9e3da; + /* Fixed brand palette — hardcoded from the design mockups. The per-restaurant + palette feature is being retired, so these are no longer overridden at runtime. */ + --bg: #ffffff; + --bg-2: #ffffff; --surface: rgba(255, 255, 255, 0.55); - --accent: #b45309; + --accent: #dc2626; --text: #2a2520; --tab: rgba(255, 255, 255, 0.45); } diff --git a/src/lib/palette.ts b/src/lib/palette.ts index b8e86c3..eab5e4e 100644 --- a/src/lib/palette.ts +++ b/src/lib/palette.ts @@ -29,33 +29,19 @@ export const PALETTE_PRESETS: { id: string; label: string; palette: Palette }[] }, ]; -const DEFAULT = PALETTE_PRESETS[0].palette; +// FIXED brand palette — the per-restaurant palette feature is being retired, so +// these colors are hardcoded from the approved design mockups and the argument is +// ignored. Emitted into :root (public) and [data-editor-root] (editor). +const FIXED_VARS = + '--bg:#ffffff;' + + '--bg-2:#ffffff;' + + '--surface:rgba(255,255,255,0.55);' + + '--accent:#dc2626;' + + '--text:#2a2520;' + + '--tab:rgba(255,255,255,0.45);'; -// Build a CSS variable string from a palette, deriving a darker bottom gradient. -export function paletteToCssVars(palette?: Palette): string { - const p = { ...DEFAULT, ...(palette ?? {}) }; - return [ - `--bg:${p.background};`, - `--bg-2:${shade(p.background!, -8)};`, - `--surface:${p.surface};`, - `--accent:${p.accent};`, - `--text:${p.text};`, - `--tab:${p.tab};`, - ].join(''); -} - -// Lighten/darken a hex color by a percentage (-100..100). -function shade(hex: string, percent: number): string { - const m = hex.replace('#', ''); - if (m.length !== 6) return hex; - const num = parseInt(m, 16); - const amt = Math.round(2.55 * percent); - const r = clamp((num >> 16) + amt); - const g = clamp(((num >> 8) & 0xff) + amt); - const b = clamp((num & 0xff) + amt); - return `#${((r << 16) | (g << 8) | b).toString(16).padStart(6, '0')}`; -} - -function clamp(v: number): number { - return Math.max(0, Math.min(255, v)); +// Kept for signature compatibility with the pages that still call it; the passed +// palette is intentionally ignored now that colors are fixed. +export function paletteToCssVars(_palette?: Palette): string { + return FIXED_VARS; }