// Design tokens: colours, radii, spacing, type sizes. Components and screens // use these instead of literal values, so the theme and the font scale can // change while the app runs (Rust sets `mode` and `font-scale` from the // settings `ui.theme` and `ui.font_scale`). // // The software renderer draws no drop shadows and no gradient window // background, so "glow" is a translucent accent ring (`glow`, `glow-width`) // and the backdrop gradient is a rectangle (`backdrop`). import { Palette } from "std-widgets.slint"; export global Theme { // "dark", "light" or "system" (the setting `ui.theme`; Rust sets it // right after the window is created, "" until then). in-out property mode: ""; // The system's scheme when the window was created (see MainWindow). in-out property system-dark: true; // Dark or light colours. The standard widgets (scroll bars, context // menus) follow through `Palette.color-scheme`, set by MainWindow. out property dark: mode == "system" ? Palette.color-scheme == ColorScheme.dark || (Palette.color-scheme == ColorScheme.unknown && system-dark) : mode != "light"; // Multiplies every type size (and the sizes that follow text). in-out property font-scale: 1.0; // Backgrounds, from the window outwards in. out property bg-app: dark ? #060a18 : #e9eef9; out property backdrop: dark ? @linear-gradient(160deg, #0a1230 0%, #060a18 55%, #0a1638 100%) : @linear-gradient(160deg, #f4f7fd 0%, #e6ecf8 60%, #dde6f7 100%); // The server rail, the far left. out property bg-rail: dark ? #070c1d : #dfe6f4; // Panels: sidebar, main area, right panel. out property surface: dark ? #0b1330 : #f7f9fe; // Cards and inputs inside panels. out property surface-2: dark ? #101a3c : #ffffff; // Raised: hovered rows, menus, popups. out property surface-3: dark ? #16224b : #eaf0fb; // Pressed or strongly highlighted. out property surface-4: dark ? #1c2b5c : #dce5f7; // Dimmed backdrop behind modals. out property scrim: dark ? #02050fc0 : #0b132b80; // A lighter dim behind pop-ups: the member card, emoji picker, bell. out property scrim-light: dark ? #02050f73 : #0b132b33; // Translucent bar over video. out property overlay: dark ? #060a18c8 : #0b1330b0; out property border: dark ? #1b2750 : #d3dcee; out property border-strong: dark ? #2a3a6e : #b9c6e2; // The edge of pop-ups, menus and tooltips, which lie over surfaces of // about their own colour. out property border-popup: dark ? #3d5296 : #9fb0d4; // Accent (buttons, selection, links). out property accent: dark ? #2d6bff : #2458e6; out property accent-hover: dark ? #4a82ff : #3a6cf0; out property accent-pressed: dark ? #1f55d9 : #1b47c0; // Selected rows and chips. out property accent-soft: dark ? #18348a : #d6e2ff; out property accent-soft-hover: dark ? #1d3d9c : #c8d8ff; // Links, "See All", highlighted names. out property accent-text: dark ? #5c9dff : #1d4fd6; // Author names in chat. out property name-text: dark ? #45b9ff : #0f6cc4; out property on-accent: #ffffff; // The ring around focused and selected items. out property glow: dark ? #3f7bff90 : #2458e660; out property glow-width: 2px; // States. out property live: dark ? #ff2d55 : #e0203f; out property live-soft: dark ? #3a0f22 : #ffe0e6; out property danger: dark ? #ff4d5e : #d92c3c; out property danger-soft: dark ? #3b1020 : #ffe3e6; out property success: dark ? #22d36b : #16a557; out property success-soft: dark ? #0d3326 : #d7f5e4; out property warning: dark ? #f5b301 : #b77f00; out property warning-soft: dark ? #3a2a06 : #fff0c8; out property idle: dark ? #f5b301 : #c98b00; out property dnd: dark ? #ff4d5e : #d92c3c; out property offline: dark ? #5f6d93 : #8d99b5; out property gold: dark ? #ffc233 : #d99a00; out property info: dark ? #3fb3ff : #1180d6; // Text. out property text: dark ? #eef2ff : #0e1733; out property text-secondary: dark ? #aeb9d8 : #43506f; out property text-muted: dark ? #6d7ca6 : #6f7b98; out property text-disabled: dark ? #46527a : #a7b1c8; // Icons without their own colour. out property icon: dark ? #b9c4e2 : #43506f; // Audio meter segments. out property meter-low: #21d07a; out property meter-mid: #f5d000; out property meter-high: #ff4d5e; out property meter-off: dark ? #1a2550 : #d5ddef; // Radii. out property radius-xs: 4px; out property radius-sm: 6px; out property radius-md: 8px; out property radius-lg: 12px; out property radius-xl: 16px; out property radius-pill: 999px; // Spacing scale. out property space-1: 2px; out property space-2: 4px; out property space-3: 8px; out property space-4: 12px; out property space-5: 16px; out property space-6: 20px; out property space-7: 24px; out property space-8: 32px; // Type sizes (scaled). out property font-xs: 11px * font-scale; out property font-sm: 12px * font-scale; out property font-body: 14px * font-scale; out property font-md: 15px * font-scale; out property font-lg: 17px * font-scale; out property font-xl: 20px * font-scale; out property font-2xl: 24px * font-scale; out property font-3xl: 30px * font-scale; out property weight-regular: 400; out property weight-medium: 500; out property weight-semibold: 600; out property weight-bold: 700; out property font-family: "Inter"; // Sizes that follow the text. out property row-height: 32px * font-scale; out property control-height: 36px * font-scale; out property control-height-sm: 28px * font-scale; out property icon-sm: 16px; out property icon-md: 20px; out property icon-lg: 24px; // Shell dimensions. out property rail-width: 72px; out property sidebar-width: 264px * max(1.0, font-scale); // Taller only when large text makes the controls in it taller. out property topbar-height: max(44px, control-height + space-3); out property right-panel-min: 220px; // Motion. out property fast: 120ms; out property normal: 200ms; }