fix: theme toggle

This commit is contained in:
ghost2023
2026-08-10 11:52:03 +03:00
parent 84081156f6
commit 10af12bfc6
18 changed files with 47 additions and 341 deletions

View File

@@ -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