v0.3 Phase 2: build flag wiring
Wires VITE_LUMOTIA_QUIETWARE=1 to set <html data-design="quietware"> via a $effect in src/routes/+layout.svelte. Without the flag the runtime app behaves exactly as v0.2; with the flag the v0.3 token overrides in src/design-system/v0.3-quietware-tokens.css activate. Hot-reload safety: if the env var is unset between dev rebuilds, the attribute is cleared so devs do not see a stuck quietware surface. Activation paths: VITE_LUMOTIA_QUIETWARE=1 npm run dev (development) VITE_LUMOTIA_QUIETWARE=1 npm run build (production) Or manually via dev tools: <html data-design="quietware"> Combine with data-theme="light" (existing v0.2 theme wiring) and data-contrast="high" (existing v0.2 contrast wiring) to reach the light and high-contrast quietware modes. Smallest possible PR. No new dependencies. No bundle-size impact in the off path. No component changes. Plan doc updated to mark Phase 2 as landed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,22 @@
|
||||
$sveltePage.url.pathname.startsWith("/viewer") ||
|
||||
$sveltePage.url.pathname.startsWith("/preview")
|
||||
);
|
||||
|
||||
// v0.3 Tactile Quietware activation. When VITE_LUMOTIA_QUIETWARE=1
|
||||
// is set at build time, mark <html data-design="quietware"> so the
|
||||
// v0.3 token overrides in src/design-system/v0.3-quietware-tokens.css
|
||||
// become active. Without the flag the app behaves exactly as v0.2.
|
||||
// Combine with data-theme="light" and data-contrast="high" (already
|
||||
// wired elsewhere) for the light and high-contrast modes.
|
||||
$effect(() => {
|
||||
if (typeof document === "undefined") return;
|
||||
if (import.meta.env.VITE_LUMOTIA_QUIETWARE === "1") {
|
||||
document.documentElement.dataset.design = "quietware";
|
||||
} else if (document.documentElement.dataset.design === "quietware") {
|
||||
// Hot-reload safety: env var unset between dev rebuilds.
|
||||
delete document.documentElement.dataset.design;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<AppRuntime />
|
||||
|
||||
Reference in New Issue
Block a user