Files
XingfenD 5bb42a8b8a feat(web): add i18n, light/dark theme switching, and version constant
- Add i18n (English + 简体中文) with a locale store, $t() magic, and a language toggle (persisted)
- Add light/dark/system theme switching via a theme store and [data-theme] token overrides
- Set the theme before paint to avoid a flash of the wrong theme
- Add frontend version constant web/version.js (window.YDROPBX_VERSION) shown in the app footer
- Update AGENTS.md version-control convention to mention web/version.js
- Bump version to 0.1.1 across frontend, webui changelog, and backend constant
2026-08-27 15:21:21 +08:00

99 lines
2.3 KiB
CSS

:root {
/* ===== Color ===== */
--color-bg: #f4f5f7;
--color-bg-gradient: radial-gradient(1200px 600px at 50% -10%, #eef2ff 0%, var(--color-bg) 55%);
--color-surface: #ffffff;
--color-surface-hover: #fafbfc;
--color-border: #e6e8ec;
--color-border-strong: #d4d8df;
--color-text: #1a1d23;
--color-text-secondary: #6b7280;
--color-text-tertiary: #9aa1ad;
--color-primary: #2563eb;
--color-primary-hover: #1d4ed8;
--color-primary-soft: #eff6ff;
--color-danger: #ef4444;
--color-danger-hover: #dc2626;
--color-danger-soft: #fef2f2;
--color-success: #10b981;
/* Structural tokens */
--color-divider: #f3f4f6;
--color-toast-bg: #1a1d23;
--color-toast-fg: #ffffff;
color-scheme: light;
/* ===== Spacing (4px base) ===== */
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
--space-5: 1.25rem;
--space-6: 1.5rem;
--space-8: 2rem;
--space-10: 2.5rem;
--space-16: 4rem;
/* ===== Radius ===== */
--radius-sm: 6px;
--radius-md: 10px;
--radius-lg: 14px;
--radius-full: 9999px;
/* ===== Shadow ===== */
--shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
--shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
--shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.14);
/* ===== Typography ===== */
--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
--text-xs: 0.75rem;
--text-sm: 0.875rem;
--text-base: 1rem;
--text-lg: 1.125rem;
--text-xl: 1.25rem;
--text-2xl: 1.5rem;
/* ===== Motion ===== */
--transition-fast: 150ms ease;
--transition-base: 200ms ease;
--transition-slow: 300ms ease;
/* ===== z-index ===== */
--z-toast: 1000;
--z-modal: 1100;
}
/* ===== Dark theme ===== */
[data-theme="dark"] {
--color-bg: #0f1115;
--color-bg-gradient: radial-gradient(1200px 600px at 50% -10%, #1a2030 0%, var(--color-bg) 55%);
--color-surface: #171a21;
--color-surface-hover: #1e222b;
--color-border: #262b35;
--color-border-strong: #323844;
--color-text: #e6e8ec;
--color-text-secondary: #9aa1ad;
--color-text-tertiary: #6b7280;
--color-primary: #3b82f6;
--color-primary-hover: #2f6fe0;
--color-primary-soft: #16233f;
--color-danger: #f87171;
--color-danger-hover: #ef4444;
--color-danger-soft: #2a1717;
--color-divider: #23262f;
--color-toast-bg: #e6e8ec;
--color-toast-fg: #1a1d23;
color-scheme: dark;
}