/* The public site. Colors and fonts match the viewer (src/styles/app.css). */ @font-face { font-family: 'Site Inter'; font-weight: 500; font-display: swap; src: url('../src/assets/fonts/inter-latin-500-normal.woff2') format('woff2'); } @font-face { font-family: 'Site Inter'; font-weight: 600 800; font-display: swap; src: url('../src/assets/fonts/inter-latin-600-normal.woff2') format('woff2'); } @font-face { font-family: 'Site Mono'; font-weight: 500; font-display: swap; src: url('../src/assets/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); } :root { color-scheme: light; --bg: #f5f6f9; --surface: #ffffff; --canvas: #fbfbfd; --line: #e3e6ec; --line-strong: #c9cfda; --text: #15171f; --muted: #5b6070; --accent: #6650d9; --accent-hover: #5741c9; --accent-soft: #efebfd; --danger: #b13c50; --font: 'Site Inter', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'Site Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace; --radius: 6px; --page: 1240px; --gutter: 32px; } * { box-sizing: border-box; } body { margin: 0; background: var(--bg); color: var(--text); font: 500 15px / 1.55 var(--font), sans-serif; -webkit-font-smoothing: antialiased; } a { color: inherit; } /* One focus ring for every link and button on the site. */ :where(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; } html { scroll-behavior: smooth; } @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } } section[id] { scroll-margin-top: 8px; } .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } code { font-family: var(--mono); font-size: 0.92em; } .page { min-height: 100vh; display: flex; flex-direction: column; } main { flex: 1; } .wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; text-decoration: none; } .logo { display: inline-block; flex: none; } .logo svg { display: block; width: 100%; height: 100%; } /* Nav */ .nav { display: flex; align-items: center; justify-content: space-between; max-width: var(--page); margin: 0 auto; width: 100%; height: 56px; padding: 0 var(--gutter); } .nav-links { display: flex; gap: 24px; } .nav-links a, .footer-links a, .section-head a { text-decoration: none; transition: color 140ms; } .nav-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; } .gh-mark { width: 14px; height: 14px; fill: currentColor; } .nav-links a:hover, .footer-links a:hover { color: var(--text); } /* Hero */ .hero { max-width: var(--page); margin: 0 auto; padding: 12px var(--gutter) 0; } /* One big line, then the pitch at the left and the actions at the right, so the live diagram starts high on the first screen. */ .hero h1 { margin: 8px 0 0; font-size: clamp(38px, 5.6vw, 76px); line-height: 1; font-weight: 800; letter-spacing: -0.045em; text-wrap: balance; } .hero-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin: 10px 0 22px; } .hero-kicker { margin: 0; color: var(--accent); font-size: clamp(20px, 2.1vw, 28px); font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; } .hero-sub { max-width: 640px; margin: 8px 0 0; color: var(--muted); font-size: 16px; text-wrap: pretty; } .hero-sub code { color: var(--text); } .hero-actions { display: flex; flex: none; gap: 10px; } /* A long diagram title stays on one line. The link's title shows all of it. */ .hero-open { max-width: 300px; } .hero-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hero .live { height: clamp(460px, calc(100vh - 280px), 760px); } .button { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; transition: border-color 140ms, background-color 140ms, transform 100ms; } .button:hover { border-color: var(--muted); } .button:active, .copy:active { transform: scale(0.98); } .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .button.primary:hover { background: var(--accent-hover); } /* Copy command. Without .button it is a light code line with no border. */ .copy { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 0; border-radius: var(--radius); background: #eceef3; color: var(--text); font: inherit; font-weight: 500; text-align: left; cursor: pointer; transition: background-color 140ms, transform 100ms; } .copy:not(.button):hover { background: #e4e7ee; } .copy.button { font-weight: 500; } .copy code { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; } .copy-prompt { color: var(--muted); font: 12px var(--mono); } .copy-icon { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; transition: stroke 140ms; } .copy:hover .copy-icon { stroke: var(--text); } .copy.is-copied .copy-icon { stroke: #2d7a5c; stroke-width: 1.8; animation: copied 220ms ease-out; } @keyframes copied { from { transform: scale(0.6); } } @media (prefers-reduced-motion: reduce) { .copy.is-copied .copy-icon { animation: none; } } /* Live editor */ .live { display: flex; flex-direction: column; height: clamp(420px, calc(100vh - 330px), 640px); border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); overflow: hidden; text-align: left; box-shadow: 0 12px 40px #25213b12; } .live-bar { display: flex; align-items: stretch; height: 40px; padding: 0 8px; border-bottom: 1px solid var(--line); background: var(--bg); } .live-tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; } .live-tab, .live-reset { border: 0; background: none; font: 500 12.5px var(--mono); color: var(--muted); padding: 0 12px; cursor: pointer; white-space: nowrap; } .live-tab:hover { color: var(--text); } .live-tab:focus-visible { outline-offset: -2px; } .live-tab[aria-selected='true'] { color: var(--text); background: var(--surface); box-shadow: inset 0 2px 0 var(--accent), 1px 0 0 var(--line), -1px 0 0 var(--line); } .live-bar-end { display: flex; align-items: center; gap: 6px; margin-left: auto; padding-left: 12px; } .live-reset { font-family: var(--font); height: 28px; } .live-open { display: flex; align-items: center; height: 28px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; padding: 0 6px; transition: color 140ms; } .live-open:hover { color: var(--accent-hover); } .live-reset:hover { color: var(--text); } /* The drawing first and widest; the source it writes to at the right. */ .live-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 26%); } .live-source { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-left: 1px solid var(--line); } .live-source:focus-within { background: #fdfcff; box-shadow: inset 0 2px 0 var(--accent); } .live-stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; } /* Live or static: a small segmented switch at the start of the caption under the drawing. */ .live-output { flex: none; display: flex; padding: 2px; border-radius: 6px; background: #15171f0f; } .live-output button { height: 24px; padding: 0 10px; border: 0; border-radius: 5px; background: none; color: var(--muted); font: 600 12.5px var(--font); cursor: pointer; transition: background-color 140ms, color 140ms; } .live-output button:hover { color: var(--text); } .live-output button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px #15171f1f; } .live-caption { container-type: inline-size; flex: none; display: flex; align-items: center; gap: 12px; height: 37px; padding: 0 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; white-space: nowrap; } .live-caption > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; } .live-caption-actions { display: flex; gap: 2px; margin-left: auto; } .live-caption-actions .live-reset { color: var(--accent); font-weight: 600; } .live-caption-actions .live-reset:hover { color: var(--accent-hover); } .live-caption-actions .live-reset:disabled { color: var(--muted); cursor: not-allowed; } /* The caption drops words as its own width runs out, so nothing leaves the row. */ @container (max-width: 690px) { .live-caption-long { display: none; } } @container (max-width: 440px) { .live-caption-tail { display: none; } .live-caption-actions .live-reset { padding: 0 8px; } } /* Stands in for the drawing when there is none. */ .live-caption-blank { position: absolute; inset: 0 0 37px; z-index: 1; display: flex; align-items: center; justify-content: center; margin: 0; padding: 24px; background: var(--canvas); color: var(--muted); font-size: 13px; text-align: center; } .drag-view, .live-static { position: relative; flex: 1; min-height: 0; background: var(--canvas); transition: opacity 120ms; } /* The fit trims the margin, so the drawing's paper runs past the frame. */ .drag-view { overflow: hidden; } .drag-view.is-stale .drag-host, .live-static.is-stale { opacity: 0.45; } .drag-host { position: absolute; inset: 8px; transition: opacity 120ms; } /* Over the drawing, so a solid fill keeps it readable where a box runs under it. */ .drag-expand { position: absolute; z-index: 1; top: 8px; right: 8px; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 0; border-radius: 5px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); color: var(--muted); font: 600 12px var(--font); cursor: pointer; transition: color 140ms; } .drag-expand:hover, .drag-expand:active { color: var(--text); } .drag-expand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } .drag-expand svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; } .drag-host svg { display: block; overflow: visible; user-select: none; -webkit-user-select: none; } /* Boxes and groups pick up; lines do not. touch-action keeps page scroll on the empty canvas. */ .drag-view .is-drag { cursor: grab; touch-action: none; } .drag-view .is-drag:hover > .shape { filter: brightness(1.04) drop-shadow(0 1px 2px #15171f2e); } .drag-view.is-dragging, .drag-view.is-dragging .is-drag { cursor: grabbing; } .drag-view .is-lifted > .shape { filter: drop-shadow(0 6px 10px #15171f33); } .drag-hint { position: absolute; z-index: 1; transform: translate(-50%, -130%); padding: 3px 8px; border-radius: 5px; background: var(--text); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; animation: hint-in 260ms 500ms ease-out both; } .drag-hint::after { content: ''; position: absolute; left: calc(50% - 4px); bottom: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: var(--text); } @keyframes hint-in { from { opacity: 0; transform: translate(-50%, -100%); } } @media (prefers-reduced-motion: reduce) { .drag-hint { animation: none; } } .live-static { display: flex; padding: 20px; } .live-static img { flex: 1; min-width: 0; min-height: 0; object-fit: contain; } /* The lines a drag wrote, marked under the highlighted source. */ .live-band { position: absolute; left: 0; right: 0; height: 20px; background: #6650d91a; box-shadow: inset 2px 0 0 var(--accent); animation: band-in 700ms ease-out; } @keyframes band-in { from { background: #6650d940; } } @media (prefers-reduced-motion: reduce) { .live-band { animation: none; } } .live-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: flex-start; padding: 12px 0; font: 500 12.5px / 20px var(--mono); } .live-gutter { margin: 0; padding: 0 10px 0 14px; min-width: 42px; text-align: right; color: #a3a8b8; font: inherit; user-select: none; } /* The highlighted copy sits under a transparent textarea with the same metrics. */ .live-code { position: relative; flex: 1; min-width: max-content; } .live-hl, .live-text { margin: 0; padding: 0 16px 0 4px; border: 0; font: inherit; /* Show `->` as typed, not as an arrow glyph. */ font-variant-ligatures: none; white-space: pre; tab-size: 2; } .live-text { position: absolute; inset: 0; width: 100%; outline: none; resize: none; overflow: hidden; background: none; color: transparent; caret-color: var(--text); } .live-text::selection { background: #6650d92e; } /* .draft tokens (site/highlight.ts) */ .tok-command { color: #6650d9; } .tok-mark { font-weight: 700; } /* Change marks match the diff drawing: added green, removed red, changed amber. */ .tok-mark-added { color: #2d7a5c; } .tok-mark-removed { color: #b13c50; } .tok-mark-changed { color: #a2611a; } .tok-mark-context { color: #6a7082; } .tok-string { color: #2d7a5c; } .tok-attr { color: #8a6420; } .tok-value, .tok-number { color: #2b5fa8; } .tok-arrow, .tok-comment { color: #6a7082; } .live-status { flex: none; height: 37px; padding: 0 14px; line-height: 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .live-status.is-error { color: var(--danger); } .live-status .is-note { color: var(--text); } /* Points: three things the text does that a picture cannot. Pick one and it draws live. */ .points { max-width: var(--page); margin: 0 auto; padding: 56px var(--gutter) 0; } .points-body { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 32px; } .point-list { display: flex; flex-direction: column; gap: 4px; } .point { padding: 12px 14px; border-radius: 8px; cursor: pointer; transition: background-color 140ms; } .point:hover { background: #eef0f5; } .point.is-active { background: var(--surface); cursor: default; } .point h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; } .point h3 button { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: inherit; transition: color 140ms; } .point:not(.is-active):hover h3 button { color: var(--accent); } .point p { margin: 2px 0 6px; color: var(--muted); font-size: 14px; line-height: 1.5; } .point p code { color: var(--text); } .point-tabs { display: flex; flex-wrap: wrap; gap: 0 14px; } .point-tabs button { min-width: 24px; height: 26px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 500 13px var(--font); cursor: pointer; transition: color 140ms, border-color 140ms; } .point-tabs button:hover { color: var(--text); } /* Each point keeps its pick; only the one on show is in the accent. */ .point-tabs button[aria-pressed='true'] { color: var(--text); border-bottom-color: var(--line-strong); } .point.is-active .point-tabs button[aria-pressed='true'] { border-bottom-color: var(--accent); } .point-view { display: flex; flex-direction: column; min-width: 0; } .point-figure { display: flex; height: 420px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); transition: background-color 200ms; } .point-figure svg { flex: 1; width: 100%; height: 100%; animation: fade-in 160ms ease-out; } @keyframes fade-in { from { opacity: 0; } } /* Fixed at three lines, so switching never moves what is below. Long lines scroll. */ .point-source { height: calc(3 * 19px); margin: 10px 0 0; padding: 0 2px; overflow: auto hidden; scrollbar-width: none; font: 500 12.5px / 19px var(--mono); font-variant-ligatures: none; white-space: pre; } /* Examples */ .examples, .install, .switch { max-width: var(--page); margin: 0 auto; padding: 56px var(--gutter) 0; } .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; } .section-head h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; } .section-head a { color: var(--accent); font-size: 14px; font-weight: 600; white-space: nowrap; } .section-head a:hover { color: var(--accent-hover); } .cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; } .card { display: flex; flex-direction: column; text-decoration: none; } .card-thumb { height: 190px; margin-bottom: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); transition: border-color 140ms; } .card:hover .card-thumb { border-color: var(--accent); } .card-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 200ms; } .card-thumb img.is-loaded { opacity: 1; } @media (prefers-reduced-motion: reduce) { .point-figure svg { animation: none; } .card-thumb img { transition: none; } } .card h3 { margin: 0 0 2px; font-size: 15px; font-weight: 700; } .card:hover h3 { color: var(--accent); } .card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; } /* Install */ .install-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; } .install-cols > div { display: flex; flex-direction: column; } .install h3 { margin: 0; font-size: 16px; font-weight: 700; } .install h3 + * { margin-top: 8px; } .install p { margin: 10px 0 0; color: var(--muted); font-size: 14px; } /* A long command wraps inside its button, so it never sets the column's width. */ .install .copy { align-items: flex-start; width: 100%; height: auto; min-height: 40px; margin-top: auto; padding: 10px 12px; line-height: 20px; } .install .copy code { white-space: normal; text-wrap: balance; } .install .copy-prompt { line-height: 20px; } .install .copy-icon { margin-top: 2px; } .install-cols p { margin-bottom: 14px; } /* A command breaks between words, never after a hyphen; a word wider than the box still breaks. */ .copy-word { display: inline-block; max-width: 100%; overflow-wrap: anywhere; } .install p code, .switch p code { white-space: nowrap; } /* One height for the row's commands, so their boxes line up whatever their length. */ /* Room for two lines, so the row's command boxes match whether a command wraps or not. */ .install-cols .copy { min-height: 60px; } .install .commands { margin-top: 28px; } .install-note { font-size: 13px; } .commands { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 16px 0 0; font-size: 14px; } .commands dt code { font-size: 12.5px; } .commands dd { margin: 0; color: var(--muted); } /* Coming from Mermaid: the two routes and a comparison beside the user's own source, drawn. */ .switch-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: start; } .switch-lead { max-width: 60ch; margin: 0; font-size: 16px; } .switch-routes { display: grid; gap: 20px; margin-top: 20px; } .switch-routes > div { display: flex; flex-direction: column; } .switch h3 { margin: 0; font-size: 16px; font-weight: 700; } .switch-routes p { margin: 6px 0 12px; color: var(--muted); font-size: 14px; } .switch .copy { align-items: flex-start; width: 100%; height: auto; min-height: 40px; margin-top: auto; padding: 10px 12px; line-height: 20px; } .switch .copy code { white-space: normal; } .switch .copy-icon { margin-top: 2px; } .switch-table { width: 100%; margin-top: 28px; border-collapse: collapse; font-size: 14px; } .switch-table th, .switch-table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; } .switch-table thead th { color: var(--muted); font-size: 13px; font-weight: 600; } .switch-table tbody th { font-weight: 600; } .switch-table td { color: var(--muted); } .switch-table td:last-child { color: var(--text); } .switch-figure { margin: 0; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--bg); } .switch-caption { margin: 0; padding: 10px 14px 0; color: var(--muted); font: 600 12px var(--font); } .switch-pane { min-width: 0; } .switch-pane-drawing { position: relative; border-top: 1px solid var(--line); background: var(--canvas); } .switch-source { margin: 0; padding: 8px 14px 14px; font: 500 12.5px / 19px var(--mono); font-variant-ligatures: none; white-space: pre; overflow-x: auto; } .switch-drawing { /* The drawing's own shape, so the space is held before it draws. */ aspect-ratio: 2.3; padding: 8px; } .switch-drawing svg { display: block; width: 100%; height: 100%; } /* Footer */ .footer { display: flex; align-items: center; gap: 14px; max-width: var(--page); width: 100%; margin: 56px auto 0; padding: 20px var(--gutter); border-top: 1px solid var(--line); } .footer .wordmark { font-size: 16px; } .footer-links { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-left: auto; font-size: 13px; } .footer-links a { display: inline-flex; align-items: center; min-height: 24px; color: var(--muted); } @media (max-width: 1100px) { .hero-head { flex-direction: column; align-items: flex-start; gap: 16px; } .points-body { grid-template-columns: 1fr; gap: 16px; } /* The drawing first, so a tap on a tab below never leaves it off screen. */ .point-view { order: -1; } .point-figure { height: 340px; } .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .install-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .switch-body { grid-template-columns: 1fr; } /* With the full width, the source sits beside its drawing. */ .switch-figure { display: grid; grid-template-columns: auto minmax(0, 1fr); } .switch-pane-drawing { border-top: 0; border-left: 1px solid var(--line); } } @media (max-width: 900px) { .hero .live { height: auto; } } @media (max-width: 520px) { .hero-actions { flex-direction: column; align-self: stretch; } .point-figure { height: 260px; padding: 8px; } .cards { gap: 20px 12px; } .card-thumb { height: 120px; padding: 6px; } .card p { font-size: 13px; } .commands { grid-template-columns: 1fr; gap: 2px; } .install-cols { grid-template-columns: 1fr; } .switch-figure { display: block; } .switch-pane-drawing { border-top: 1px solid var(--line); border-left: 0; } .switch-table tbody th { width: 32%; } .commands dd { margin-bottom: 10px; } .section-head { flex-direction: column; gap: 4px; } .nav-links { gap: 18px; } .nav-links .nav-editor { display: none; } } /* Narrow screens */ @media (max-width: 900px) { :root { --gutter: 16px; } .live { height: auto; } .live-body { grid-template-columns: minmax(0, 1fr); } .live-stage { height: 300px; border-bottom: 1px solid var(--line); } .drag-host { inset: 6px; } .drag-expand { height: 32px; padding: 0 10px; } .live-source { border-left: 0; } /* Tabs get the full width; the actions keep one row, so Undo appearing moves nothing. */ .live-bar { flex-wrap: wrap; height: auto; padding: 0; } .live-tabs { flex: 1 0 100%; height: 40px; padding: 0 8px; } .live-bar-end { flex: 1 0 100%; justify-content: flex-end; height: 32px; margin: 0; padding: 0 8px; border-top: 1px solid var(--line); } .live-scroll { max-height: 280px; } } /* Tabs run past the edge here, so the last one fades to say there are more. */ @media (max-width: 720px) { .live-tabs { padding-right: 40px; mask-image: linear-gradient(to left, transparent, #000 40px); } } /* Playground (site/play) and the shared editor and diagram views (site/live) */ .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } .play { display: flex; flex-direction: column; height: 100vh; height: 100dvh; } .play-head { display: flex; align-items: center; gap: 28px; flex: none; height: 52px; padding: 0 14px 0 20px; border-bottom: 1px solid var(--line); background: var(--surface); } .play-nav { display: flex; gap: 22px; font-size: 14px; } .play-nav a { color: var(--muted); text-decoration: none; transition: color 140ms; } .play-nav a:hover, .play-nav a[aria-current='page'] { color: var(--text); } .play-nav a[aria-current='page'] { font-weight: 700; } .play-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; } .tool { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: border-color 140ms, background-color 140ms; } .tool:hover:not(:disabled) { border-color: var(--muted); } .tool:active:not(:disabled) { background: var(--bg); } .tool:disabled { opacity: 0.5; cursor: default; } .tool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; } .tool.is-done svg { color: #2d7a5c; animation: pop 260ms ease-out; } @keyframes pop { 40% { transform: scale(1.25); } } .tool.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .tool.primary:hover { background: var(--accent-hover); } .menu-wrap { position: relative; } .menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; display: flex; flex-direction: column; min-width: 220px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); box-shadow: 0 10px 30px #25213b24; } .menu button { display: flex; justify-content: space-between; gap: 16px; padding: 7px 10px; border: 0; border-radius: 4px; background: none; font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; } .menu button:hover:not(:disabled) { background: var(--accent-soft); } .menu button:disabled { opacity: 0.45; cursor: default; } .menu-note { margin: 2px 10px 6px; color: var(--muted); font-size: 12.5px; } .menu button span { color: var(--muted); font-weight: 500; } .play-body { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--split) 6px 1fr; } .play-source { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); } .pane-head { display: flex; align-items: center; gap: 8px; flex: none; height: 44px; padding: 0 10px; border-bottom: 1px solid var(--line); } .select { position: relative; display: inline-flex; align-items: center; height: 30px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font-size: 13.5px; transition: border-color 140ms; } .select:hover { border-color: var(--muted); } .select:first-child { min-width: 0; flex: 1; max-width: 280px; } .select-label { padding-left: 10px; color: var(--muted); } .select select { min-width: 0; width: 100%; height: 100%; padding: 0 26px 0 10px; border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--text); appearance: none; cursor: pointer; outline: none; } .select::after { content: ''; position: absolute; right: 10px; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-2px) rotate(45deg); pointer-events: none; } .select:focus-within { border-color: var(--accent); } .code-editor { flex: 1; min-height: 0; } .play-status { flex: none; height: 34px; padding: 0 14px; border: 0; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 12.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; } .play-status:disabled { cursor: default; } .play-status.is-error { color: var(--danger); } .play-split { cursor: col-resize; background: var(--line); background-clip: content-box; padding: 0 2.5px; touch-action: none; transition: background-color 140ms; } .play-split:hover { background-color: var(--accent); } .play-diagram { position: relative; min-width: 0; min-height: 0; } .play-diagram:fullscreen { background: var(--canvas); } .diagram-view { position: absolute; inset: 0; overflow: hidden; background: var(--canvas); cursor: grab; user-select: none; touch-action: none; transition: opacity 120ms; } .diagram-view:active { cursor: grabbing; } .diagram-view.is-stale .diagram-stage { opacity: 0.4; } .diagram-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; transition: opacity 120ms; } .diagram-stage svg { display: block; } .diagram-stage [data-id] { cursor: pointer; transition: opacity 140ms; } /* Boxes that drag show a move cursor; the canvas around them pans. */ .diagram-stage .is-drag { cursor: move; } .diagram-view.is-moving, .diagram-view.is-moving .is-drag { cursor: grabbing; } .diagram-stage .is-lifted > .shape { filter: drop-shadow(0 6px 10px #15171f33); } .has-linked .diagram-stage [data-id]:not(.is-linked) { opacity: 0.32; } .has-linked .diagram-stage [data-id].is-linked [data-id] { opacity: 1; } .diagram-tools { position: absolute; right: 12px; bottom: 12px; display: flex; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 8px #25213b14; cursor: default; } .diagram-tools button { display: grid; place-items: center; min-width: 32px; height: 30px; padding: 0 8px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; transition: background-color 140ms; } .diagram-tools button + button { border-left: 1px solid var(--line); } .diagram-tools button:hover { background: var(--bg); } .diagram-zoom { min-width: 56px !important; font-variant-numeric: tabular-nums; } .diagram-tools svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; } @media (max-width: 900px) { .play-head { gap: 14px; padding: 0 10px; } .play-nav { display: none; } .play-actions .tool:not(.primary) { padding: 0 9px; } .play-body { grid-template-columns: 1fr; grid-template-rows: 42% 1fr; } .play-diagram { order: -1; border-bottom: 1px solid var(--line); } .play-split { display: none; } } /* Playground: picker, problems, hints, drop and hover help */ .tool.quiet { height: 30px; margin-left: auto; border-color: transparent; color: var(--muted); font-weight: 500; } .tool.quiet:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); } .picker { position: relative; min-width: 0; flex: 0 1 280px; } .picker-new { flex: none; height: 30px; padding: 0 10px; } .picker-button { position: relative; width: 100%; height: 30px; padding: 0 28px 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; transition: border-color 140ms; } .picker-button span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .picker-button::after { content: ''; position: absolute; top: 11px; right: 11px; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); } .picker-button:hover, .picker-button[aria-expanded='true'] { border-color: var(--muted); } .picker-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; display: flex; flex-direction: column; width: min(760px, calc(100vw - 24px)); max-height: min(620px, calc(100vh - 120px)); border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: 0 16px 48px #25213b2e; } .picker-search { flex: none; margin: 10px; height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); font: inherit; font-size: 14px; outline: none; } .picker-search:focus { border-color: var(--accent); } .picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 10px 10px; overflow-y: auto; } .picker-card { display: flex; flex-direction: column; gap: 2px; padding: 6px 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit; text-align: left; cursor: pointer; transition: border-color 140ms; } .picker-card:hover { border-color: var(--line-strong); } .picker-card[aria-current='true'] { border-color: var(--accent); } .picker-card strong { margin: 6px 4px 0; font-size: 13.5px; } .picker-card > span:last-child { margin: 0 4px; color: var(--muted); font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .picker-thumb { display: grid; place-items: center; overflow: hidden; height: 96px; padding: 6px; border-radius: 4px; background: var(--canvas); } .picker-thumb img { display: block; width: 100%; height: 84px; object-fit: contain; } .picker-blank .picker-thumb { color: var(--muted); font-size: 28px; font-weight: 300; border: 1px dashed var(--line-strong); background: none; } .picker-empty { margin: 0; padding: 0 14px 16px; color: var(--muted); font-size: 13.5px; } mark { background: #f7e3a6; color: inherit; border-radius: 2px; } .play-status-wrap { position: relative; flex: none; } .play-status { display: flex; gap: 12px; width: 100%; } .play-status > span:first-child { overflow: hidden; text-overflow: ellipsis; } .play-hint { margin-left: auto; color: #a3a8b8; flex: none; } .play-status.is-error .play-hint { display: none; } .problems { position: absolute; bottom: calc(100% + 4px); left: 8px; right: 8px; z-index: 20; max-height: 260px; margin: 0; padding: 4px; overflow-y: auto; list-style: none; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); box-shadow: 0 10px 30px #25213b24; } .problems button { display: flex; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 4px; background: none; color: #8a6420; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; } .problems button.is-error { color: var(--danger); } .problems button:hover { background: var(--bg); } .problem-line { flex: none; min-width: 52px; color: var(--muted); font-variant-numeric: tabular-nums; } .drop-veil { position: fixed; inset: 12px; z-index: 50; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 12px; background: #f5f6f9e6; color: var(--accent); font-size: 17px; font-weight: 700; pointer-events: none; } .drop-veil.is-error { border-color: var(--danger); color: var(--danger); } .help { max-width: 440px; padding: 4px 0; } .help-row { padding: 6px 12px; } .help-row + .help-row { border-top: 1px solid var(--line); } .help-row code { font-size: 12.5px; white-space: pre-wrap; } .help-row p { margin: 4px 0 0; color: var(--text); font-size: 13px; line-height: 1.45; } .help-row a { display: inline-block; margin-top: 4px; color: var(--accent); font-size: 12.5px; font-weight: 600; text-decoration: none; } @media (max-width: 900px) { .play-actions .tool:not(.primary) { font-size: 0; gap: 0; } .play-hint, .tool.quiet { display: none; } .picker-grid { grid-template-columns: repeat(2, 1fr); } } .help-row p code { padding: 0 3px; border-radius: 3px; background: var(--bg); font-size: 12px; } .tool .short { display: none; } @media (max-width: 900px) { .tool .long { display: none; } .tool .short { display: inline; } } @media (max-width: 520px) { .select-label { display: none; } } /* 100x: focus, empty states, warnings, skeletons, splitter, narrow panes */ .tool:focus-visible, .picker-button:focus-visible, .picker-card:focus-visible, .menu button:focus-visible, .problems button:focus-visible, .play-status:focus-visible, .diagram-tools button:focus-visible, .play-split:focus-visible, .play-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } .select:has(select:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; } .diagram-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; pointer-events: none; } .diagram-empty p { margin: 0; } .diagram-empty div { display: flex; justify-content: center; gap: 8px; pointer-events: auto; } .diagram-tools[hidden] { display: none; } .play-status.is-warning { color: #8a6420; } .play-hint { color: var(--muted); } @keyframes skeleton { 50% { opacity: 0.55; } } .picker-thumb:not(:has(img)) { animation: skeleton 1.2s ease-in-out infinite; } .picker-blank .picker-thumb { animation: none; } @media (prefers-reduced-motion: reduce) { .picker-thumb, .tool.is-done svg { animation: none !important; } } .play-body { grid-template-columns: var(--split) 9px 1fr; } .play-split { padding: 0 4px; } .menu button, .problems button { transition: background-color 140ms; } /* The source pane's header adapts to the pane's own width, which the splitter changes. */ .play-source { container-type: inline-size; } @container (max-width: 470px) { .select-label { display: none; } } @container (max-width: 380px) { .tool.quiet { display: none; } } @media (max-width: 520px) { .diagram-tools button { min-width: 28px; height: 26px; } .diagram-zoom { min-width: 46px !important; } } /* The theme select keeps its full name; the example picker gives up width first. */ .pane-head .select { flex: none; } .pane-head .select select { width: auto; } /* Docs (site/docs) */ .docs { --top: 56px; --side: 248px; --frame: 1480px; min-height: 100vh; background: var(--surface); } .docs-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 28px; height: var(--top); /* The bar's content sits in the same frame as the body, so search lines up with the sidebar. */ padding: 0 max(24px, calc((100% - var(--frame)) / 2 + 24px)); border-bottom: 1px solid var(--line); background: #fffffff2; backdrop-filter: blur(8px); } .docs-top .wordmark { width: calc(var(--side) - 52px); flex: none; } .docs-search-button { display: flex; align-items: center; gap: 8px; width: min(380px, 100%); height: 34px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; transition: border-color 140ms; } .docs-search-button:hover { border-color: var(--line-strong); } .docs-search-button kbd { margin-left: auto; } kbd { display: inline-block; min-width: 20px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); font: 500 11px / 16px var(--font); text-align: center; } .docs-search-icon { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; } .docs-top-links { display: flex; gap: 24px; margin-left: auto; font-size: 14px; } .docs-top-links a { color: var(--muted); text-decoration: none; transition: color 140ms; } .docs-top-links a:hover, .docs-top-links a.is-active { color: var(--accent); } .docs-menu-button { display: none; } .docs-body { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) 224px; max-width: var(--frame); margin: 0 auto; } .docs-side, .docs-toc { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; scrollbar-width: thin; } .docs-side { padding: 20px 12px 40px 24px; border-right: 1px solid var(--line); } .docs-side section + section { margin-top: 18px; } .docs-side h2, .docs-toc h2 { margin: 0 0 4px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; } .docs-toc h2 { color: var(--text); font-size: 13px; letter-spacing: 0; text-transform: none; } .docs-side a, .docs-toc a { display: block; padding: 3px 10px; margin-left: -10px; border-radius: 5px; color: var(--text); font-size: 14px; line-height: 1.45; text-decoration: none; transition: color 140ms, background-color 140ms; } .docs-side a:hover, .docs-toc a:hover { color: var(--accent); } .docs-side a.is-current { background: var(--accent-soft); color: var(--accent); font-weight: 600; } .docs-toc { padding: 28px 24px 40px 8px; } .docs-toc a { margin-left: 0; padding: 3px 0; color: var(--muted); font-size: 13px; } .docs-toc a.is-sub { padding-left: 12px; } .docs-toc a.is-current { color: var(--accent); font-weight: 600; } .docs-toc .docs-edit { margin-top: 14px; color: var(--muted); font-size: 12.5px; } .docs-toc h2 ~ .docs-edit { padding-top: 12px; border-top: 1px solid var(--line); } .docs-main { min-width: 0; padding: 24px 48px 64px; } /* Article */ .doc { max-width: 920px; margin: 0 auto; font-size: 15.5px; line-height: 1.65; } .doc-crumbs { display: flex; gap: 8px; color: var(--muted); font-size: 13px; } .doc-crumbs a { color: var(--muted); text-decoration: none; } .doc-crumbs a:hover { color: var(--accent); } .doc-crumbs span:last-child { color: var(--text); } .doc h1 { margin: 6px 0 0; font-size: 34px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; } .doc-lead { margin: 10px 0 8px; color: var(--muted); font-size: 17px; line-height: 1.6; } .doc h2, .doc h3, .doc h4 { scroll-margin-top: calc(var(--top) + 16px); letter-spacing: -0.015em; line-height: 1.3; } .doc h2 { margin: 36px 0 8px; font-size: 22px; font-weight: 750; } .doc h3 { margin: 28px 0 6px; font-size: 17px; font-weight: 700; } .doc .doc-anchor { color: inherit; white-space: normal; text-decoration: none; } .doc-anchor::after { content: '#'; margin-left: 8px; color: #a3a8b8; opacity: 0; transition: opacity 140ms; } .doc-anchor:hover::after { opacity: 1; } .doc p, .doc ul, .doc ol { margin: 10px 0; } .doc ul, .doc ol { padding-left: 22px; } .doc li + li { margin-top: 4px; } .doc-md a, .doc-lead a { color: var(--accent); text-decoration: none; white-space: nowrap; transition: color 140ms; } .doc-md a:hover, .doc-lead a:hover { color: var(--accent-hover); } /* A link that leaves for GitHub carries its mark. */ .doc-md a[href^='https://github.com/']::after { content: ''; display: inline-block; width: 0.8em; height: 0.8em; margin-left: 0.25em; vertical-align: -0.05em; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 0 0-2.53 15.59c.4.07.55-.17.55-.38v-1.33c-2.23.48-2.7-1.07-2.7-1.07-.36-.92-.89-1.17-.89-1.17-.73-.5.05-.49.05-.49.8.06 1.23.83 1.23.83.72 1.22 1.87.87 2.33.66.07-.52.28-.87.5-1.07-1.78-.2-3.65-.89-3.65-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.6 7.6 0 0 1 4 0c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.28.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48v2.2c0 .21.15.46.55.38A8 8 0 0 0 8 0z'/%3E%3C/svg%3E") center / contain no-repeat; opacity: 0.7; } /* The docs home: its three sections side by side where there is room. */ @media (min-width: 1280px) { .doc[data-page='start'] .doc-md { columns: 3; column-gap: 32px; } .doc[data-page='start'] .doc-md > * { max-width: none; } .doc[data-page='start'] .doc-md h2 { margin-top: 0; } .doc[data-page='start'] .doc-md h2:not(:first-child) { break-before: column; } .doc[data-page='start'] .doc-md li { break-inside: avoid; } .doc[data-page='start'] .doc-md > p:last-child { column-span: all; margin-top: 28px; } } .doc :not(pre) > code { padding: 1px 3px; border-radius: 4px; background: var(--bg); font-size: 0.86em; overflow-wrap: anywhere; } .doc strong { font-weight: 700; } /* Tables may bleed wider than the text; they scroll when the screen is narrower. */ .doc-table { margin: 14px 0; overflow-x: auto; } .doc table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; } .doc th, .doc td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; } .doc th { color: var(--muted); font-size: 12.5px; font-weight: 600; } /* Table code never breaks mid-word; a table too wide for the screen scrolls in its box. */ .doc td code { white-space: nowrap; overflow-wrap: normal; } .doc-code { position: relative; margin: 14px 0; } .doc-code pre { margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); font: 500 13px / 20px var(--mono); font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: anywhere; } .doc-copy, .doc-link-button, .doc-inline-button { border: 0; background: none; color: var(--muted); font: 600 12px var(--font); cursor: pointer; transition: color 140ms; } .doc-link-button { height: 24px; padding: 0 6px; border-radius: 4px; } .doc-copy:active, .doc-link-button:active, .zoom-bar button:active { color: var(--text); } /* A button that reads as a link inside text. */ .doc-inline-button { padding: 0; color: var(--accent); font: inherit; } .doc-inline-button:hover { color: var(--accent-hover); } /* One focus ring for everything in the docs. The editable source draws it on its box. */ .docs :focus-visible, .search :focus-visible, .zoom :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; } .docs .doc-example-text:focus-visible, .search-field input:focus-visible { outline: none; } .doc-drawing:focus-visible { outline-offset: -3px; } .doc-copy { position: absolute; top: 8px; right: 8px; padding: 2px 6px; border-radius: 4px; background: var(--canvas); opacity: 0; } .doc-code:hover .doc-copy, .doc-copy:focus-visible { opacity: 1; } /* A touch screen has no hover, so Copy stays on, with its own row above the first line of code. */ @media (hover: none) { .doc-copy { top: 2px; right: 2px; padding: 6px 10px; opacity: 1; } .doc-code pre { padding-top: 30px; } } .doc-copy:hover, .doc-link-button:hover { color: var(--accent); } /* A copy confirms with a short pulse on the button itself. */ .is-copied { animation: copied 700ms ease-out; } @keyframes copied { 0% { color: #2d7a5c; transform: scale(1.12); } 100% { transform: none; } } ::highlight(search) { background: #ffe58a; color: inherit; } /* Live examples. They may run wider than the prose. */ .doc-example { margin: 18px 0 24px; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; } .doc-example-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--bg); } /* The emphasis states of an example, one button each, like the Editor's chips. */ .doc-example-states { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; min-height: 34px; padding: 4px 12px; border-bottom: 1px solid var(--line); background: var(--bg); font: 600 12px var(--font); } .doc-example-states span { margin-right: 4px; color: var(--muted); font-weight: 500; } .doc-example-states button { height: 24px; padding: 0 8px; border: 0; border-radius: 4px; background: none; color: var(--text); font: inherit; cursor: pointer; transition: color 140ms, background-color 140ms; } .doc-example-states button:hover { color: var(--accent); } .doc-example-states button[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); } .doc-example-label { min-width: 0; margin-right: auto; overflow: hidden; color: var(--muted); font: 500 12px var(--mono); white-space: nowrap; } .doc-example-label span { color: #6a7082; font-family: var(--font); } .doc-example-play { margin-left: 6px; color: var(--accent); font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; } .doc-example-play:hover { color: var(--accent-hover); } @media (max-width: 520px) { .doc-example-label span { display: none; } } .doc-example.is-split .doc-example-body { display: grid; /* The source takes the width its longest line needs, up to 60%; the drawing takes the rest. */ grid-template-columns: fit-content(60%) minmax(0, 1fr); } .doc-example-source { display: flex; align-items: flex-start; padding: 10px 0; background: var(--surface); font: 500 13px / 20px var(--mono); overflow-x: auto; } .doc-example-gutter { margin: 0; padding: 0 10px 0 12px; min-width: 38px; color: #a3a8b8; font: inherit; text-align: right; user-select: none; } /* The highlighted copy sits under a transparent textarea with the same metrics. */ .doc-example-code { position: relative; flex: 1; min-width: max-content; isolation: isolate; } /* The line of the state picked in the State row. One line is 20px, as in .doc-example-source. */ .doc-example-mark { position: absolute; right: 0; left: 0; z-index: -1; height: 20px; background: var(--accent-soft); } .doc-example-hl, .doc-example-text { margin: 0; padding: 0 16px 0 4px; border: 0; font: inherit; font-variant-ligatures: none; white-space: pre; tab-size: 2; } .doc-example-text { position: absolute; inset: 0; width: 100%; outline: none; resize: none; overflow: hidden; background: none; color: transparent; caret-color: var(--text); } .doc-example-text::selection { background: #6650d92e; } .doc-example-source:focus-within { background: #fdfcff; } .doc-example-source:has(.doc-example-text:focus-visible:not([data-pointer])) { outline: 2px solid var(--accent); outline-offset: -2px; } .doc-drawing { position: relative; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--canvas); cursor: zoom-in; user-select: none; } .doc-example > .doc-example-body > .doc-drawing { border-top: 1px solid var(--line); } .doc-example.is-split > .doc-example-body > .doc-drawing { border-top: 0; border-left: 1px solid var(--line); } .doc-drawing-svg { display: flex; justify-content: center; min-width: 0; transition: opacity 120ms; } .doc-drawing-svg svg { display: block; max-width: 100%; max-height: 520px; height: auto; } .doc-drawing.is-stale .doc-drawing-svg { opacity: 0.4; } .doc-drawing-error { position: absolute; left: 10px; right: 10px; bottom: 10px; margin: 0; padding: 6px 10px; border: 1px solid #ecc5cc; border-radius: 6px; background: #fff7f8; color: var(--danger); font-size: 12.5px; line-height: 1.4; } .doc-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); } .doc-theme { display: flex; flex-direction: column; margin: 0; background: var(--surface); } .doc-theme figcaption { padding: 6px 12px; font-size: 12px; } .doc-theme figcaption code { padding: 0; background: none; } .doc-theme .doc-drawing { flex: 1; height: 250px; padding: 10px 14px 14px; } /* The default theme leads, across both columns. */ .doc-theme:first-child { grid-column: 1 / -1; } .doc-theme:first-child .doc-drawing { height: 340px; } .doc-theme figcaption span { color: var(--muted); } .doc-theme .doc-drawing-svg, .doc-theme .doc-drawing-svg svg { width: 100%; height: 100%; max-height: none; } /* Full-window drawing */ .zoom { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; } .zoom-bar { display: flex; align-items: center; gap: 16px; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; } .zoom-bar span { margin-right: auto; line-height: 1.2; } /* The full hint needs three lines in a narrow bar, and the bar holds two. */ .zoom-hint-short { display: none; } @media (max-width: 440px) { .zoom-hint-long { display: none; } .zoom-hint-short { display: inline; } } /* The drawing below is the last good one, so the overlay says so. */ .zoom-notice { margin: 0; padding: 8px 16px; border-bottom: 1px solid #ecc5cc; background: #fff7f8; color: var(--danger); font-size: 13px; line-height: 1.4; } .zoom-bar button { height: 28px; min-width: 32px; padding: 0 6px; border: 0; background: none; color: var(--accent); font: 600 13px var(--font); cursor: pointer; transition: color 140ms; } .zoom-bar button:hover { color: var(--accent-hover); } .zoom-stage { position: relative; flex: 1; overflow: hidden; cursor: grab; user-select: none; touch-action: none; } .zoom-stage:active { cursor: grabbing; } .zoom-paper { position: absolute; top: 0; left: 0; transform-origin: 0 0; } .zoom-paper svg { display: block; } /* Prose keeps a reading width; examples and tables use the whole column. */ .doc-crumbs, .doc h1, .doc-lead, .doc-md > :not(.doc-table, .doc-code) { max-width: 700px; } .doc code, .doc pre { font-variant-ligatures: none; } /* Previous and next */ .doc-pager { display: flex; justify-content: space-between; gap: 24px; max-width: 920px; margin: 48px auto 0; padding-top: 18px; border-top: 1px solid var(--line); } .doc-pager a { display: flex; flex-direction: column; color: var(--accent); font-weight: 600; text-decoration: none; } .doc-pager a:hover { color: var(--accent-hover); } .doc-pager a.is-next { align-items: flex-end; text-align: right; } .doc-pager small { color: var(--muted); font-size: 12.5px; font-weight: 500; } /* The Playground's code could not be fetched. */ .load-failed { display: grid; justify-items: center; align-content: center; gap: 12px; min-height: 100dvh; padding: 24px; text-align: center; } .load-failed h1 { margin: 12px 0 0; font-size: 20px; } .load-failed p { margin: 0; color: var(--muted); } /* Search */ .search-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 10vh 16px 16px; border: 0; background: #15171f33; } .search { display: flex; flex-direction: column; width: min(640px, 100%); /* One height for every query, so the box does not jump as results change. */ height: min(520px, calc(100dvh - 10vh - 16px)); border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: 0 18px 50px #25213b29; overflow: hidden; } .search-field { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); } .search-field input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--text); font: inherit; font-size: 16px; } .search-results { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; } .search-hit { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); text-decoration: none; } .search-hit.is-active { background: var(--accent-soft); } .search-hit-title { display: block; font-size: 14px; font-weight: 600; } .search-hit-sep { margin: 0 6px; color: var(--muted); font-weight: 500; } .search-hit-text { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; } .search mark { border-radius: 2px; background: #ffe58a; color: inherit; } .search-empty { margin: 0; padding: 18px 10px; color: var(--muted); font-size: 14px; } .search-foot { display: flex; gap: 16px; padding: 7px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; } .search-foot kbd + kbd { margin-left: 2px; } .search-count { margin-left: auto; } @media (max-width: 1180px) { .docs { --side: 232px; } .docs-body { grid-template-columns: var(--side) minmax(0, 1fr); } .docs-toc { display: none; } } @media (max-width: 820px) { .docs-top { gap: 12px; padding: 0 16px; } .docs-top .wordmark { width: auto; min-height: 40px; } .docs-search-button { width: auto; height: 40px; flex: 1; } .docs-top .site-nav { gap: 8px; } .docs-top .site-nav a { min-height: 40px; } .docs-top .site-nav-gh { min-width: 36px; } .docs-search-button kbd, .docs-top-links { display: none; } .docs-menu-button { display: block; min-height: 40px; border: 0; background: none; color: var(--accent); font: 600 14px var(--font); cursor: pointer; } .docs-body { display: block; } .docs-side { display: none; position: fixed; inset: var(--top) 0 0; z-index: 9; height: auto; background: var(--surface); border-right: 0; } .docs-side.is-open { display: block; } body.docs-menu-open { overflow: hidden; } .docs-main { padding: 16px 16px 48px; } .doc h1 { font-size: 28px; } .doc-lead { font-size: 16px; } /* Cells wrap to fit the box. These floors keep text readable; past them, the box scrolls. */ .doc td { min-width: 14ch; } .doc td:last-child { min-width: 24ch; } .doc-themes { grid-template-columns: 1fr; } .doc-example.is-split .doc-example-body { display: block; } .doc-example.is-split > .doc-example-body > .doc-drawing { border-left: 0; border-top: 1px solid var(--line); } .zoom-bar { gap: 8px; } } /* Each bar button is a finger's size, inside the bar's 44px. */ @media (pointer: coarse) { .zoom-bar button { height: 40px; min-width: 40px; } } @media (prefers-reduced-motion: reduce) { .is-copied { animation: none; } } /* Reopening a file: the picker's file button sits beside the search. */ .picker-top { display: flex; gap: 8px; margin: 10px; } .picker-top .picker-search { flex: 1; margin: 0; } .picker-file { height: 34px; flex: none; } .picker-file:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; } .hero-reopen { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; } .hero-reopen.is-error { color: var(--danger); } .hero-reopen-pick { padding-block: 4px; color: var(--accent); cursor: pointer; white-space: nowrap; } .hero-reopen-pick:hover { color: var(--accent-hover); } .hero-reopen-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; } /* A file without source is a corner toast, not a veil over the page. */ .drop-veil.is-error { inset: auto 16px 16px auto; display: block; max-width: 420px; padding: 12px 16px; border: 1px solid #e7b9c1; border-radius: 8px; background: var(--surface); box-shadow: 0 10px 30px #25213b24; font-size: 13.5px; font-weight: 600; pointer-events: auto; cursor: pointer; } /* The shared site nav (site/SiteNav.tsx): one look on every page. The containers above still set the gaps and where the nav sits. */ .site-nav { display: flex; align-items: center; gap: 24px; font-size: 14px; } .site-nav a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 24px; min-height: 24px; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; transition: color 140ms; } .site-nav a:hover { color: var(--text); } .site-nav a[aria-current='page'] { color: var(--accent); font-weight: 600; } .site-nav-gh svg { width: 14px; height: 14px; fill: currentColor; } /* Narrow screens keep the two site sections and GitHub as an icon, in every header. */ @media (max-width: 820px) { .site-nav.docs-top-links, .site-nav.play-nav { display: flex; } .site-nav { gap: 14px; } .site-nav-more, .site-nav-label { display: none !important; } .site-nav-gh svg { width: 18px; height: 18px; } } /* Phones: the docs and playground headers keep the nav by showing the mark without its name and search as an icon. */ @media (max-width: 560px) { .site-nav-editor { display: none !important; } .docs-top { gap: 8px; } .docs-top .wordmark, .play-head .wordmark { font-size: 0; gap: 0; } .docs-search-button { flex: none; width: auto; min-width: 0; } .docs-search-button span, .docs-search-button kbd { display: none; } } /* After an example replaces custom work: name what was replaced and offer it back. */ .play-notice { display: flex; align-items: center; gap: 10px; flex: none; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); background: var(--accent-soft); font-size: 13px; } .play-notice > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .play-notice .tool { height: 28px; margin-left: auto; flex: none; } .play-notice-close { flex: none; width: 28px; height: 28px; border: 0; border-radius: var(--radius); background: none; color: var(--muted); font-size: 18px; cursor: pointer; } .play-notice-close:hover { color: var(--text); } .play-notice-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } /* Tablets stack the drawing over the source. This repeats the 900px rule above, which the splitter's later grid-template-columns would otherwise undo. */ @media (max-width: 900px) { .play-body { grid-template-columns: 1fr; grid-template-rows: 42% 1fr; } } /* Phones show one pane at a time behind a Source / Diagram tab switch. */ .play-tabs { display: none; } @media (max-width: 699px) { .play-tabs { display: flex; flex: none; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface); } .play-tabs button { flex: 1; height: 32px; border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; } .play-tabs button[aria-selected='true'] { border-color: var(--line-strong); background: var(--bg); color: var(--text); } .play-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } .play-body { grid-template-rows: 1fr; } .play-body[data-tab='source'] .play-diagram, .play-body[data-tab='diagram'] .play-source { display: none; } .play-diagram { border-bottom: 0; } } /* The diagram's text outline. Closed, it is visually hidden but still read by screen readers. */ .diagram-outline-toggle { position: absolute; top: 12px; left: 12px; z-index: 3; height: 30px; } .diagram-outline:not(.is-open) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } .diagram-outline.is-open { position: absolute; top: 50px; left: 12px; z-index: 3; width: min(300px, calc(100% - 24px)); max-height: calc(100% - 110px); overflow-y: auto; padding: 10px 6px 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); box-shadow: 0 10px 30px #25213b24; font-size: 13px; } .diagram-outline h2 { margin: 0 8px 2px; font-size: 14px; } .diagram-outline p { margin: 0 8px 6px; color: var(--muted); font-size: 12.5px; } .diagram-outline h3 { margin: 8px 8px 2px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; } .diagram-outline ul { margin: 0; padding: 0; list-style: none; } .diagram-outline button { display: block; width: 100%; padding: 5px 8px; border: 0; border-radius: 4px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; } .diagram-outline button:hover { background: var(--accent-soft); } .diagram-outline button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }