mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 05:25:41 +00:00
fix: theme toggle
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
@import "tailwindcss";
|
||||
@import "@edr/ui-common/theme.css" layer(theme);
|
||||
|
||||
/* The app toggles dark mode by setting the `dark` class on <html> (see
|
||||
main.tsx / FreightDashboardLayout). Without this, Tailwind v4 compiles
|
||||
`dark:` utilities to `@media (prefers-color-scheme: dark)` and they follow
|
||||
the OS setting instead of the in-app toggle. */
|
||||
@custom-variant dark (&:where(.dark, .dark *));
|
||||
/* The backoffice is light-only — there is no theme toggle and nothing sets the
|
||||
`dark` class. This override is load-bearing: without it Tailwind v4 compiles
|
||||
`dark:` utilities to `@media (prefers-color-scheme: dark)`, so every
|
||||
leftover `dark:` class (the vendored IAM UI is full of them) would activate
|
||||
on an OS-level dark setting. Binding the variant to a class that is never
|
||||
rendered keeps those utilities inert no matter what the OS says. */
|
||||
@custom-variant dark (&:where(.edr-dark-disabled));
|
||||
|
||||
/* Bridge the central Mantine theme into Tailwind. freightMantineTheme
|
||||
(createTheme) is the single source of truth; these just alias its generated
|
||||
|
||||
Reference in New Issue
Block a user