Skip to content

Latest commit

 

History

History
125 lines (110 loc) · 6.42 KB

DESIGN.md

File metadata and controls

125 lines (110 loc) · 6.42 KB
version 1.0
name GuEarth Design System
description Monochrome ChatGPT-inspired visual language built on Base UI (@base-ui/react), Tailwind CSS v4, and Lucide icons. UI panels float over the 3D CesiumJS viewport with crisp neutral contrast in both Light and Dark themes.
colors
light dark
background surface elevated canvas subtle primary primary-hover primary-active primary-foreground muted ink ink-secondary ink-tertiary ink-disabled hairline border-strong hover-fill active-fill destructive warning success info
#ffffff
#ffffff
#ffffff
#f9f9f9
#f9f9f9
#0d0d0d
#262626
#000000
#ffffff
#f3f3f3
#0d0d0d
#5d5d5d
#8f8f8f
rgba(13, 13, 13, 0.28)
rgba(0, 0, 0, 0.08)
rgba(0, 0, 0, 0.14)
rgba(0, 0, 0, 0.045)
rgba(0, 0, 0, 0.07)
#dc2626
#d97706
#16a34a
#2563eb
background surface elevated canvas subtle primary primary-hover primary-active primary-foreground muted ink ink-secondary ink-tertiary ink-disabled hairline border-strong hover-fill active-fill destructive warning success info
#171717
#171717
#212121
#141414
#141414
#ffffff
#e5e5e5
#d4d4d4
#0d0d0d
#2a2a2a
#ececec
#b4b4b4
#7a7a7a
rgba(255, 255, 255, 0.28)
rgba(255, 255, 255, 0.09)
rgba(255, 255, 255, 0.16)
rgba(255, 255, 255, 0.06)
rgba(255, 255, 255, 0.11)
#ef4444
#f59e0b
#22c55e
#60a5fa
typography
heading-lg heading-sm body-md body-sm code-md
fontSize fontWeight lineHeight
20px
600
28px
fontSize fontWeight lineHeight
15px
600
22px
fontSize fontWeight lineHeight
14px
400
22px
fontSize fontWeight lineHeight
12px
400
20px
fontSize fontWeight lineHeight
13px
400
20px
rounded
sm md lg xl full
6px
8px
12px
16px
9999px
spacing
xxs xs sm md lg xl
4px
8px
12px
16px
20px
24px

GuEarth Design System

Overview

GuEarth is a desktop "digital earth" for geography teaching. Its interface floats over a full-screen 3D CesiumJS globe like calm, modern monochrome instruments — inspired by ChatGPT's restrained black-and-white aesthetic. The 3D terrain and scientific geography overlays are the visual focus; UI chrome stays quiet, crisp, and neutral.

The UI layer is built on Base UI (@base-ui/react), Tailwind CSS v4, class-variance-authority, CSS Modules, and lucide-react icons. All interactive primitives live in src/renderer/src/components/ui/ and are consumed consistently across the globe shell, drawers, settings, teaching lab panels, and EOQ assistant.

Dual Theme Architecture

GuEarth supports three theme modes persisted in settings.json (themeMode: 'light' | 'dark' | 'system', default 'light'):

  • Light (default): pure white surfaces (#ffffff), subtle #f9f9f9 secondary backgrounds, #0d0d0d primary ink & buttons.
  • Dark: charcoal #171717 surfaces, #212121 elevated popups, #ececec primary ink, #ffffff primary buttons with #0d0d0d text.
  • System: follows OS prefers-color-scheme and syncs Electron nativeTheme.themeSource.

The active resolved theme toggles .dark on document.documentElement. All CSS Modules and Base UI primitives consume CSS variables (var(--surface), var(--elevated), var(--subtle), var(--muted), var(--ink), var(--ink-secondary), var(--ink-tertiary), var(--hairline), var(--border-strong), var(--primary), var(--primary-foreground), var(--hover-fill), var(--active-fill), var(--shadow-panel), var(--shadow-popup), var(--shadow-dialog)).

Scientific Color Boundary

UI chrome is strictly monochrome. Semantic colors appear only in two places:

  1. Status feedback: --destructive (errors, destructive confirmations), --warning (degraded terrain/cache notices, unsaved changes, mirror fallbacks), --success (verified credentials, active mirror acceleration, saved indicators), and --info (active toggles, in-progress states, live informational notices) — always paired with text or icons. Passive helper notices (Alert type="neutral") and static category tags (Tag tone="neutral") stay monochrome.
  2. Scientific geography encodings: Cesium thematic layers, legends, SVG physics diagrams (diagramTheme.ts), and ECharts data series (warm/cold fronts, ocean currents, Köppen zones, SST anomalies, elevation/population ramps, age pyramids). Neutral diagram axes, strokes, gridlines, and ECharts tooltips adapt dynamically to Light and Dark themes.

Base UI Primitives (src/renderer/src/components/ui/)

  • Root setup: main.tsx wraps <App /> with CSPProvider disableStyleElements (for strict Electron CSP), TooltipProvider, ToastProvider, and ConfirmDialogProvider. #app uses isolation: isolate and body uses position: relative so Base UI portals stack cleanly above the Cesium canvas.
  • Non-modal drawers: Drawer uses Base UI Dialog with modal={false} and disablePointerDismissal so the 3D globe remains interactive while Layer, Annotation, Bookmarks, or EOQ drawers are open.
  • Buttons: Button supports variant (primary | default | ghost | dashed | link), size (sm | md | lg), shape (default | circle), danger, block, loading, and icon. Every <Button loading={...}> MUST pass its icon via the icon prop so the loading spinner cleanly replaces it (enforced by tests/button-loading-icon.test.mjs).
  • Form controls: Input, PasswordInput, TextArea, NumberInput, Select (plus Base UI Combobox when searchable), Switch, Slider (with marks), Checkbox, RadioGroup, Segmented, and MonthDayPicker.
  • Overlays & feedback: Modal, useConfirm(), Tooltip, Popover, Popconfirm, DropdownMenu, Tabs, Accordion, Pagination, Alert, Tag, Badge, Spinner, Progress, Empty, Avatar, Separator, and appToast (Toast.createToastManager()).

Accessibility & Touch Mode

  • Every interactive control displays a :focus-visible ring using var(--ring) and respects prefers-reduced-motion.
  • Touch mode (html.touch-ui in touch.css) enlarges controls via [data-slot] selectors (button, input, select-trigger, segmented, switch) for classroom touchscreens.
  • Icon-only buttons always carry aria-label and tooltips.