mirror of
https://github.com/hanzoai/site.git
synced 2026-11-20 21:21:13 +00:00
- @hanzo/appearance 0.2.14: bootScript({ base: { theme: 'system' } }) in <head> (byte-identical to
the script in live hanzo.ai's HTML) replays localStorage hanzo.appearance.painted before the first
paint, else follows prefers-color-scheme; it sets light/t_light or dark/t_dark, color-scheme and
data-scheme. components/Appearance.jsx calls useAppearance({ install: { theme: 'system' } }) once
at the root (Hanzo's README), so the person's saved choice (hanzo.appearance, kept in Hanzo IAM)
wins over the device, and "system" follows the device live. No visible switch: live shows none.
- <html> is served as live serves it, class="t_dark" (the hard-coded "light t_light" is gone); React
never writes the classes, so hydration and navigation keep them.
- @hanzo/design 0.5.39 tokens/colors.css imported; every dark value of ours is now a reference to
Hanzo's token (--ink: var(--foreground), --bg: var(--background), --card: var(--muted), ... ),
under Hanzo's own :not(.light) selector, in globals.css, system.css and the shared light-dark()
greys and scrims. No colour of ours in dark; light values unchanged.
- react/react-dom 19.1.1 -> 19.2.8: @hanzo/appearance's peer range (>=19.2.8); Next 15.5.4 accepts it.
- docs/DARK-MODE.md rewritten for the package: how it works, how to test like live, the token map,
how a page chat converts its pages (darkcheck.mjs / lightcheck.mjs).
Measured: saved dark on a light device -> dark, saved light on a dark device -> light (survives a
device flip), nothing saved -> follows the device and flips live; right class at first paint and
after hydration, 0 page errors. Bright mode 0 computed-colour diffs vs 3c802582 on / /pricing /chat
/enso /models /about at 1470 and 375. / /pricing /chat in both modes at 1470x801 and 375x812:
0 console errors, no sideways scroll. Build exits 0 (HZ_LIVE_OFFLINE=1: hanzo.ai is blocked here).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P5YBdxPteCvBL7f74SauJt
42 lines
3.8 KiB
CSS
42 lines
3.8 KiB
CSS
/* DetailSheet (components/v2, Wave 2 "Proof" chat). See DetailSheet.jsx for usage. */
|
|
/* a native <dialog> (showModal): full-viewport and transparent, so the panel slides inside it and a click on the
|
|
dialog itself (outside the panel) closes it */
|
|
dialog.pf-sheet { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; overflow: hidden; }
|
|
dialog.pf-sheet::backdrop { background: rgba(0, 0, 0, .34); opacity: 0; transition: opacity .4s cubic-bezier(.4, 0, .2, 1); }
|
|
dialog.pf-sheet[data-open='true']::backdrop { opacity: 1; }
|
|
/* the <div> sheet that DetailSheet.jsx renders today: fixed and hidden until open (without these it sat in the page,
|
|
its closed panel pushing the page 1000px sideways) */
|
|
div.pf-sheet { position: fixed; inset: 0; z-index: 1000; visibility: hidden; pointer-events: none; transition: visibility 0s .6s; }
|
|
div.pf-sheet[data-open='true'] { visibility: visible; pointer-events: auto; transition-delay: 0s; }
|
|
.pf-sheet-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .34); opacity: 0; transition: opacity .4s var(--ease); }
|
|
.pf-sheet[data-open='true'] .pf-sheet-scrim { opacity: 1; }
|
|
.pf-sheet-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(640px, calc(100vw - 24px)); display: flex; flex-direction: column; background: var(--x-raised); color: var(--ink); border-radius: 28px; box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .45); transform: translate3d(calc(100% + 24px), 0, 0); transition: transform .5s cubic-bezier(.16, 1, .3, 1); overflow: hidden; }
|
|
.pf-sheet.wide .pf-sheet-panel { width: min(1040px, calc(100vw - 24px)); }
|
|
.pf-sheet[data-open='true'] .pf-sheet-panel { transform: none; }
|
|
.pf-sheet[data-open='false'] .pf-sheet-panel { transition-duration: .4s; }
|
|
.pf-sheet-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 32px 32px 20px; border-bottom: 1px solid var(--line); }
|
|
.pf-sheet-top .pf-sheet-cap { margin: 10px 0 0; }
|
|
.pf-sheet-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: light-dark(#f0f0f2, var(--muted)); color: var(--ink); cursor: pointer; transition: background-color .25s, transform .3s var(--ease); }
|
|
.pf-sheet-x:hover { background: #e4e4e8; }
|
|
.pf-sheet-x:active { transform: scale(.94); }
|
|
.pf-sheet-x:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
|
|
.pf-sheet-body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 24px 32px 40px; font-size: 17px; line-height: 1.6; color: var(--soft); }
|
|
.pf-sheet-body h3 { margin: 28px 0 8px; font-size: 19px; font-weight: 560; letter-spacing: -.015em; color: var(--ink); }
|
|
.pf-sheet-body h3:first-child { margin-top: 0; }
|
|
.pf-sheet-body p { margin: 0 0 14px; }
|
|
.pf-sheet-body table { width: 100%; border-collapse: collapse; font-size: 15px; }
|
|
.pf-sheet-body th, .pf-sheet-body td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
|
|
.pf-sheet-body th { font-weight: 560; color: var(--ink); }
|
|
.pf-sheet-body a { color: var(--ink); }
|
|
|
|
@media (max-width: 900px) {
|
|
.pf-sheet-panel, .pf-sheet.wide .pf-sheet-panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 90svh; border-radius: 28px 28px 0 0; transform: translate3d(0, 100%, 0); }
|
|
.pf-sheet-panel::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 5px; background: rgba(0, 0, 0, .16); }
|
|
.pf-sheet-top { padding: 28px 20px 16px; }
|
|
.pf-sheet-body { padding: 20px 20px 36px; font-size: 16px; }
|
|
.pf-sheet-body table { font-size: 14px; }
|
|
}
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.pf-sheet-panel, .pf-sheet-scrim, dialog.pf-sheet::backdrop { transition-duration: .01s !important; }
|
|
}
|