EnergyVenom's picture
Deploy frontend-polish ee6bdce: design tokens, shared components, Ask as a page
bcc4b86 verified
Raw History Blame Contribute Delete
6.55 kB
/* beUI / shadcn layer, merged with the app's own design tokens (apple.css). Loaded after the Mantine and app styles.
*
* - Tailwind CSS 4: theme and utilities only. Its base reset (preflight) is NOT loaded: Mantine styles the base
* elements and a second reset would change every existing screen.
* - Dark mode follows Mantine's colour scheme (data-mantine-color-scheme on <html>), not a .dark class.
* - Colours point at the app's tokens, so beUI components look like the rest of Trio (graphite, not beUI's cyan).
* The app's own --accent (graphite action colour) is NOT redefined: shadcn's "accent" (a subtle hover surface) maps
* to --fill instead, through the Tailwind colour token only.
*/
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/utilities.css" layer(utilities) source(none);
/* Tailwind generates classes only from these files: the beUI components and the screens converted to them. Scanning
the whole app would turn existing class names (e.g. "hidden", "border") into Tailwind utilities and restyle screens. */
@source "./components/ui";
@source "./components/three";
@source "./pages/LoginPage.tsx";
@source "./pages/login";
@source "./pages/AuthShell.tsx";
@source "./pages/RegisterPage.tsx";
@source "./pages/PasswordPages.tsx";
@custom-variant dark (&:where([data-mantine-color-scheme="dark"], [data-mantine-color-scheme="dark"] *));
/* shadcn variable names beUI components may read directly, defined from the app's tokens (light and dark follow
automatically, because the app's tokens switch with the colour scheme). */
:root {
--background: var(--bg);
--foreground: var(--label);
--card: var(--bg-elev);
--card-foreground: var(--label);
--popover: var(--bg-elev);
--popover-foreground: var(--label);
--primary: var(--accent);
--primary-foreground: var(--on-accent);
--secondary: var(--fill);
--secondary-foreground: var(--label);
--muted: var(--fill);
--muted-foreground: var(--label-2);
--border: var(--sep);
--border-strong: var(--sep-strong);
--input: var(--sep-strong);
--danger: var(--red);
--destructive: var(--red);
--success: var(--green);
--warning: var(--orange);
--accent-fg: var(--on-accent);
--radius: var(--r-md);
}
@theme inline {
--color-background: var(--bg);
--color-foreground: var(--label);
--color-card: var(--bg-elev);
--color-card-foreground: var(--label);
--color-popover: var(--bg-elev);
--color-popover-foreground: var(--label);
--color-primary: var(--accent);
--color-primary-foreground: var(--on-accent);
--color-secondary: var(--fill);
--color-secondary-foreground: var(--label);
--color-muted: var(--fill);
--color-muted-foreground: var(--label-2);
--color-accent: var(--fill);
--color-accent-foreground: var(--label);
--color-destructive: var(--red);
--color-danger: var(--red);
--color-success: var(--green);
--color-warning: var(--orange);
--color-border: var(--sep);
--color-border-strong: var(--sep-strong);
--color-input: var(--sep-strong);
--color-ring: var(--accent);
/* shape, type, weight and shadow utilities resolve to the app's tokens (tokens.css), so `rounded-lg`, `text-sm` or
`font-semibold` mean the same thing in a beUI part as in the rest of the app. Tailwind's own spacing unit (4px)
and breakpoints (640 / 768 / 1024 / 1280 / 1536) already match the tokens. */
--radius-sm: var(--r-sm);
--radius-md: var(--r-md);
--radius-lg: var(--r-lg);
--radius-xl: var(--r-xl);
--radius-2xl: var(--r-xl);
--text-2xs: var(--fs-2xs); --text-2xs--line-height: var(--lh-2xs);
--text-xs: var(--fs-xs); --text-xs--line-height: var(--lh-xs);
--text-sm: var(--fs-sm); --text-sm--line-height: var(--lh-sm);
--text-base: var(--fs-base); --text-base--line-height: var(--lh-base);
--text-md: var(--fs-md); --text-md--line-height: var(--lh-md);
--text-lg: var(--fs-lg); --text-lg--line-height: var(--lh-lg);
--text-xl: var(--fs-xl); --text-xl--line-height: var(--lh-xl);
--text-2xl: var(--fs-2xl); --text-2xl--line-height: var(--lh-2xl);
--text-3xl: var(--fs-3xl); --text-3xl--line-height: var(--lh-3xl);
--text-4xl: var(--fs-4xl); --text-4xl--line-height: var(--lh-4xl);
--text-display: var(--fs-display); --text-display--line-height: var(--lh-display);
--font-weight-normal: var(--fw-regular);
--font-weight-medium: var(--fw-medium);
--font-weight-semibold: var(--fw-semibold);
--font-weight-bold: var(--fw-bold);
--tracking-tight: var(--ls-title);
--tracking-tighter: var(--ls-display);
--shadow-card: var(--sh-card);
--shadow-pop: var(--sh-pop);
--font-sans: var(--font);
--font-mono: var(--mono);
--ease-out: var(--ease);
--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}
/* Motion is functional, never decorative: with reduced motion requested, animated beUI parts appear without movement. */
@media (prefers-reduced-motion: reduce) {
.beui-motion, .beui-motion * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
/* The app draws a global :focus-visible outline. A beUI field already shows its focus ring on the rounded field
around the input, so the inner input does not draw a second one (the ring stays visible). */
.beui-field input:focus-visible { outline: none; box-shadow: none; }
/* A region that is dark whatever the app's theme (the sign-in hero). The app's dark tokens, and the shadcn names
re-declared here so beUI parts inside resolve them locally (a variable defined on :root keeps :root's value). */
.trio-force-dark {
color-scheme: dark;
--bg: #1c1c1e; --bg-elev: #2a2a2d; --bg-elev-2: #313134;
--fill: rgba(235, 235, 245, 0.10); --fill-2: rgba(235, 235, 245, 0.16);
--sep: rgba(235, 235, 245, 0.13); --sep-strong: rgba(235, 235, 245, 0.26);
--label: #f5f5f7; --label-2: #b4b4b9; --label-3: #98989d;
--accent: #f5f5f7; --on-accent: #1d1d1f; --focus: #f5f5f7; --focus-gap: #1c1c1e;
--green: #30d158; --orange: #ff9f0a; --red: #ff7a72;
--background: var(--bg); --foreground: var(--label); --card: var(--bg-elev); --card-foreground: var(--label);
--primary: var(--accent); --primary-foreground: var(--on-accent); --muted: var(--fill); --muted-foreground: var(--label-2);
--border: var(--sep); --border-strong: var(--sep-strong); --input: var(--sep-strong);
--danger: var(--red); --destructive: var(--red); --success: var(--green); --warning: var(--orange);
color: var(--label);
}