feat(theme): let the merchant choose the form color scheme
PAGE_CSS carried an unconditional `@media (prefers-color-scheme: dark)` block that redefined --bg, --surface, --text and --border. The merchant theme override only sets accent, button and typography tokens, so a visitor whose OS is in dark mode saw a dark card with the merchant's button colour on it, and no setting could change that. The form is rendered in a modal on top of the shop theme, which the app cannot read and which is almost always light. Move the dark palette out of PAGE_CSS into DARK_VARS and let renderShell apply it according to a new "themeScheme" setting: light (default), dark, or auto (follows prefers-color-scheme, the previous behaviour). The cascade is now base light palette -> chosen scheme -> merchant override, so custom accent and button colours win under either scheme. `color-scheme` and its meta tag follow the same setting, which keeps the native controls consistent. Existing rows have themeScheme NULL and fall back to the light default. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mv83a29B4eFv5ixoj6PoE1
This commit is contained in:
@@ -76,6 +76,8 @@ model Settings {
|
||||
themeRadius Int?
|
||||
themeFont String?
|
||||
themeWidth Int?
|
||||
// "light" | "dark" | "auto". NULL = default applicativo (light).
|
||||
themeScheme String?
|
||||
themeCustomCss String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
Reference in New Issue
Block a user