app / frontend /src /index.css
Yuchen Yuan
Claude Opus 4.7 (1M context)
Mobile + large-touchscreen UX overhaul
5c7eb51
Raw History Blame Contribute Delete
9.22 kB
@tailwind base;
@tailwind components;
@tailwind utilities;
/* ============================================================
* Theme tokens
*
* Default is "light" — CSS variables on `:root` are the light palette,
* so the app renders correctly even before any JS runs (no flash of
* unthemed content on first paint, SSR-safe, accessibility-friendly).
* data-theme="dark" : original navy + cyan palette
* data-theme="gmu" : GMU Mason green canvas + Mason gold primary
*
* Values are `R G B` triplets so Tailwind's `/ <alpha-value>` syntax
* works uniformly: `bg-canvas/80` → rgb(var(--color-canvas) / 0.8).
* ============================================================ */
@layer base {
:root {
color-scheme: light;
/* LIGHT (default) — white background with soft accents */
--color-canvas: 246 247 251;
--color-surface: 255 255 255;
--color-surfaceAlt: 240 243 249;
--color-edge: 216 222 232;
--color-mute: 100 116 139;
--color-ink: 15 23 42;
--color-accent: 2 132 199;
--color-accent2: 124 58 237;
--color-accent3: 219 39 119;
--color-accent4: 5 150 105;
--color-warn: 217 119 6;
--color-danger: 220 38 38;
--color-ok: 5 150 105;
--body-bg:
radial-gradient(1200px 600px at 80% -10%, rgb(124 58 237 / 0.08), transparent 70%),
radial-gradient(1000px 500px at 0% 110%, rgb(2 132 199 / 0.08), transparent 70%),
rgb(var(--color-canvas));
--scrollbar-thumb: rgb(var(--color-edge));
--rf-edge-stroke: 148 163 184; /* slate-400 */
--rf-edge-selected: var(--color-accent);
}
[data-theme="dark"] {
color-scheme: dark;
--color-canvas: 11 16 32;
--color-surface: 17 24 48;
--color-surfaceAlt: 21 29 56;
--color-edge: 31 42 74;
--color-mute: 132 146 199;
--color-ink: 230 235 255;
--color-accent: 76 201 240;
--color-accent2: 123 92 255;
--color-accent3: 247 37 133;
--color-accent4: 6 214 160;
--color-warn: 244 162 97;
--color-danger: 239 71 111;
--color-ok: 45 212 191;
--body-bg:
radial-gradient(1200px 600px at 80% -10%, rgb(123 92 255 / 0.12), transparent 70%),
radial-gradient(1000px 500px at 0% 110%, rgb(76 201 240 / 0.10), transparent 70%),
rgb(var(--color-canvas));
--scrollbar-thumb: rgb(var(--color-edge));
--rf-edge-stroke: 74 90 138; /* #4a5a8a */
--rf-edge-selected: var(--color-accent);
}
[data-theme="gmu"] {
color-scheme: dark;
/* Mason Green canvas + Mason Gold primary accent */
--color-canvas: 10 24 18;
--color-surface: 19 46 31;
--color-surfaceAlt: 26 61 40;
--color-edge: 43 89 57;
--color-mute: 137 178 154;
--color-ink: 255 248 225;
--color-accent: 255 199 44; /* Mason Gold #FFC72C */
--color-accent2: 0 163 81; /* bright Mason Green */
--color-accent3: 232 74 95; /* warm contrast red */
--color-accent4: 109 195 213; /* soft Patriot teal */
--color-warn: 255 152 0;
--color-danger: 229 57 53;
--color-ok: 0 200 83;
--body-bg:
radial-gradient(1200px 600px at 80% -10%, rgb(255 199 44 / 0.10), transparent 70%),
radial-gradient(1000px 500px at 0% 110%, rgb(0 102 51 / 0.14), transparent 70%),
rgb(var(--color-canvas));
--scrollbar-thumb: rgb(var(--color-edge));
--rf-edge-stroke: 90 130 100;
--rf-edge-selected: var(--color-accent);
}
html, body, #root {
height: 100%;
}
body {
background: var(--body-bg);
}
*::-webkit-scrollbar {
width: 10px;
height: 10px;
}
*::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb);
border-radius: 5px;
}
*::-webkit-scrollbar-track {
background: transparent;
}
}
@layer components {
.panel {
@apply bg-surface border border-edge rounded-xl shadow-card;
}
.panel-alt {
@apply bg-surfaceAlt border border-edge rounded-xl shadow-card;
}
.chip {
@apply inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full border border-edge bg-surfaceAlt text-mute;
}
/* All four button variants carry `whitespace-nowrap` so their labels
(e.g. "Auto-connect", "Load preset", "Run pipeline") never wrap onto
a second line when a sibling element — typically a long status
message in the toolbar — squeezes the button container. If the
surrounding layout runs out of horizontal room, the button keeps
its single-line label and it is the label's `hidden sm:inline` wrap
in the component that drops the text to icon-only instead. */
.btn {
@apply inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border border-edge bg-surfaceAlt text-ink hover:border-accent/60 hover:text-accent transition-colors text-sm whitespace-nowrap;
}
.btn-primary {
@apply inline-flex items-center gap-2 px-3 py-1.5 rounded-lg font-medium text-sm whitespace-nowrap
bg-gradient-to-r from-accent/90 to-accent2/90 text-canvas shadow-glow
hover:from-accent hover:to-accent2 transition;
}
/* Secondary filled button. Tinted accent2 background so it reads as a
discoverable action next to the subtle outline `btn`, but is clearly
not the primary `btn-primary` (which owns the Run-pipeline gradient). */
.btn-secondary {
@apply inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium whitespace-nowrap
bg-accent2/15 border border-accent2/50 text-accent2
hover:bg-accent2/25 hover:border-accent2 transition-colors;
}
.btn-ghost {
@apply inline-flex items-center gap-2 px-2 py-1 rounded-md text-xs text-mute hover:text-ink hover:bg-surfaceAlt transition-colors whitespace-nowrap;
}
.node-card {
@apply panel-alt px-3 py-2 min-w-[180px] text-sm;
}
.kbd {
@apply px-1.5 py-0.5 rounded border border-edge bg-surface text-[11px] font-mono text-mute;
}
}
/* React Flow overrides — read from theme variables so colors travel with
the active theme. Hex values used to be hard-coded here. */
.react-flow__background {
background-color: transparent;
}
.react-flow__pane {
cursor: default;
}
.react-flow__edge-path {
stroke: rgb(var(--rf-edge-stroke));
stroke-width: 1.5;
}
.react-flow__edge.selected .react-flow__edge-path {
stroke: rgb(var(--color-accent));
}
.react-flow__arrowhead {
fill: rgb(var(--rf-edge-stroke));
}
.react-flow__handle {
background: rgb(var(--color-accent));
border: 2px solid rgb(var(--color-canvas));
width: 10px;
height: 10px;
}
.react-flow__controls {
background: rgb(var(--color-surfaceAlt));
border: 1px solid rgb(var(--color-edge));
border-radius: 8px;
overflow: hidden;
}
.react-flow__controls-button {
background: transparent !important;
color: rgb(var(--color-mute)) !important;
border-bottom: 1px solid rgb(var(--color-edge)) !important;
}
.react-flow__controls-button:hover {
background: rgb(var(--color-edge)) !important;
color: rgb(var(--color-ink)) !important;
}
.react-flow__minimap {
background: rgb(var(--color-surfaceAlt)) !important;
border: 1px solid rgb(var(--color-edge)) !important;
border-radius: 8px !important;
}
.react-flow__attribution {
background: transparent !important;
color: rgb(var(--rf-edge-stroke)) !important;
font-size: 10px !important;
}
/* ----- Touch + viewport polish ---------------------------------------
*
* touch-action: none on the React Flow canvas wrapper hands all touch
* gestures (pan, pinch, two-finger drag) to React Flow's own handler.
* Without this, iOS Safari intercepts two-finger pinches as page zoom
* BEFORE React Flow ever sees the event, breaking canvas pinch-zoom.
*
* The inner React Flow elements re-enable touch as needed via their
* own handlers; this only affects the wrapper's default routing.
*/
.qf-canvas-wrapper {
touch-action: none;
}
/* iOS magnifier / "callout" suppression for elements that participate
* in our custom touch drag (palette tiles, draggable nodes). Without
* this, a long press on a tile triggers the system text magnifier
* and steals the gesture from our PointerEvent handler. */
.qf-no-callout {
-webkit-user-select: none;
user-select: none;
-webkit-touch-callout: none;
}
/* Slightly bigger zoom / fit / pan buttons on the React Flow Controls,
* matching the 44 CSS-px Material/iOS hit target on touch breakpoints.
* Desktop keeps the compact 26px sizing. */
@media (pointer: coarse) {
.react-flow__controls-button {
width: 44px !important;
height: 44px !important;
}
}
/* ----- prefers-reduced-motion ----------------------------------------
* Honor the OS-level "reduce motion" setting. Without this rule the
* default React Flow `animated` edges loop a stroke-dash forever, and
* the various spinners / pulse loaders run regardless of user
* preference. We keep transitions essentially instant so the UI is
* still responsive but without continuous motion. */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
.react-flow__edge-path {
stroke-dasharray: none !important;
animation: none !important;
}
}