index.css 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. @import "tailwindcss";
  2. /* Inter, self-hosted (#1460). Bambuddy is a local-first, offline-capable PWA;
  3. pulling the font from fonts.googleapis.com at runtime broke the install on
  4. Android (CSP-blocked cross-origin fetch) and meant the UI couldn't render
  5. offline. These are the variable woff2 files Google Fonts serves — one file
  6. covers every weight via the variable axis, so font-weight is a 100-900 range.
  7. Files live in frontend/public/fonts/ and are served same-origin. */
  8. @font-face {
  9. font-family: 'Inter';
  10. font-style: normal;
  11. font-weight: 100 900;
  12. font-display: swap;
  13. src: url('/fonts/inter-latin.woff2') format('woff2');
  14. unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  15. }
  16. @font-face {
  17. font-family: 'Inter';
  18. font-style: normal;
  19. font-weight: 100 900;
  20. font-display: swap;
  21. src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  22. unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  23. }
  24. /* Enable class-based dark mode for Tailwind v4 */
  25. @custom-variant dark (&:where(.dark, .dark *));
  26. /* Restore the pointer cursor on interactive controls (#2791). Tailwind v3's
  27. Preflight set `button { cursor: pointer }`; v4 dropped it to match the
  28. browser default of `cursor: default`, so every button in the app looked
  29. unclickable unless someone remembered to add `cursor-pointer` by hand.
  30. Only a handful of the ~930 buttons did, which is why the UI felt
  31. inconsistent rather than uniformly wrong.
  32. This lives in `base`, the lowest of Tailwind's cascade layers, so the
  33. `cursor-not-allowed` / `disabled:cursor-*` utilities dotted around the
  34. codebase still win. The `:not(:disabled)` guard covers the elements that
  35. are disabled without also carrying such a utility. */
  36. @layer base {
  37. button:not(:disabled),
  38. select:not(:disabled),
  39. summary,
  40. input[type="checkbox"]:not(:disabled),
  41. input[type="radio"]:not(:disabled),
  42. [role="button"]:not([aria-disabled="true"]) {
  43. cursor: pointer;
  44. }
  45. }
  46. @theme {
  47. /* Accent colors - use CSS variables for theming */
  48. --color-bambu-green: var(--accent);
  49. --color-bambu-green-light: var(--accent-light);
  50. --color-bambu-green-dark: var(--accent-dark);
  51. /* Semantic status colors - fixed, don't change with accent */
  52. --color-status-ok: var(--status-ok);
  53. --color-status-error: var(--status-error);
  54. --color-status-warning: var(--status-warning);
  55. /* Theme-aware colors via CSS variables */
  56. --color-bambu-dark: var(--bg-primary);
  57. --color-bambu-dark-secondary: var(--bg-secondary);
  58. --color-bambu-dark-tertiary: var(--bg-tertiary);
  59. --color-bambu-gray: var(--text-muted);
  60. --color-bambu-gray-light: var(--text-secondary);
  61. --color-bambu-gray-dark: var(--text-tertiary);
  62. }
  63. /* ============================================
  64. BASE DEFAULTS
  65. ============================================ */
  66. html {
  67. font-size: 14.4px;
  68. }
  69. :root {
  70. /* Default accent color (green) */
  71. --accent: #00ae42;
  72. --accent-light: #00c64d;
  73. --accent-dark: #009438;
  74. /* Semantic status colors - these never change with accent theme */
  75. --status-ok: #22c55e; /* green-500 - always green for success/online/ok */
  76. --status-error: #ef4444; /* red-500 - always red for error/offline/failed */
  77. --status-warning: #f59e0b; /* amber-500 - always amber for warnings */
  78. /* Default light mode background (neutral) */
  79. --bg-primary: #f5f5f5;
  80. --bg-secondary: #ffffff;
  81. --bg-tertiary: #e5e5e5;
  82. --text-primary: #1a1a1a;
  83. --text-secondary: #4a4a4a;
  84. --text-muted: #6b6b6b;
  85. --text-tertiary: #808080;
  86. --border-color: #d4d4d4;
  87. /* Default style (classic) */
  88. --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  89. --glow-color: transparent;
  90. /* Tell the browser which appearance the page is in, so the parts of a form
  91. control it draws itself follow the theme. Bambuddy themes by
  92. swapping CSS variables under a `.dark` class, which the browser cannot
  93. see: without this declaration it assumes light and paints every native
  94. widget internal that way -- number-input steppers, the date picker's
  95. calendar button and its popup, `<select>` dropdowns, scrollbars, the
  96. autofill highlight. That is why the quantity steppers in the print
  97. dialog were pale grey chips inside a dark field. Only the widget
  98. internals are affected; anything we set ourselves still wins. */
  99. color-scheme: light;
  100. font-family: 'Inter', system-ui, sans-serif;
  101. line-height: 1.5;
  102. font-weight: 400;
  103. font-synthesis: none;
  104. text-rendering: optimizeLegibility;
  105. -webkit-font-smoothing: antialiased;
  106. -moz-osx-font-smoothing: grayscale;
  107. }
  108. /* Dark mode base */
  109. .dark {
  110. /* Pairs with `color-scheme: light` on :root -- see the note there. This
  111. sits on `.dark` rather than on each `.dark.bg-*` palette because the
  112. kiosk adds `dark` to <html> on its own (SpoolBuddyLayout), and every
  113. palette is a dark one regardless of which background it picks. */
  114. color-scheme: dark;
  115. --bg-primary: #1a1a1a;
  116. --bg-secondary: #2d2d2d;
  117. --bg-tertiary: #3d3d3d;
  118. --text-primary: #ffffff;
  119. --text-secondary: #a0a0a0;
  120. --text-muted: #808080;
  121. --text-tertiary: #4a4a4a;
  122. --border-color: #3d3d3d;
  123. --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  124. }
  125. /* ============================================
  126. LAYER 1: BACKGROUND PALETTES
  127. ============================================ */
  128. /* Light mode backgrounds */
  129. .bg-neutral {
  130. /* Default - already set in :root */
  131. }
  132. .bg-warm {
  133. --bg-primary: #faf8f5;
  134. --bg-secondary: #fffefa;
  135. --bg-tertiary: #e8e4dd;
  136. --text-primary: #2d2a26;
  137. --text-secondary: #5c5750;
  138. --text-muted: #7a756c;
  139. --text-tertiary: #9a9590;
  140. --border-color: #d8d4cc;
  141. }
  142. .bg-cool {
  143. --bg-primary: #f0f4f8;
  144. --bg-secondary: #ffffff;
  145. --bg-tertiary: #dce4ec;
  146. --text-primary: #1a2530;
  147. --text-secondary: #4a5568;
  148. --text-muted: #6b7a8a;
  149. --text-tertiary: #8a9aaa;
  150. --border-color: #c8d4e0;
  151. }
  152. /* Dark mode backgrounds */
  153. .dark.bg-neutral {
  154. --bg-primary: #1a1a1a;
  155. --bg-secondary: #2d2d2d;
  156. --bg-tertiary: #3d3d3d;
  157. --text-primary: #ffffff;
  158. --text-secondary: #a0a0a0;
  159. --text-muted: #808080;
  160. --text-tertiary: #4a4a4a;
  161. --border-color: #3d3d3d;
  162. }
  163. .dark.bg-warm {
  164. --bg-primary: #1c1a18;
  165. --bg-secondary: #2e2a26;
  166. --bg-tertiary: #3e3a36;
  167. --text-primary: #f5f0ea;
  168. --text-secondary: #b0a898;
  169. --text-muted: #8a8278;
  170. --text-tertiary: #5a5248;
  171. --border-color: #3e3a36;
  172. }
  173. .dark.bg-cool {
  174. --bg-primary: #181c20;
  175. --bg-secondary: #262c32;
  176. --bg-tertiary: #363e46;
  177. --text-primary: #f0f4f8;
  178. --text-secondary: #98a8b8;
  179. --text-muted: #788898;
  180. --text-tertiary: #4a5a6a;
  181. --border-color: #363e46;
  182. }
  183. .dark.bg-oled {
  184. --bg-primary: #000000;
  185. --bg-secondary: #141414;
  186. --bg-tertiary: #1f1f1f;
  187. --text-primary: #ffffff;
  188. --text-secondary: #a0a0a0;
  189. --text-muted: #707070;
  190. --text-tertiary: #404040;
  191. --border-color: #2a2a2a;
  192. }
  193. .dark.bg-slate {
  194. --bg-primary: #0f172a;
  195. --bg-secondary: #1e293b;
  196. --bg-tertiary: #334155;
  197. --text-primary: #f1f5f9;
  198. --text-secondary: #94a3b8;
  199. --text-muted: #64748b;
  200. --text-tertiary: #475569;
  201. --border-color: #334155;
  202. }
  203. .dark.bg-forest {
  204. --bg-primary: #121a16;
  205. --bg-secondary: #1c2a22;
  206. --bg-tertiary: #2a3d30;
  207. --text-primary: #e8f5ec;
  208. --text-secondary: #8aa894;
  209. --text-muted: #6a8874;
  210. --text-tertiary: #4a6854;
  211. --border-color: #2a3d30;
  212. }
  213. /* Printer card control buttons: stack only when they clip */
  214. .printer-control-buttons-container {
  215. container-type: inline-size;
  216. }
  217. @container (max-width: 220px) {
  218. .printer-control-buttons {
  219. flex-direction: column;
  220. align-items: stretch;
  221. }
  222. .printer-control-buttons > button {
  223. width: 100%;
  224. }
  225. }
  226. /* ============================================
  227. LAYER 2: STYLE EFFECTS
  228. ============================================ */
  229. /* Classic - default, clean minimal shadows */
  230. .style-classic {
  231. /* Uses default shadows from :root and .dark */
  232. }
  233. /* Glow - accent-colored glow effects on cards */
  234. .style-glow {
  235. --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 25px color-mix(in srgb, var(--accent) 12%, transparent);
  236. }
  237. .dark.style-glow {
  238. --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 40px color-mix(in srgb, var(--accent) 15%, transparent);
  239. }
  240. /* Vibrant - dramatic deep shadows, more contrast */
  241. .style-vibrant {
  242. --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
  243. }
  244. .dark.style-vibrant {
  245. --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
  246. }
  247. /* ============================================
  248. LAYER 3: ACCENT COLORS
  249. ============================================ */
  250. .accent-green {
  251. --accent: #00ae42;
  252. --accent-light: #00c64d;
  253. --accent-dark: #009438;
  254. }
  255. .accent-teal {
  256. --accent: #14b8a6;
  257. --accent-light: #2dd4bf;
  258. --accent-dark: #0d9488;
  259. }
  260. .accent-blue {
  261. --accent: #3b82f6;
  262. --accent-light: #60a5fa;
  263. --accent-dark: #2563eb;
  264. }
  265. .accent-orange {
  266. --accent: #f97316;
  267. --accent-light: #fb923c;
  268. --accent-dark: #ea580c;
  269. }
  270. .accent-purple {
  271. --accent: #8b5cf6;
  272. --accent-light: #a78bfa;
  273. --accent-dark: #7c3aed;
  274. }
  275. .accent-red {
  276. --accent: #ef4444;
  277. --accent-light: #f87171;
  278. --accent-dark: #dc2626;
  279. }
  280. body {
  281. background-color: var(--bg-primary);
  282. color: var(--text-primary);
  283. margin: 0;
  284. min-height: 100vh;
  285. transition: background-color 0.2s ease, color 0.2s ease;
  286. }
  287. #root {
  288. min-height: 100vh;
  289. }
  290. /* Override text-white to be theme-aware */
  291. .text-white {
  292. color: var(--text-primary);
  293. }
  294. /* Smooth transitions for theme changes */
  295. .bg-bambu-dark,
  296. .bg-bambu-dark-secondary,
  297. .bg-bambu-dark-tertiary,
  298. .border-bambu-dark-tertiary {
  299. transition: background-color 0.2s ease, border-color 0.2s ease;
  300. }
  301. /* Toast slide-in animation */
  302. @keyframes slide-in {
  303. from {
  304. transform: translateX(100%);
  305. opacity: 0;
  306. }
  307. to {
  308. transform: translateX(0);
  309. opacity: 1;
  310. }
  311. }
  312. .animate-slide-in {
  313. animation: slide-in 0.2s ease-out;
  314. }
  315. /* Theme-aware icon inversion - only invert in dark mode */
  316. .icon-theme {
  317. opacity: 0.5;
  318. }
  319. .dark .icon-theme {
  320. filter: invert(1);
  321. opacity: 0.4;
  322. }
  323. /* Green-colored icon for active status indicators */
  324. .icon-green {
  325. filter: invert(48%) sepia(89%) saturate(459%) hue-rotate(93deg) brightness(95%) contrast(92%);
  326. opacity: 1;
  327. }
  328. /* Orange/red-colored icon for heating indicators */
  329. .icon-heating {
  330. filter: invert(50%) sepia(100%) saturate(1000%) hue-rotate(360deg) brightness(100%) contrast(100%);
  331. opacity: 1;
  332. }
  333. /* Jogpad theme styling - darken background in dark mode */
  334. .jogpad-theme {
  335. /* Light mode - normal */
  336. }
  337. .dark .jogpad-theme {
  338. filter: brightness(0.35) contrast(1.2);
  339. }
  340. /* Empty AMS slot with diagonal stripes */
  341. .ams-empty-slot {
  342. background: repeating-linear-gradient(
  343. 45deg,
  344. #444,
  345. #444 2px,
  346. #222 2px,
  347. #222 4px
  348. );
  349. }
  350. .dark .ams-empty-slot {
  351. background: repeating-linear-gradient(
  352. 45deg,
  353. #555,
  354. #555 2px,
  355. #333 2px,
  356. #333 4px
  357. );
  358. }
  359. /* Touch manipulation to prevent zoom on double-tap */
  360. .touch-manipulation {
  361. touch-action: manipulation;
  362. }
  363. /* Safe area insets for notched devices */
  364. .safe-area-bottom {
  365. padding-bottom: env(safe-area-inset-bottom, 0);
  366. }
  367. .safe-area-top {
  368. padding-top: env(safe-area-inset-top, 0);
  369. }
  370. /* Hide scrollbar but keep functionality */
  371. .scrollbar-hide {
  372. -ms-overflow-style: none;
  373. scrollbar-width: none;
  374. }
  375. .scrollbar-hide::-webkit-scrollbar {
  376. display: none;
  377. }
  378. /* Mobile drawer animation */
  379. @keyframes slide-in-left {
  380. from {
  381. transform: translateX(-100%);
  382. }
  383. to {
  384. transform: translateX(0);
  385. }
  386. }
  387. .animate-slide-in-left {
  388. animation: slide-in-left 0.3s ease-out;
  389. }
  390. /* SpoolBuddy idle scan animation: transform/opacity only for low-power devices */
  391. @keyframes spoolbuddy-optimized-ping {
  392. 0% {
  393. transform: scale(0.8);
  394. opacity: 0.8;
  395. }
  396. 80%,
  397. 100% {
  398. transform: scale(2.2);
  399. opacity: 0;
  400. }
  401. }
  402. .spoolbuddy-optimized-ping {
  403. will-change: auto;
  404. contain: layout;
  405. animation: spoolbuddy-optimized-ping 3.5s cubic-bezier(0, 0, 0.2, 1) infinite;
  406. }
  407. .spoolbuddy-spool-glow {
  408. transform: scale(2.0);
  409. will-change: auto;
  410. }
  411. @media (prefers-reduced-motion: reduce) {
  412. .spoolbuddy-optimized-ping {
  413. animation: none;
  414. opacity: 0.25;
  415. transform: scale(1.2);
  416. }
  417. .spoolbuddy-spool-glow {
  418. transition: none;
  419. }
  420. }
  421. /* SpoolBuddy quick menu slide-down */
  422. @keyframes slide-down {
  423. from {
  424. transform: translateY(-100%);
  425. }
  426. to {
  427. transform: translateY(0);
  428. }
  429. }
  430. .animate-slide-down {
  431. animation: slide-down 0.25s ease-out;
  432. }
  433. /* Card shadows - uses theme-specific shadow */
  434. .card-shadow {
  435. box-shadow: var(--card-shadow);
  436. }
  437. /* ============================================
  438. SPOOLBUDDY KIOSK MODAL CONSTRAINTS
  439. Cap large modals (max-w-2xl) to viewport on the
  440. small SpoolBuddy touchscreen. Excludes smaller
  441. modals like the slot action picker (max-w-sm).
  442. ============================================ */
  443. [data-spoolbuddy-kiosk] .fixed .relative.max-w-2xl {
  444. height: 90vh;
  445. max-height: 90vh;
  446. display: flex;
  447. flex-direction: column;
  448. }
  449. [data-spoolbuddy-kiosk] .fixed .relative.max-w-2xl > div:first-child {
  450. flex-shrink: 0;
  451. }
  452. [data-spoolbuddy-kiosk] .fixed .relative.max-w-2xl > div:last-child {
  453. flex-shrink: 0;
  454. }
  455. [data-spoolbuddy-kiosk] .fixed .relative.max-w-2xl > div:nth-child(2) {
  456. flex: 1 1 auto;
  457. min-height: 0;
  458. overflow-y: auto;
  459. }
  460. /* Remove inner spool grid max-height to avoid nested scrollbars */
  461. [data-spoolbuddy-kiosk] .fixed .relative.max-w-2xl .max-h-96 {
  462. max-height: none;
  463. }
  464. /* Calendar selected-day list scrollbar theming */
  465. .calendar-scroll {
  466. scrollbar-width: thin;
  467. scrollbar-color: color-mix(in srgb, var(--text-muted) 60%, transparent) transparent;
  468. }
  469. .calendar-scroll::-webkit-scrollbar {
  470. width: 8px;
  471. }
  472. .calendar-scroll::-webkit-scrollbar-track {
  473. background: transparent;
  474. }
  475. .calendar-scroll::-webkit-scrollbar-thumb {
  476. background-color: color-mix(in srgb, var(--text-muted) 60%, transparent);
  477. border-radius: 999px;
  478. border: 2px solid color-mix(in srgb, var(--bg-secondary) 70%, transparent);
  479. }
  480. .calendar-scroll::-webkit-scrollbar-thumb:hover {
  481. background-color: color-mix(in srgb, var(--text-muted) 80%, transparent);
  482. }
  483. /* History row thumbnail hover-to-enlarge — desktop only (no hover on touch). */
  484. @media (hover: hover) and (pointer: fine) {
  485. .history-thumb-hover:hover .history-thumb-preview {
  486. opacity: 1;
  487. }
  488. }