Public: anyone can read this; the crew can change it.
Motion that feels native: one strong ease-out, transform and opacity only, interruptible enters, no motion on frequent actions, lint-enforced #16816
Check · Review · Land · Live done — Landed and live in production.
motion-rules → main 0 commits
18 files
changed +428
−147
- docs/design/feel-allow.json
- docs/design/sections/4-space-radius-motion.md
- docs/design/size-budget.json
- scripts/design-lint.ts
- src/design/feel.ts
- src/design/motion.ts
- src/web/pages/account.ts
- src/web/pages/build_info.ts
- src/web/pages/home_flow_style.ts
- src/web/pages/map.ts
- src/web/pages/talk_client.ts
- src/web/pick.ts
- src/web/style/base.ts
- src/web/style/components.ts
- src/web/style/content.ts
- src/web/talk_parts.ts
- test/components-reduced-motion.test.ts
- test/design-lint-feel.test.ts
docs/design/feel-allow.json added +26
| @@ -0,0 +1,26 @@ | ||
| 1 | [ | |
| 2 | { | |
| 3 | "file": "src/web/style/base.ts", | |
| 4 | "rule": "prop", | |
| 5 | "text": "background-color 200ms var(--ease), color 200ms var(--ease)", | |
| 6 | "why": "The theme switcher's one sweep: colours cross-fade once, on a rare and deliberate choice, for the 200 ms the class is on; snapping every surface at once reads as a flash." | |
| 7 | }, | |
| 8 | { | |
| 9 | "file": "src/web/pages/talk_client.ts", | |
| 10 | "rule": "prop", | |
| 11 | "text": "height var(--dur-3) var(--ease), padding var(--dur-3) var(--ease)", | |
| 12 | "why": "The confirm dock collapsing after an answer: its height is what moves the composer and the thread back down. A scaleY with a clip would leave the space standing until the end and then jump, which is the shift this avoids." | |
| 13 | }, | |
| 14 | { | |
| 15 | "file": "src/web/pages/home_flow_style.ts", | |
| 16 | "rule": "slow", | |
| 17 | "text": "hf-arrive 900ms", | |
| 18 | "why": "A highlight that marks a tile that arrived while you were reading, not an answer to anything you did; at 300 ms it is over before the eye gets there." | |
| 19 | }, | |
| 20 | { | |
| 21 | "file": "src/web/studio/style.ts", | |
| 22 | "rule": "slow", | |
| 23 | "text": "studio-flash 1.1s", | |
| 24 | "why": "The same: a card the live client changed under you flashes once so you see which; nothing waits on it and it never moves anything." | |
| 25 | } | |
| 26 | ] |
docs/design/sections/4-space-radius-motion.md +26 −4
| @@ -14,10 +14,32 @@ nest: 0 | ||
| 14 | 14 | all — that is where the double line at the end of a list comes from. |
| 15 | 15 | - **Density**: dense rows (files, commits, issues) 40px; anything touchable is |
| 16 | 16 | ≥44px under `@media (pointer: coarse)` — via padding, so text stays centered. |
| 17 | - **Motion**: 100–200ms, `cubic-bezier(.2,0,0,1)`, enter only. Only `color`, | |
| 18 | `background-color`, `border-color`, `opacity` and `transform` are ever | |
| 19 | animated. Never `height`, never `box-shadow` on scroll. Everything is inside | |
| 20 | the `prefers-reduced-motion` kill switch. `bun scripts/design-lint.ts` refuses | |
| 17 | - **Motion has a job, or it goes** (after Emil Kowalski's rules): feedback, where a | |
| 18 | thing came from, or a change of state. Nothing moves on what a person does a | |
| 19 | hundred times a day or from the keyboard: the palette opens and closes still, | |
| 20 | your own sent message lands still, toggles snap. What arrives on its own (a | |
| 21 | toast, someone else's reply in Talk, a live row) keeps its enter. | |
| 22 | - **Curves and times**: one strong ease-out, `--ease` (`cubic-bezier(.23,1,.32,1)`), | |
| 23 | for anything entering or leaving; `--ease-move` (ease-in-out) only for a thing | |
| 24 | moving on screen; never ease-in. A press `--dur-1` (100ms), a hover, a tooltip or a | |
| 25 | popover `--dur-2` (140ms), an arrival `--dur-3` (200ms); nothing over 300ms. | |
| 26 | - **Physics**: only `transform` and `opacity` are animated; a colour, a size or a | |
| 27 | place changes at once. Nothing grows from nothing: an enter starts at | |
| 28 | `scale(.95)`, from its trigger's corner (`transform-origin`) for a popover or a | |
| 29 | menu, centred for a modal. A button gives under the press (`:active` `scale(.97)`). | |
| 30 | Anything a person can reverse (a menu, a dialog, a card) enters by a transition | |
| 31 | from `@starting-style`, so it can be cut short; where the browser does not know | |
| 32 | the at-rule the element simply appears whole. A peek card waits 400ms the first | |
| 33 | time, then the next opens at once while one was just open. | |
| 34 | - **Hover** lives inside `@media (hover: hover) and (pointer: fine)`, so a tap never | |
| 35 | leaves one stuck. Reduced motion keeps every fade and drops every travel | |
| 36 | (`transition-property: opacity`), and collapses animations. | |
| 37 | - `src/design/feel.ts`, run by `bun scripts/design-lint.ts`, refuses ease-in, more | |
| 38 | than 300ms on a transition or a one-shot animation (a loop is an indicator), a | |
| 39 | `scale(0)`, a transition of anything but `transform` and `opacity`, and a hover | |
| 40 | outside the hover query. The real exceptions are in `docs/design/feel-allow.json`, | |
| 41 | each with its reason, and one that no longer finds its rule fails too. | |
| 42 | - Everything is inside the `prefers-reduced-motion` kill switch. `bun scripts/design-lint.ts` refuses | |
| 21 | 43 | an `animation` or `transition` over 100ms (naming its selector) unless a |
| 22 | 44 | `@media (prefers-reduced-motion: reduce)` rule in the same sheet turns it off, |
| 23 | 45 | or it sits inside `(prefers-reduced-motion: no-preference)`. It reads the |
docs/design/size-budget.json +28 −28
| @@ -1,78 +1,78 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "/": { |
| 3 | "js": 24320, | |
| 4 | "css": 50432 | |
| 3 | "js": 24576, | |
| 4 | "css": 51712 | |
| 5 | 5 | }, |
| 6 | 6 | "/explore": { |
| 7 | "js": 24064, | |
| 8 | "css": 50432 | |
| 7 | "js": 24320, | |
| 8 | "css": 51712 | |
| 9 | 9 | }, |
| 10 | 10 | "/map": { |
| 11 | 11 | "js": 31744, |
| 12 | "css": 51968 | |
| 12 | "css": 53248 | |
| 13 | 13 | }, |
| 14 | 14 | "/:owner/:name": { |
| 15 | 15 | "js": 41216, |
| 16 | "css": 50432 | |
| 16 | "css": 51712 | |
| 17 | 17 | }, |
| 18 | 18 | "/changelog": { |
| 19 | 19 | "js": 29696, |
| 20 | "css": 50432 | |
| 20 | "css": 51712 | |
| 21 | 21 | }, |
| 22 | 22 | "/:owner/:name/next": { |
| 23 | "js": 25856, | |
| 24 | "css": 50688 | |
| 23 | "js": 26112, | |
| 24 | "css": 51968 | |
| 25 | 25 | }, |
| 26 | 26 | "/:owner/:name/space": { |
| 27 | 27 | "js": 33024, |
| 28 | "css": 51456 | |
| 28 | "css": 52736 | |
| 29 | 29 | }, |
| 30 | 30 | "/:owner/:name/space.json": { |
| 31 | 31 | "js": 0, |
| 32 | 32 | "css": 0 |
| 33 | 33 | }, |
| 34 | 34 | "/maintenance": { |
| 35 | "js": 24064, | |
| 36 | "css": 50432 | |
| 35 | "js": 24320, | |
| 36 | "css": 51712 | |
| 37 | 37 | }, |
| 38 | 38 | "/pricing": { |
| 39 | "js": 24064, | |
| 40 | "css": 50432 | |
| 39 | "js": 24320, | |
| 40 | "css": 51712 | |
| 41 | 41 | }, |
| 42 | 42 | "/forges/new": { |
| 43 | "js": 24064, | |
| 44 | "css": 50432 | |
| 43 | "js": 24320, | |
| 44 | "css": 51712 | |
| 45 | 45 | }, |
| 46 | 46 | "/claim": { |
| 47 | 47 | "js": 27136, |
| 48 | "css": 50432 | |
| 48 | "css": 51712 | |
| 49 | 49 | }, |
| 50 | 50 | "/templates": { |
| 51 | "js": 24064, | |
| 52 | "css": 50432 | |
| 51 | "js": 24320, | |
| 52 | "css": 51712 | |
| 53 | 53 | }, |
| 54 | 54 | "/system": { |
| 55 | "js": 25856, | |
| 56 | "css": 50432 | |
| 55 | "js": 26112, | |
| 56 | "css": 51712 | |
| 57 | 57 | }, |
| 58 | 58 | "/feed": { |
| 59 | 59 | "js": 39168, |
| 60 | "css": 50432 | |
| 60 | "css": 51712 | |
| 61 | 61 | }, |
| 62 | 62 | "/board": { |
| 63 | "js": 28928, | |
| 64 | "css": 50432 | |
| 63 | "js": 29184, | |
| 64 | "css": 51712 | |
| 65 | 65 | }, |
| 66 | 66 | "/fleet": { |
| 67 | "js": 24064, | |
| 68 | "css": 50432 | |
| 67 | "js": 24320, | |
| 68 | "css": 51712 | |
| 69 | 69 | }, |
| 70 | 70 | "/talk": { |
| 71 | 71 | "js": 42496, |
| 72 | "css": 56832 | |
| 72 | "css": 58112 | |
| 73 | 73 | }, |
| 74 | 74 | "/:owner/:name/pulls/:number": { |
| 75 | 75 | "js": 34560, |
| 76 | "css": 50432 | |
| 76 | "css": 51712 | |
| 77 | 77 | } |
| 78 | 78 | } |
scripts/design-lint.ts +2 −1
| @@ -72,6 +72,7 @@ import { dictateFindings } from "../src/design/dictate.ts"; | ||
| 72 | 72 | import { STRANGER_NEVER_SEES } from "../src/design/first_five_minutes.ts"; |
| 73 | 73 | import { contrastFindings } from "../src/design/contrast.ts"; |
| 74 | 74 | import { compareLayout, layoutCounts, scanLayout } from "../src/design/layout.ts"; |
| 75 | import { scanFeel, staleAllows } from "../src/design/feel.ts"; | |
| 75 | 76 | import { motionFindings } from "../src/design/motion.ts"; |
| 76 | 77 | import { PHONE_PX, widthFindings } from "../src/design/width.ts"; |
| 77 | 78 | import { cssBlocksAt, scanOverlay, sourceFiles } from "../src/design/overlay.ts"; |
| @@ -671,7 +672,7 @@ if (import.meta.main) { | ||
| 671 | 672 | } else { |
| 672 | 673 | const base: Baseline = JSON.parse(readFileSync(join(root, BASELINE), "utf8")); |
| 673 | 674 | const debt: QuietDebt = JSON.parse(readFileSync(join(root, QUIET_DEBT), "utf8")); |
| 674 | const problems = [...compare(base, now, designText(root), areaFiles(root)), ...compareQuiet(debt, scanQuiet(root)), ...scanBanner(root), ...compareLayout(base.layout ?? {}, scanLayout(root)), ...scanOverlay(root), ...scanCards(root), ...scanStranger(root), ...scanMotion(root), ...scanWidth(root), ...scanDictate(root), ...contrastFindings()]; | |
| 675 | const problems = [...compare(base, now, designText(root), areaFiles(root)), ...compareQuiet(debt, scanQuiet(root)), ...scanBanner(root), ...compareLayout(base.layout ?? {}, scanLayout(root)), ...scanOverlay(root), ...scanCards(root), ...scanStranger(root), ...scanMotion(root), ...scanFeel(root), ...staleAllows(root).map((a) => `${a.file}: ${a.rule} "${a.text}" is allowed in docs/design/feel-allow.json but no longer found: take it out`), ...scanWidth(root), ...scanDictate(root), ...contrastFindings()]; | |
| 675 | 676 | for (const p of problems) console.error(p); |
| 676 | 677 | if (problems.length) process.exit(1); |
| 677 | 678 | console.log("design: no colour, size or component added outside the system"); |
src/design/feel.ts added +133
| @@ -0,0 +1,133 @@ | ||
| 1 | /** | |
| 2 | * How motion feels (the owner's "why your UI feels cheap" rules, after Emil Kowalski): read from | |
| 3 | * every `/* css *\/` template in src/web. Plain data in, plain data out: `feelIn` takes one file's | |
| 4 | * text and a path; `scanFeel` the tree and the allow-list. | |
| 5 | * | |
| 6 | * easein `ease-in` in a transition or an animation: UI enters and leaves with ease-out (the | |
| 7 | * `--ease` token); ease-in-out is for a move on screen (`--ease-move`) | |
| 8 | * slow a transition or a one-shot animation longer than 300 ms; a loop (`infinite`) is an | |
| 9 | * indicator, not a transition, and is not timed here | |
| 10 | * scale0 `scale(0)`: nothing grows from nothing; start at `scale(.95)` | |
| 11 | * prop a transition of anything but `transform` and `opacity` (or `all`): only those two are | |
| 12 | * cheap to draw and read as motion, so a colour, a size or a place changes at once | |
| 13 | * hover a `:hover` rule outside `@media (hover: hover) and (pointer: fine)`: on touch a hover | |
| 14 | * sticks after the tap | |
| 15 | * | |
| 16 | * Not a ratchet: none is allowed but what `docs/design/feel-allow.json` names, each with its | |
| 17 | * reason. | |
| 18 | */ | |
| 19 | import { readFileSync } from "node:fs"; | |
| 20 | import { join, relative } from "node:path"; | |
| 21 | import { cssBlocksAt, sourceFiles } from "./overlay.ts"; | |
| 22 | ||
| 23 | export type FeelRule = "easein" | "slow" | "scale0" | "prop" | "hover"; | |
| 24 | export type FeelFinding = { line: number; rule: FeelRule; text: string }; | |
| 25 | /** A real exception: the file, the rule, a piece of the finding's text, and why. */ | |
| 26 | export type FeelAllow = { file: string; rule: FeelRule; text: string; why: string }; | |
| 27 | ||
| 28 | export const SLOWEST_MS = 300; | |
| 29 | export const FEEL_ALLOW = "docs/design/feel-allow.json"; | |
| 30 | ||
| 31 | /** One line each: the rule and the fix. */ | |
| 32 | export const FEEL_FIX: Record<FeelRule, string> = { | |
| 33 | easein: "UI never eases in: var(--ease) for entering and leaving, var(--ease-move) for a move on screen", | |
| 34 | slow: `UI motion is ${SLOWEST_MS} ms at most: a button 100–160, a tooltip 125–200, a popover 150–250`, | |
| 35 | scale0: "nothing grows from nothing: start at scale(.95)", | |
| 36 | prop: "transition only transform and opacity: a colour, a size or a place changes at once", | |
| 37 | hover: "a hover belongs inside @media (hover: hover) and (pointer: fine): on touch it sticks", | |
| 38 | }; | |
| 39 | ||
| 40 | const lineOf = (text: string, at: number) => text.slice(0, at).split("\n").length; | |
| 41 | const ms = (n: string, unit: string): number => (unit === "s" ? Number(n) * 1000 : Number(n)); | |
| 42 | const CHEAP = /^(transform|opacity|none|translate|scale|rotate)$/; | |
| 43 | ||
| 44 | /** Each comma-separated group of a transition's value, without what is inside parentheses. */ | |
| 45 | const groups = (value: string): string[] => { | |
| 46 | const out: string[] = []; | |
| 47 | let depth = 0; | |
| 48 | let cur = ""; | |
| 49 | for (const ch of value) { | |
| 50 | if (ch === "(") depth++; | |
| 51 | if (ch === ")") depth--; | |
| 52 | if (ch === "," && depth === 0) { | |
| 53 | out.push(cur.trim()); | |
| 54 | cur = ""; | |
| 55 | } else cur += ch; | |
| 56 | } | |
| 57 | if (cur.trim() !== "") out.push(cur.trim()); | |
| 58 | return out; | |
| 59 | }; | |
| 60 | ||
| 61 | export function feelIn(text: string): FeelFinding[] { | |
| 62 | const out: FeelFinding[] = []; | |
| 63 | for (const { css, at } of cssBlocksAt(text)) { | |
| 64 | // Comments and the template's own `${…}` holes say nothing about motion. | |
| 65 | const code = css.replace(/\/\*[\s\S]*?\*\//g, (c) => c.replace(/[^\n]/g, " ")).replace(/\$\{[^}]*\}/g, (c) => c.replace(/[^\n]/g, " ")); | |
| 66 | // The at-rules and selectors open around each position: walk the braces once. | |
| 67 | const stack: string[] = []; | |
| 68 | let start = 0; | |
| 69 | for (let i = 0; i < code.length; i++) { | |
| 70 | const ch = code[i]; | |
| 71 | if (ch === "{") { | |
| 72 | const prelude = code.slice(start, i).trim(); | |
| 73 | stack.push(prelude); | |
| 74 | if (prelude.includes(":hover") && !prelude.startsWith("@") && !stack.some((p) => /^@media\b[^{]*hover:\s*hover/.test(p))) | |
| 75 | out.push({ line: lineOf(text, at + start + (code.slice(start, i).length - code.slice(start, i).trimStart().length)), rule: "hover", text: prelude.replace(/\s+/g, " ") }); | |
| 76 | start = i + 1; | |
| 77 | } else if (ch === "}") { | |
| 78 | stack.pop(); | |
| 79 | start = i + 1; | |
| 80 | } else if (ch === ";") start = i + 1; | |
| 81 | } | |
| 82 | for (const m of code.matchAll(/([a-z-]+)\s*:\s*([^;{}]+)/gi)) { | |
| 83 | const prop = m[1]!.toLowerCase(); | |
| 84 | const value = m[2]!.replace(/!important/i, "").trim(); | |
| 85 | if (!/^(transition|transition-property|transition-duration|transition-timing-function|animation|animation-duration|animation-timing-function|transform|scale)$/.test(prop)) continue; | |
| 86 | const line = lineOf(text, at + m.index!); | |
| 87 | const add = (rule: FeelRule) => out.push({ line, rule, text: `${prop}: ${value}` }); | |
| 88 | if (/\bscale[XYZ3d]*\(\s*0(\.0+)?\s*[,)]/.test(value) || (prop === "scale" && /^0(\.0+)?$/.test(value))) add("scale0"); | |
| 89 | if (prop.startsWith("transition") || prop.startsWith("animation")) { | |
| 90 | if (/\bease-in\b(?!-out)/.test(value)) add("easein"); | |
| 91 | const loop = prop.startsWith("animation") && /\binfinite\b/.test(value); | |
| 92 | if (!loop && !prop.endsWith("delay") && [...value.matchAll(/(?<![\w.-])(\d*\.?\d+)(ms|s)\b/g)].some((d, k) => (prop.startsWith("animation") || prop === "transition" ? k === 0 : true) && ms(d[1]!, d[2]!) > SLOWEST_MS)) add("slow"); | |
| 93 | } | |
| 94 | if (prop === "transition" && value !== "none" && !value.startsWith("none ")) { | |
| 95 | for (const g of groups(value)) { | |
| 96 | const first = g.split(/\s+/)[0]!; | |
| 97 | if (/^var\(/.test(first) || /^\d/.test(first)) continue; | |
| 98 | if (!CHEAP.test(first)) { | |
| 99 | add("prop"); | |
| 100 | break; | |
| 101 | } | |
| 102 | } | |
| 103 | } | |
| 104 | if (prop === "transition-property" && groups(value).some((g) => !CHEAP.test(g))) add("prop"); | |
| 105 | } | |
| 106 | } | |
| 107 | return out.sort((a, b) => a.line - b.line); | |
| 108 | } | |
| 109 | ||
| 110 | /** | |
| 111 | * Every finding in the tree that the allow-list does not name, as one line each: file:line, rule, | |
| 112 | * fix. | |
| 113 | */ | |
| 114 | export function scanFeel(root: string): string[] { | |
| 115 | const allow = JSON.parse(readFileSync(join(root, FEEL_ALLOW), "utf8")) as FeelAllow[]; | |
| 116 | const out: string[] = []; | |
| 117 | for (const f of sourceFiles(root)) { | |
| 118 | const file = relative(root, f).replace(/\\/g, "/"); | |
| 119 | for (const x of feelIn(readFileSync(f, "utf8"))) | |
| 120 | if (!allow.some((a) => a.file === file && a.rule === x.rule && x.text.includes(a.text))) out.push(`${file}:${x.line} ${x.rule}: ${x.text} → ${FEEL_FIX[x.rule]}`); | |
| 121 | } | |
| 122 | return out; | |
| 123 | } | |
| 124 | ||
| 125 | /** Each allow-list entry that no longer names a finding: an exception that outlived its reason. */ | |
| 126 | export function staleAllows(root: string): FeelAllow[] { | |
| 127 | const allow = JSON.parse(readFileSync(join(root, FEEL_ALLOW), "utf8")) as FeelAllow[]; | |
| 128 | const found = sourceFiles(root).flatMap((f) => { | |
| 129 | const file = relative(root, f).replace(/\\/g, "/"); | |
| 130 | return feelIn(readFileSync(f, "utf8")).map((x) => ({ file, ...x })); | |
| 131 | }); | |
| 132 | return allow.filter((a) => !found.some((x) => x.file === a.file && x.rule === a.rule && x.text.includes(a.text))); | |
| 133 | } |
src/design/motion.ts +11 −3
| @@ -2,7 +2,8 @@ | ||
| 2 | 2 | * Calm (#12418): the page does not move unless asked. A stylesheet rule whose |
| 3 | 3 | * `animation` or `transition` runs longer than 100 ms is refused unless a |
| 4 | 4 | * `@media (prefers-reduced-motion: reduce)` rule in the same sheet turns it |
| 5 | * off — the selector itself, or a universal `*` that shortens every duration. | |
| 5 | * off — the selector itself, or a universal `*` that shortens every duration (or, | |
| 6 | * for a transition, keeps only its fade: `transition-property: opacity`). | |
| 6 | 7 | * Plain data in (one sheet's text), plain findings out. |
| 7 | 8 | */ |
| 8 | 9 | |
| @@ -54,10 +55,17 @@ function longest(value: string): number { | ||
| 54 | 55 | return max; |
| 55 | 56 | } |
| 56 | 57 | |
| 57 | /** Does a reduced-motion rule's body stop `property` (none, or a duration of 100 ms or less)? */ | |
| 58 | /** | |
| 59 | * Does a reduced-motion rule's body stop `property` (none, or a duration of 100 ms or less; a | |
| 60 | * transition also when only its fade is left, which moves nothing)? | |
| 61 | */ | |
| 58 | 62 | function stops(body: string, property: "animation" | "transition"): boolean { |
| 59 | for (const d of body.matchAll(new RegExp(`(?<![\\w-])${property}(-duration|-name)?\\s*:\\s*([^;}]*)`, "g"))) { | |
| 63 | for (const d of body.matchAll(new RegExp(`(?<![\\w-])${property}(-duration|-name|-property)?\\s*:\\s*([^;}]*)`, "g"))) { | |
| 60 | 64 | const v = d[2]!.replace(/!important/i, "").trim(); |
| 65 | if (d[1] === "-property") { | |
| 66 | if (property === "transition" && v === "opacity") return true; | |
| 67 | continue; | |
| 68 | } | |
| 61 | 69 | if (d[1] === "-name" || (!d[1] && /^none\b/.test(v))) return true; |
| 62 | 70 | if (d[1] === "-duration" || (!d[1] && v)) return longest(v) <= 100; |
| 63 | 71 | } |
src/web/pages/account.ts +1 −1
| @@ -549,7 +549,7 @@ const galleryCss = /* css */ ` | ||
| 549 | 549 | border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); |
| 550 | 550 | font-size: 14px; font-weight: 550; |
| 551 | 551 | } |
| 552 | .theme-card:hover { border-color: var(--border-strong); } | |
| 552 | @media (hover: hover) and (pointer: fine) { .theme-card:hover { border-color: var(--border-strong); } } | |
| 553 | 553 | .theme-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); } |
| 554 | 554 | .theme-card small { display: block; font-weight: 400; } |
| 555 | 555 | .theme-look { display: flex; height: 76px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); } |
src/web/pages/build_info.ts +2 −1
| @@ -183,7 +183,8 @@ export const INFO_CSS = /* css */ ` | ||
| 183 | 183 | .it-info p{margin:0;font-size:13px} |
| 184 | 184 | .it-info .prose.it-body{padding:0;font-size:13px;line-height:1.5} |
| 185 | 185 | .it-edit{margin-left:auto;background:none;border:0;padding:0;color:var(--muted-fg);font:inherit;font-size:11.5px;font-weight:400;cursor:pointer} |
| 186 | .it-edit:hover,.it-edit:focus-visible{color:var(--accent);text-decoration:underline} | |
| 186 | .it-edit:focus-visible {color:var(--accent);text-decoration:underline} | |
| 187 | @media (hover: hover) and (pointer: fine) { .it-edit:hover {color:var(--accent);text-decoration:underline} } | |
| 187 | 188 | @media (forced-colors: active){.it-edit:focus-visible{outline:1px solid Highlight}} |
| 188 | 189 | .it-none .it-edit{margin-left:0;font-size:inherit} |
| 189 | 190 | .it-edit[hidden],.it-ed[hidden],.it-saved[hidden],.it-info [data-view][hidden],.it-none[hidden]{display:none} |
src/web/pages/home_flow_style.ts +9 −9
| @@ -28,7 +28,7 @@ export const homeFlowCss = /* css */ ` | ||
| 28 | 28 | .hf-need-first { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| 29 | 29 | .hf-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-1); } |
| 30 | 30 | .hf-fig { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 44px; padding: 12px 16px; background: var(--card); box-shadow: 0 0 0 0.5px var(--border); } |
| 31 | .hf-fig:hover { background: var(--muted); color: var(--fg); } | |
| 31 | @media (hover: hover) and (pointer: fine) { .hf-fig:hover { background: var(--muted); color: var(--fg); } } | |
| 32 | 32 | .hf-fig:last-child:nth-child(odd) { grid-column: 1 / -1; } |
| 33 | 33 | .hf-fig-label { font-size: var(--fs-min); color: var(--muted-fg); } |
| 34 | 34 | .hf-fig-value { font-size: 20px; font-weight: 600; line-height: 28px; letter-spacing: -0.01em; } |
| @@ -55,11 +55,11 @@ export const homeFlowCss = /* css */ ` | ||
| 55 | 55 | |
| 56 | 56 | /* ---- a tile ---- */ |
| 57 | 57 | .tile { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-1); } |
| 58 | .tile:hover { border-color: var(--border-strong); } | |
| 58 | @media (hover: hover) and (pointer: fine) { .tile:hover { border-color: var(--border-strong); } } | |
| 59 | 59 | .tile[data-state="active"] { border-left: 2px solid var(--accent); } |
| 60 | 60 | .tile[data-state="done"] { border-left: 2px solid var(--success); } |
| 61 | 61 | .tile-link { display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 8px 12px; color: var(--fg); } |
| 62 | .tile-link:hover { color: var(--fg); } | |
| 62 | @media (hover: hover) and (pointer: fine) { .tile-link:hover { color: var(--fg); } } | |
| 63 | 63 | .tile-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; font-size: var(--fs-min); line-height: 16px; } |
| 64 | 64 | .tile-app { min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; } |
| 65 | 65 | .tile-no { font-weight: 400; color: var(--muted-fg); } |
| @@ -71,7 +71,7 @@ export const homeFlowCss = /* css */ ` | ||
| 71 | 71 | .tile[data-new] { animation: hf-arrive 900ms var(--ease); } |
| 72 | 72 | .lane-more { margin: 0; padding-inline: 4px; font-size: 13px; } |
| 73 | 73 | .lane-more a, .lane-toggle { display: block; color: var(--muted-fg); } |
| 74 | .lane-more a:hover, .lane-toggle:hover { color: var(--accent); } | |
| 74 | @media (hover: hover) and (pointer: fine) { .lane-more a:hover, .lane-toggle:hover { color: var(--accent); } } | |
| 75 | 75 | .lane-more span { align-items: center; min-height: 44px; } |
| 76 | 76 | .lane-more-sm { display: inline-flex; } |
| 77 | 77 | .lane-more-md, .lane-more-lg { display: none; } |
| @@ -136,7 +136,7 @@ export const homeFlowCss = /* css */ ` | ||
| 136 | 136 | /* ---- the view switch, and the table ---- */ |
| 137 | 137 | .hf-views { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); } |
| 138 | 138 | .hf-views a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 16px; border-radius: var(--radius-sm); font-weight: 500; color: var(--muted-fg); } |
| 139 | .hf-views a:hover { color: var(--fg); } | |
| 139 | @media (hover: hover) and (pointer: fine) { .hf-views a:hover { color: var(--fg); } } | |
| 140 | 140 | .hf-views a[aria-current="page"] { background: var(--card); box-shadow: var(--shadow-1); color: var(--fg); } |
| 141 | 141 | .hf-head .hf-title { margin-right: auto; } |
| 142 | 142 | .tb-search { display: flex; align-items: center; gap: 8px; } |
| @@ -147,7 +147,7 @@ export const homeFlowCss = /* css */ ` | ||
| 147 | 147 | .tb-sorts { display: none; } |
| 148 | 148 | .tb-chiplabel { min-width: 40px; font-size: var(--fs-min); color: var(--muted-fg); } |
| 149 | 149 | .tb-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding-inline: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); font-size: 13px; color: var(--fg); } |
| 150 | .tb-chip:hover { border-color: var(--border-strong); color: var(--fg); } | |
| 150 | @media (hover: hover) and (pointer: fine) { .tb-chip:hover { border-color: var(--border-strong); color: var(--fg); } } | |
| 151 | 151 | .tb-chip[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--primary-fg); } |
| 152 | 152 | .tb-chipn { font-size: var(--fs-min); color: var(--muted-fg); } |
| 153 | 153 | .tb-chip[aria-pressed="true"] .tb-chipn { color: inherit; opacity: 0.8; } |
| @@ -172,7 +172,7 @@ export const homeFlowCss = /* css */ ` | ||
| 172 | 172 | .tb-pick { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; } |
| 173 | 173 | .tb-pick::before { content: ""; width: 18px; height: 18px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--card); } |
| 174 | 174 | .tb-pick[aria-checked="true"]::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--card); } |
| 175 | .tb-pick:hover::before { border-color: var(--accent); } | |
| 175 | @media (hover: hover) and (pointer: fine) { .tb-pick:hover::before { border-color: var(--accent); } } | |
| 176 | 176 | .tb .tb-sel { width: 44px; padding: 0; } |
| 177 | 177 | .tb-row:has(.tb-pick[aria-checked="true"]) { background: color-mix(in srgb, var(--accent) 8%, var(--card)); } |
| 178 | 178 | .tb-row[hidden] { display: none; } |
| @@ -180,7 +180,7 @@ export const homeFlowCss = /* css */ ` | ||
| 180 | 180 | .tb-app { white-space: nowrap; font-weight: 600; } |
| 181 | 181 | .tb-no { font-weight: 400; color: var(--muted-fg); } |
| 182 | 182 | .tb-what a { color: var(--fg); } |
| 183 | .tb-what a:hover { color: var(--accent); } | |
| 183 | @media (hover: hover) and (pointer: fine) { .tb-what a:hover { color: var(--accent); } } | |
| 184 | 184 | .tb-state .dot { margin-right: 8px; vertical-align: 1px; } |
| 185 | 185 | .tb-hint, .tb-lane { color: var(--muted-fg); } |
| 186 | 186 | .tb-time, .tb-age { white-space: nowrap; } |
| @@ -215,7 +215,7 @@ export const homeFlowCss = /* css */ ` | ||
| 215 | 215 | .fg-hint { font-size: var(--fs-min); color: var(--muted-fg); } |
| 216 | 216 | .fg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; } |
| 217 | 217 | .fg-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-1); color: var(--fg); } |
| 218 | a.fg-card:hover { border-color: var(--border-strong); color: var(--fg); } | |
| 218 | @media (hover: hover) and (pointer: fine) { a.fg-card:hover { border-color: var(--border-strong); color: var(--fg); } } | |
| 219 | 219 | .fg-card[data-tone="attn"] { border-color: color-mix(in srgb, var(--attn) 40%, var(--border)); } |
| 220 | 220 | .fg-card[data-tone="attn"] .fg-n { color: var(--attn); } |
| 221 | 221 | .fg-label { margin: 0; font-size: var(--fs-min); font-weight: 400; color: var(--muted-fg); } |
src/web/pages/map.ts +5 −5
| @@ -1231,7 +1231,7 @@ export const mapCss = /* css */ `${factsCss} | ||
| 1231 | 1231 | |
| 1232 | 1232 | /* ---- cards ---- */ |
| 1233 | 1233 | .map-node { cursor: pointer; outline: none; } |
| 1234 | .map-card { fill: var(--card); stroke: var(--border); stroke-width: 1; transition: stroke 120ms var(--ease), fill 120ms var(--ease); } | |
| 1234 | .map-card { fill: var(--card); stroke: var(--border); stroke-width: 1; } | |
| 1235 | 1235 | .map-node[data-state="ready"] .map-card { stroke: var(--border-strong); } |
| 1236 | 1236 | .map-node[data-state="working"] .map-card { stroke: var(--accent); } |
| 1237 | 1237 | .map-node[data-state="blocked"] .map-card { fill: var(--muted); } |
| @@ -1241,15 +1241,15 @@ export const mapCss = /* css */ `${factsCss} | ||
| 1241 | 1241 | .map-card.map-new { stroke-width: 2; stroke-dasharray: 2 2; } |
| 1242 | 1242 | .map-new-dot { fill: var(--fg); } |
| 1243 | 1243 | .map-growth { margin: 0 0 var(--gap, 12px); } |
| 1244 | .map-node:hover .map-card { stroke: var(--border-strong); } | |
| 1245 | .map-node[data-state="working"]:hover .map-card { stroke: var(--accent); } | |
| 1244 | @media (hover: hover) and (pointer: fine) { .map-node:hover .map-card { stroke: var(--border-strong); } | |
| 1245 | .map-node[data-state="working"]:hover .map-card { stroke: var(--accent); } } | |
| 1246 | 1246 | .map-node:focus-visible .map-card { stroke: var(--accent); stroke-width: 2; } |
| 1247 | 1247 | .map-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } |
| 1248 | 1248 | /* A soft outer ring, static: any animation inside a large inline SVG |
| 1249 | 1249 | repaints the whole drawing every frame, whatever property it touches. */ |
| 1250 | 1250 | .map-breath { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .35; } |
| 1251 | .map-title { font-size: 12.5px; font-weight: 560; fill: var(--fg); transition: fill 120ms var(--ease); } | |
| 1252 | .map-node:hover .map-title { fill: var(--accent); } | |
| 1251 | .map-title { font-size: 12.5px; font-weight: 560; fill: var(--fg); } | |
| 1252 | @media (hover: hover) and (pointer: fine) { .map-node:hover .map-title { fill: var(--accent); } } | |
| 1253 | 1253 | .map-node[data-state="done"] .map-title, .map-node[data-state="done"] .map-meta, .map-node[data-state="done"] .map-word { fill: var(--faint); } |
| 1254 | 1254 | .map-node[data-state="deferred"] .map-card { fill: none; stroke-dasharray: 4 3; } |
| 1255 | 1255 | .map-node[data-state="deferred"] .map-title { fill: var(--muted-fg); } |
src/web/pages/talk_client.ts +5 −5
| @@ -58,7 +58,7 @@ body:has(.talk-page) .topbar { background: var(--bg); backdrop-filter: none; -we | ||
| 58 | 58 | .talk { display: flex; flex-direction: column; width: 100%; max-width: 46rem; margin: 0 auto; min-width: 0; min-height: calc(100dvh - var(--topbar-h)); } |
| 59 | 59 | .talk-side, .talk-work, [data-view="list"] :is(.talk, .talk-work) { display: none; } |
| 60 | 60 | [data-view="list"] .talk-side { display: block; padding: 12px 0; } |
| 61 | .talk-head { position: sticky; top: var(--topbar-h); z-index: 8; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; min-height: 2.75rem; padding-block: 2px; background: var(--bg); transition: transform var(--dur-2) var(--ease); } | |
| 61 | .talk-head { position: sticky; top: var(--topbar-h); z-index: 8; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; min-height: 2.75rem; padding-block: 2px; background: var(--bg); transition: transform var(--dur-2) var(--ease-move); } | |
| 62 | 62 | .talk-head[data-away] { transform: translateY(-110%); } |
| 63 | 63 | .talk-head[data-away]:is(:focus-within, :has(details[open])) { transform: none; } |
| 64 | 64 | .talk-title { flex: 1 1 0; min-width: 3rem; margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } |
| @@ -149,7 +149,7 @@ body:has(.talk-page) .topbar { background: var(--bg); backdrop-filter: none; -we | ||
| 149 | 149 | @keyframes talk-fade { from { opacity: 0; } } |
| 150 | 150 | |
| 151 | 151 | @media (prefers-reduced-motion: no-preference) { |
| 152 | .talk:not([data-motion=reduced]) :is(.talk-log > [data-in], .talk-fold-list > [data-in], .talk-jump:not([hidden])) { animation: talk-in var(--dur-3) var(--ease); } | |
| 152 | .talk:not([data-motion=reduced]) :is(.talk-log > [data-in]:not(.talk-person), .talk-fold-list > [data-in], .talk-jump:not([hidden])) { animation: talk-in var(--dur-3) var(--ease); } | |
| 153 | 153 | .talk:not([data-motion=reduced]) .talk-live [data-in] { animation: talk-fade var(--dur-3) var(--ease); } |
| 154 | 154 | .talk:not([data-motion=reduced]) .talk-confirm[data-in] { animation: talk-in var(--dur-3) var(--ease); } |
| 155 | 155 | .talk:not([data-motion=reduced]) .talk-confirms { transition: height var(--dur-3) var(--ease), padding var(--dur-3) var(--ease); } |
| @@ -177,7 +177,7 @@ body:has(.talk-page) .topbar { background: var(--bg); backdrop-filter: none; -we | ||
| 177 | 177 | .talk-person > .talk-meta time { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } |
| 178 | 178 | .talk-act, .talk-copy { position: relative; width: 2rem; min-width: 2rem; height: 2rem; min-height: 2rem; padding: 0; color: var(--muted-fg); } |
| 179 | 179 | .talk-copy { display: inline-flex; align-items: center; justify-content: center; padding: 0; background: none; border: 0; border-radius: var(--radius-sm); color: inherit; cursor: pointer; } |
| 180 | .talk-copy:hover { background: var(--muted); color: var(--fg); } | |
| 180 | @media (hover: hover) and (pointer: fine) { .talk-copy:hover { background: var(--muted); color: var(--fg); } } | |
| 181 | 181 | @media (hover: hover) and (pointer: fine) { |
| 182 | 182 | .talk-turn > :is(.talk-meta, .talk-acts) :is(.talk-copy, .talk-act):not(:focus-visible) { opacity: 0; transition: opacity var(--dur-2) var(--ease); } |
| 183 | 183 | .talk-turn:is(:hover, :focus-within) > :is(.talk-meta, .talk-acts) :is(.talk-copy, .talk-act) { opacity: 1; } |
| @@ -188,7 +188,7 @@ body:has(.talk-page) .topbar { background: var(--bg); backdrop-filter: none; -we | ||
| 188 | 188 | .talk-fold { margin-block: -4px; } |
| 189 | 189 | [data-steps] + .talk-agent > .talk-steps { display: none; } |
| 190 | 190 | .talk-fold > details > summary { position: relative; cursor: pointer; min-height: 2rem; display: inline-flex; align-items: center; gap: 6px; color: var(--muted-fg); } |
| 191 | .talk-fold > details > summary:hover { color: var(--fg); } | |
| 191 | @media (hover: hover) and (pointer: fine) { .talk-fold > details > summary:hover { color: var(--fg); } } | |
| 192 | 192 | .talk-fold-list { list-style: none; margin: 0; margin-inline-start: 8px; padding: 0; padding-inline-start: 12px; border-inline-start: 2px solid var(--border); display: grid; gap: 2px; } |
| 193 | 193 | .talk-steps { margin: 4px 0 0; } |
| 194 | 194 | .talk-live .talk-steps:last-child, .talk-status:not(:empty), .talk-stage[data-busy] .talk-stage-note, .talk-crew-working { background: linear-gradient(90deg, var(--muted-fg) 40%, var(--fg) 50%, var(--muted-fg) 60%) 0 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: talk-shine 2s linear infinite; } |
| @@ -221,7 +221,7 @@ body:has(.talk-page) .topbar { background: var(--bg); backdrop-filter: none; -we | ||
| 221 | 221 | @media (max-width: 30rem) { .talk-suggest { margin-top: 16px; } .talk:has(.talk-hello) .talk-compose { padding-bottom: 16px; } .talk:has(.talk-hello) { padding-bottom: 10vh; } } |
| 222 | 222 | .talk-suggest .btn { min-height: 2.75rem; border-radius: 999px; } |
| 223 | 223 | .talk-compose { position: sticky; bottom: var(--kb, 0px); z-index: 8; padding: 8px 0 max(12px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 8px); } |
| 224 | .talk-box { display: grid; border: 1px solid var(--border-strong); border-radius: 24px; background: var(--card); box-shadow: var(--shadow-1); transition: border-color var(--dur-2) var(--ease); } | |
| 224 | .talk-box { display: grid; border: 1px solid var(--border-strong); border-radius: 24px; background: var(--card); box-shadow: var(--shadow-1); } | |
| 225 | 225 | .talk-box:focus-within { border-color: var(--muted-fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted-fg) 22%, transparent); } |
| 226 | 226 | .talk-box:has([aria-invalid="true"]) { border-color: var(--danger); } |
| 227 | 227 | @media (prefers-reduced-motion: reduce) { .talk-box, .talk-head, .talk-turn :is(.talk-copy, .talk-act) { transition: none; } } |
src/web/pick.ts +1 −1
| @@ -75,7 +75,7 @@ export const pickCss = /* css */ ` | ||
| 75 | 75 | color: var(--fg); background: var(--muted); border: 1px solid var(--border); |
| 76 | 76 | border-radius: var(--radius-sm); |
| 77 | 77 | } |
| 78 | .pick-chip:hover { border-color: var(--border-strong); } | |
| 78 | @media (hover: hover) and (pointer: fine) { .pick-chip:hover { border-color: var(--border-strong); } } | |
| 79 | 79 | .pick-bar .input { flex: 1; min-width: 160px; } |
| 80 | 80 | .pick-list { |
| 81 | 81 | max-height: 168px; overflow-y: auto; overscroll-behavior: contain; |
src/web/style/base.ts +14 −11
| @@ -47,10 +47,13 @@ export const base = /* css */ ` | ||
| 47 | 47 | --topbar-h: 56px; |
| 48 | 48 | --page: 1120px; |
| 49 | 49 | --measure: 72ch; |
| 50 | --ease: cubic-bezier(.2, 0, 0, 1); | |
| 51 | /* One motion vocabulary: the code viewer's timings, named. A hover or a | |
| 52 | focus is --dur-1 to --dur-2, a thing arriving --dur-3, and a pixel | |
| 53 | figure changes frame every --beat (#10570). */ | |
| 50 | /* One strong curve for what enters and leaves (ease-out), one for a move | |
| 51 | on screen (ease-in-out); never ease-in. src/design/feel.ts holds it. */ | |
| 52 | --ease: cubic-bezier(.23, 1, .32, 1); | |
| 53 | --ease-move: cubic-bezier(.77, 0, .175, 1); | |
| 54 | /* One motion vocabulary: the code viewer's timings, named. A press is | |
| 55 | --dur-1, a hover, a tooltip or a popover --dur-2, a thing arriving | |
| 56 | --dur-3, all under 300 ms; a pixel figure changes frame every --beat (#10570). */ | |
| 54 | 57 | --dur-1: 100ms; |
| 55 | 58 | --dur-2: 140ms; |
| 56 | 59 | --dur-3: 200ms; |
| @@ -78,8 +81,8 @@ body { | ||
| 78 | 81 | text-rendering: optimizeLegibility; |
| 79 | 82 | } |
| 80 | 83 | |
| 81 | a { color: inherit; text-decoration: none; transition: color 120ms var(--ease); } | |
| 82 | a:hover { color: var(--accent); } | |
| 84 | a { color: inherit; text-decoration: none; } | |
| 85 | @media (hover: hover) and (pointer: fine) { a:hover { color: var(--accent); } } | |
| 83 | 86 | code, pre, .mono { font-family: var(--mono); font-size: 12.5px; } |
| 84 | 87 | .mono { overflow-wrap: anywhere; } |
| 85 | 88 | |
| @@ -105,7 +108,7 @@ h3 { font-size: 14px; font-weight: 600; line-height: 1.4; } | ||
| 105 | 108 | position: absolute; left: 16px; top: -48px; z-index: 40; |
| 106 | 109 | padding: 8px 14px; border-radius: var(--radius); |
| 107 | 110 | background: var(--primary); color: var(--primary-fg); |
| 108 | font-weight: 500; transition: top 140ms var(--ease); | |
| 111 | font-weight: 500; | |
| 109 | 112 | } |
| 110 | 113 | .skip:focus-visible { top: 10px; color: var(--primary-fg); } |
| 111 | 114 | |
| @@ -140,8 +143,8 @@ h3 { font-size: 14px; font-weight: 600; line-height: 1.4; } | ||
| 140 | 143 | background: linear-gradient(135deg, var(--accent), var(--merged)); |
| 141 | 144 | transition: transform 200ms var(--ease); |
| 142 | 145 | } |
| 143 | .wordmark:hover { color: var(--fg); } | |
| 144 | .wordmark:hover .mark { transform: rotate(135deg); } | |
| 146 | @media (hover: hover) and (pointer: fine) { .wordmark:hover { color: var(--fg); } | |
| 147 | .wordmark:hover .mark { transform: rotate(135deg); } } | |
| 145 | 148 | .topbar .spacer { flex: 1; } |
| 146 | 149 | .topbar-tools { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; } |
| 147 | 150 | .topbar-tools > a.small { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; flex: none; } |
| @@ -166,7 +169,7 @@ body { overflow-x: clip; } | ||
| 166 | 169 | width: 7px; height: 7px; border-radius: 2px; opacity: .7; |
| 167 | 170 | background: linear-gradient(135deg, var(--accent), var(--merged)); |
| 168 | 171 | } |
| 169 | .foot a:hover { color: var(--accent); } | |
| 172 | @media (hover: hover) and (pointer: fine) { .foot a:hover { color: var(--accent); } } | |
| 170 | 173 | .foot .reduced { color: var(--muted-fg); } |
| 171 | 174 | |
| 172 | 175 | @media (prefers-reduced-motion: reduce) { |
| @@ -174,7 +177,7 @@ body { overflow-x: clip; } | ||
| 174 | 177 | *, *::before, *::after { |
| 175 | 178 | animation-duration: .01ms !important; |
| 176 | 179 | animation-iteration-count: 1 !important; |
| 177 | transition-duration: .01ms !important; | |
| 180 | transition-property: opacity !important; | |
| 178 | 181 | } |
| 179 | 182 | } |
| 180 | 183 |
src/web/style/components.ts +57 −51
| @@ -29,36 +29,35 @@ export const components = /* css */ ` | ||
| 29 | 29 | background: var(--card); color: var(--fg); |
| 30 | 30 | font-weight: 500; font-size: 14px; white-space: nowrap; cursor: pointer; |
| 31 | 31 | box-shadow: var(--shadow-1); |
| 32 | transition: background-color 140ms var(--ease), border-color 140ms var(--ease), | |
| 33 | color 140ms var(--ease), opacity 140ms var(--ease); | |
| 32 | transition: opacity 140ms var(--ease), transform var(--dur-1) var(--ease); | |
| 34 | 33 | } |
| 35 | .btn:hover { background: var(--muted); border-color: var(--border-strong); color: var(--fg); } | |
| 36 | .btn:active { opacity: .85; } | |
| 34 | @media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--muted); border-color: var(--border-strong); color: var(--fg); } } | |
| 35 | .btn:active { opacity: .85; transform: scale(.97); } | |
| 37 | 36 | .btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; } |
| 38 | 37 | .btn[aria-busy="true"] { opacity: .7; pointer-events: none; } |
| 39 | 38 | .btn[data-variant="primary"] { |
| 40 | 39 | background: var(--primary); color: var(--primary-fg); border-color: var(--primary); |
| 41 | 40 | } |
| 42 | .btn[data-variant="primary"]:hover { opacity: .88; background: var(--primary); color: var(--primary-fg); } | |
| 41 | @media (hover: hover) and (pointer: fine) { .btn[data-variant="primary"]:hover { opacity: .88; background: var(--primary); color: var(--primary-fg); } } | |
| 43 | 42 | .btn[data-variant="secondary"] { background: var(--muted); border-color: transparent; box-shadow: none; } |
| 44 | .btn[data-variant="secondary"]:hover { border-color: var(--border); } | |
| 43 | @media (hover: hover) and (pointer: fine) { .btn[data-variant="secondary"]:hover { border-color: var(--border); } } | |
| 45 | 44 | .btn[data-variant="outline"] { background: transparent; box-shadow: none; } |
| 46 | 45 | .btn[data-variant="ghost"] { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted-fg); } |
| 47 | .btn[data-variant="ghost"]:hover { background: var(--muted); color: var(--fg); border-color: transparent; } | |
| 46 | @media (hover: hover) and (pointer: fine) { .btn[data-variant="ghost"]:hover { background: var(--muted); color: var(--fg); border-color: transparent; } } | |
| 48 | 47 | /* A toggle shows its state: the chip, the sort button. */ |
| 49 | 48 | .btn[aria-pressed="true"] { background: var(--muted); border-color: var(--border-strong); color: var(--fg); font-weight: 550; } |
| 50 | 49 | .btn[aria-pressed="false"] { color: var(--muted-fg); } |
| 51 | 50 | .btn[data-variant="danger"] { color: var(--danger); } |
| 52 | .btn[data-variant="danger"]:hover { | |
| 51 | @media (hover: hover) and (pointer: fine) { .btn[data-variant="danger"]:hover { | |
| 53 | 52 | border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); |
| 54 | 53 | background: color-mix(in srgb, var(--danger) 8%, var(--card)); |
| 55 | 54 | color: var(--danger); |
| 56 | } | |
| 55 | } } | |
| 57 | 56 | .btn[data-variant="link"] { |
| 58 | 57 | border-color: transparent; background: none; box-shadow: none; |
| 59 | 58 | color: var(--accent); padding: 0; min-height: 0; |
| 60 | 59 | } |
| 61 | .btn[data-variant="link"]:hover { background: none; text-decoration: underline; text-underline-offset: 3px; } | |
| 60 | @media (hover: hover) and (pointer: fine) { .btn[data-variant="link"]:hover { background: none; text-decoration: underline; text-underline-offset: 3px; } } | |
| 62 | 61 | .btn[data-size="sm"] { min-height: 28px; padding: 0 10px; font-size: 13px; gap: 5px; } |
| 63 | 62 | .btn[data-size="lg"] { min-height: 44px; padding: 0 18px; font-size: 15px; } |
| 64 | 63 | /* An icon button is a square of its size class — 36px matches the button min-height, so a row of mixed buttons has one silhouette. */ |
| @@ -77,10 +76,9 @@ export const components = /* css */ ` | ||
| 77 | 76 | width: 100%; min-height: 36px; padding: 7px 10px; |
| 78 | 77 | border: 1px solid var(--border); border-radius: var(--radius-sm); |
| 79 | 78 | background: var(--card); color: var(--fg); |
| 80 | transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease); | |
| 81 | 79 | } |
| 82 | 80 | .input.input-num { width: 5rem; } |
| 83 | .input:hover { border-color: var(--border-strong); } | |
| 81 | @media (hover: hover) and (pointer: fine) { .input:hover { border-color: var(--border-strong); } } | |
| 84 | 82 | .input:focus-visible { |
| 85 | 83 | outline: none; border-color: var(--accent); |
| 86 | 84 | box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); |
| @@ -147,7 +145,8 @@ select.input { | ||
| 147 | 145 | background: var(--card); color: var(--muted-fg); |
| 148 | 146 | } |
| 149 | 147 | .why > summary::-webkit-details-marker { display: none; } |
| 150 | .why > summary:hover, .why[open] > summary { border-color: var(--border-strong); color: var(--fg); } | |
| 148 | .why[open] > summary { border-color: var(--border-strong); color: var(--fg); } | |
| 149 | @media (hover: hover) and (pointer: fine) { .why > summary:hover { border-color: var(--border-strong); color: var(--fg); } } | |
| 151 | 150 | .why > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } |
| 152 | 151 | .why > p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted-fg); overflow-wrap: anywhere; } |
| 153 | 152 | @media (pointer: coarse) { .why > summary { width: 44px; height: 44px; } } |
| @@ -177,7 +176,7 @@ fieldset.field > .check + .check { margin-top: 8px; } | ||
| 177 | 176 | overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); |
| 178 | 177 | background: var(--card); color: var(--fg); text-decoration: none; |
| 179 | 178 | } |
| 180 | a.stat:hover { border-color: var(--border-strong); } | |
| 179 | @media (hover: hover) and (pointer: fine) { a.stat:hover { border-color: var(--border-strong); } } | |
| 181 | 180 | .stat[data-tone="attn"] { border-color: color-mix(in srgb, var(--attn) 40%, var(--border)); } |
| 182 | 181 | .stat-label { display: block; height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--fs-min); line-height: 18px; color: var(--muted-fg); } |
| 183 | 182 | .stat-value { display: block; height: 32px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 20px; font-weight: 600; line-height: 32px; } |
| @@ -262,7 +261,7 @@ a.stat:hover { border-color: var(--border-strong); } | ||
| 262 | 261 | border: 1px solid color-mix(in srgb, var(--label) 32%, transparent); |
| 263 | 262 | white-space: nowrap; |
| 264 | 263 | } |
| 265 | a.label:hover { color: color-mix(in srgb, var(--label) 90%, var(--fg)); } | |
| 264 | @media (hover: hover) and (pointer: fine) { a.label:hover { color: color-mix(in srgb, var(--label) 90%, var(--fg)); } } | |
| 266 | 265 | |
| 267 | 266 | .pill { |
| 268 | 267 | display: inline-flex; align-items: center; justify-content: center; |
| @@ -366,7 +365,7 @@ kbd { | ||
| 366 | 365 | border-radius: 4px; background: var(--muted); color: var(--muted-fg); |
| 367 | 366 | font-variant-numeric: tabular-nums; |
| 368 | 367 | } |
| 369 | a.sha:hover { color: var(--accent); } | |
| 368 | @media (hover: hover) and (pointer: fine) { a.sha:hover { color: var(--accent); } } | |
| 370 | 369 | |
| 371 | 370 | /* ---- avatar ---- |
| 372 | 371 | The hue is the person's (data-h, twelve of them), so the twelve are spelled |
| @@ -403,7 +402,7 @@ a.sha:hover { color: var(--accent); } | ||
| 403 | 402 | .avatar[data-size="lg"] { width: 56px; height: 56px; font-size: 20px; border-radius: var(--radius-lg); } |
| 404 | 403 | |
| 405 | 404 | .byline { display: inline-flex; align-items: center; gap: 5px; min-width: 0; } |
| 406 | .byline a:hover { color: var(--accent); } | |
| 405 | @media (hover: hover) and (pointer: fine) { .byline a:hover { color: var(--accent); } } | |
| 407 | 406 | .name-mark { |
| 408 | 407 | display: inline-block; padding: 0 5px; border-radius: 4px; |
| 409 | 408 | font-size: var(--fs-min); font-weight: 600; line-height: 15px; letter-spacing: 0.04em; |
| @@ -502,17 +501,16 @@ a.sha:hover { color: var(--accent); } | ||
| 502 | 501 | .row { |
| 503 | 502 | display: flex; align-items: center; gap: 10px; |
| 504 | 503 | padding: 8px 14px; min-height: 40px; |
| 505 | transition: background-color 100ms var(--ease); | |
| 506 | 504 | } |
| 507 | 505 | a.flow-row { min-height: 44px; } |
| 508 | 506 | .row:focus-visible { outline-offset: -2px; } |
| 509 | a.row:hover, .row[data-nav]:hover { background: var(--muted); color: inherit; } | |
| 507 | @media (hover: hover) and (pointer: fine) { a.row:hover, .row[data-nav]:hover { background: var(--muted); color: inherit; } } | |
| 510 | 508 | .list li[aria-current="true"] > .row { background: var(--muted); } |
| 511 | 509 | /* A tree: the rows under a row hang from a rule, a step in. */ |
| 512 | 510 | .list li[data-mine] > .row, .list li[data-mine]:target > .row { background: var(--muted); } |
| 513 | 511 | .row-children { list-style: none; margin: 0 0 0 22px; padding: 0; border-left: 1px solid var(--border); } |
| 514 | 512 | .row-children > li[data-fold] > details > summary { display: flex; align-items: center; min-height: 44px; padding: 0 12px; cursor: pointer; color: var(--muted-fg, inherit); } |
| 515 | .row-children > li[data-fold] > details > summary:hover { background: var(--muted); } | |
| 513 | @media (hover: hover) and (pointer: fine) { .row-children > li[data-fold] > details > summary:hover { background: var(--muted); } } | |
| 516 | 514 | .row-children > li[data-fold] > details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } |
| 517 | 515 | .row-children > li { border-top: 1px solid var(--border); } |
| 518 | 516 | @media (max-width: 719px) { .row-children { margin-left: 12px; } } |
| @@ -532,17 +530,16 @@ li[data-severed] .row-lead, li[data-severed] .row-title { opacity: .6; } | ||
| 532 | 530 | [data-look] .looks { flex-wrap: nowrap; gap: 10px; align-items: center; } |
| 533 | 531 | [data-look] a.look { position: relative; overflow: visible; } |
| 534 | 532 | [data-look] a.look::after { content: ""; position: absolute; inset: -7px; } |
| 535 | a.row:hover .row-title { color: var(--accent); } | |
| 533 | @media (hover: hover) and (pointer: fine) { a.row:hover .row-title { color: var(--accent); } } | |
| 536 | 534 | /* The docs index (/docs): a link per document, 44px to hit, then one muted line on what it is |
| 537 | 535 | for, as bare text after the link so the index stays under 15 KB. */ |
| 538 | 536 | .docs-index > li { padding: 0 16px 12px; color: var(--muted-fg); font-size: 14px; } |
| 539 | .docs-index > li > a { display: block; margin: 0 -16px; padding: 12px 16px 2px; color: var(--fg); font-size: 1rem; transition: background-color 100ms var(--ease); } | |
| 540 | .docs-index > li > a:hover { background: var(--muted); color: var(--accent); } | |
| 537 | .docs-index > li > a { display: block; margin: 0 -16px; padding: 12px 16px 2px; color: var(--fg); font-size: 1rem; } | |
| 538 | @media (hover: hover) and (pointer: fine) { .docs-index > li > a:hover { background: var(--muted); color: var(--accent); } } | |
| 541 | 539 | .docs-index > li > a:focus-visible { outline-offset: -2px; } |
| 542 | 540 | .row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } |
| 543 | 541 | .row-title { |
| 544 | 542 | font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; |
| 545 | transition: color 100ms var(--ease); | |
| 546 | 543 | } |
| 547 | 544 | /* One honest line: everything in it is inline, so text-overflow actually |
| 548 | 545 | has a block box to ellipsize (a flex container would silently ignore it) |
| @@ -606,7 +603,7 @@ span.ex-pic { display: inline-flex; align-items: center; justify-content: center | ||
| 606 | 603 | .row[data-state="draft"] .row-lead { color: var(--muted-fg); } |
| 607 | 604 | /* A row that folds is a <summary>: its lead is the caret, turned when open. */ |
| 608 | 605 | summary.row { cursor: pointer; list-style: none; } |
| 609 | summary.row:hover { background: var(--muted); } | |
| 606 | @media (hover: hover) and (pointer: fine) { summary.row:hover { background: var(--muted); } } | |
| 610 | 607 | details[open] > summary.row > .row-lead { transform: rotate(90deg); } |
| 611 | 608 | /* A report's open body: block children in reading order, never one flex line. */ |
| 612 | 609 | .report-body { padding: 0 14px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; overflow-wrap: anywhere; } |
| @@ -621,7 +618,8 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 621 | 618 | .counts { display: inline-flex; align-items: center; gap: 10px; flex: none; } |
| 622 | 619 | /* Secondary actions are always in the DOM, revealed without layout shift. */ |
| 623 | 620 | .row-actions { opacity: 0; transition: opacity 120ms var(--ease); } |
| 624 | .row:hover .row-actions, .row:focus-within .row-actions { opacity: 1; } | |
| 621 | .row:focus-within .row-actions { opacity: 1; } | |
| 622 | @media (hover: hover) and (pointer: fine) { .row:hover .row-actions { opacity: 1; } } | |
| 625 | 623 | /* Settings controls are the point of their row, never revealed by hover: |
| 626 | 624 | they wrap under the text before they would clip, at any width. */ |
| 627 | 625 | .row-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } |
| @@ -647,7 +645,7 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 647 | 645 | .edit-row > .input { flex: 1 1 160px; width: auto; min-width: 0; } |
| 648 | 646 | .edit-row .btn { flex: none; } |
| 649 | 647 | .label-open { color: var(--muted-fg); font-size: 13px; text-decoration: underline; text-underline-offset: 2px; } |
| 650 | .label-open:hover { color: var(--fg); } | |
| 648 | @media (hover: hover) and (pointer: fine) { .label-open:hover { color: var(--fg); } } | |
| 651 | 649 | /* A swatch and its hex, as one control-shaped thing. */ |
| 652 | 650 | .color-field { |
| 653 | 651 | display: inline-flex; align-items: center; gap: 8px; flex: none; |
| @@ -721,9 +719,8 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 721 | 719 | scroll-snap-align: start; |
| 722 | 720 | color: var(--muted-fg); font-size: 14px; |
| 723 | 721 | border-radius: var(--radius-sm) var(--radius-sm) 0 0; |
| 724 | transition: color 120ms var(--ease), background-color 120ms var(--ease); | |
| 725 | 722 | } |
| 726 | .tabs > a:hover { color: var(--fg); background: var(--muted); } | |
| 723 | @media (hover: hover) and (pointer: fine) { .tabs > a:hover { color: var(--fg); background: var(--muted); } } | |
| 727 | 724 | .tabs > a[aria-current="page"] { color: var(--fg); font-weight: 550; } |
| 728 | 725 | .tabs > a[aria-current="page"]::after { |
| 729 | 726 | content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; |
| @@ -745,10 +742,9 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 745 | 742 | min-height: 28px; padding: 0 10px; border-radius: var(--radius-sm); |
| 746 | 743 | font-size: 13px; font-weight: 500; color: var(--muted-fg); |
| 747 | 744 | white-space: nowrap; cursor: pointer; margin: 0; |
| 748 | transition: background-color 120ms var(--ease), color 120ms var(--ease); | |
| 749 | 745 | } |
| 750 | 746 | .seg > button { border: 0; background: none; } |
| 751 | .seg > a:hover, .seg > label:hover, .seg > button:hover { color: var(--fg); } | |
| 747 | @media (hover: hover) and (pointer: fine) { .seg > a:hover, .seg > label:hover, .seg > button:hover { color: var(--fg); } } | |
| 752 | 748 | .seg > label input { position: absolute; opacity: 0; pointer-events: none; } |
| 753 | 749 | .seg > a[aria-current="page"], .seg > label:has(input:checked), .seg > button[aria-pressed="true"] { |
| 754 | 750 | background: var(--card); color: var(--fg); box-shadow: var(--shadow-1); |
| @@ -772,10 +768,13 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 772 | 768 | min-width: 220px; max-width: min(320px, calc(100vw - 32px)); padding: 5px; |
| 773 | 769 | background: var(--card); border: 1px solid var(--border); |
| 774 | 770 | border-radius: var(--radius-lg); box-shadow: var(--shadow-2); |
| 775 | animation: pop 140ms var(--ease) both; | |
| 771 | transform-origin: top right; transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); | |
| 776 | 772 | max-height: min(70vh, 480px); overflow-y: auto; scrollbar-width: none; |
| 777 | 773 | } |
| 778 | .menu[data-align="start"] > .menu-panel { right: auto; left: 0; } | |
| 774 | .menu[data-align="start"] > .menu-panel { right: auto; left: 0; transform-origin: top left; } | |
| 775 | /* An enter is a transition from @starting-style, so it can be cut short; where @starting-style is | |
| 776 | unknown the panel simply appears whole. It grows from its trigger's corner, never from nothing. */ | |
| 777 | @starting-style { .menu[open] > .menu-panel { opacity: 0; transform: scale(.95); } } | |
| 779 | 778 | @keyframes pop { from { opacity: 0; transform: translateY(-4px); } } |
| 780 | 779 | .menu-title { |
| 781 | 780 | display: block; padding: 6px 10px 4px; |
| @@ -787,12 +786,12 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 787 | 786 | padding: 7px 10px; border: 0; border-radius: var(--radius-sm); |
| 788 | 787 | background: none; color: var(--fg); font-size: 14px; |
| 789 | 788 | text-align: left; cursor: pointer; |
| 790 | transition: background-color 100ms var(--ease); | |
| 791 | 789 | } |
| 792 | .menu-item:hover, .menu-item:focus-visible { background: var(--muted); color: var(--fg); } | |
| 790 | .menu-item:focus-visible { background: var(--muted); color: var(--fg); } | |
| 791 | @media (hover: hover) and (pointer: fine) { .menu-item:hover { background: var(--muted); color: var(--fg); } } | |
| 793 | 792 | .menu-item[aria-current="true"] { font-weight: 550; } |
| 794 | 793 | .menu-item[aria-disabled="true"] { cursor: not-allowed; opacity: .65; } |
| 795 | .menu-item[aria-disabled="true"]:hover { background: none; } | |
| 794 | @media (hover: hover) and (pointer: fine) { .menu-item[aria-disabled="true"]:hover { background: none; } } | |
| 796 | 795 | .menu-item small { display: block; } |
| 797 | 796 | .menu-item[aria-disabled="true"] .grow { white-space: normal; } |
| 798 | 797 | :is(.menu-item, .menu-row) .ico { color: var(--faint); } |
| @@ -816,11 +815,11 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 816 | 815 | inset: auto 0 calc(100% - 100dvh); max-width: none; max-height: 80dvh; |
| 817 | 816 | padding: 8px 8px max(8px, env(safe-area-inset-bottom)); |
| 818 | 817 | border-width: 1px 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; |
| 819 | animation: rise 200ms var(--ease) both; | |
| 818 | transition: transform var(--dur-3) var(--ease); | |
| 820 | 819 | } |
| 820 | @starting-style { .topbar .menu[open] > .menu-panel { transform: translateY(100%); } } | |
| 821 | 821 | .topbar :is(.menu-item, .menu-row) { min-height: 44px; font-size: 16px; } |
| 822 | 822 | } |
| 823 | @keyframes rise { from { transform: translateY(100%); } } | |
| 824 | 823 | /* No anchor positioning: browsers that accept anchor-name but not |
| 825 | 824 | position-area would keep position: fixed and park the panel at the |
| 826 | 825 | viewport's corner. Absolute-inside-the-details works everywhere. */ |
| @@ -836,7 +835,7 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 836 | 835 | transition: transform 120ms var(--ease); |
| 837 | 836 | } |
| 838 | 837 | .disclosure[open] > summary::before { transform: rotate(90deg); } |
| 839 | .disclosure > summary:hover { color: var(--accent); } | |
| 838 | @media (hover: hover) and (pointer: fine) { .disclosure > summary:hover { color: var(--accent); } } | |
| 840 | 839 | .disclosure > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); } |
| 841 | 840 | /* A page's "? Help" (page_help.ts): a 44px target a thumb can hit, and a ring a keyboard can see. */ |
| 842 | 841 | .disclosure[data-page-help] > summary { width: fit-content; min-width: 44px; } |
| @@ -850,7 +849,6 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 850 | 849 | padding: 0 8px; min-height: 32px; |
| 851 | 850 | border: 1px solid var(--border); border-radius: var(--radius-sm); |
| 852 | 851 | background: var(--card); color: var(--muted-fg); |
| 853 | transition: border-color 140ms var(--ease); | |
| 854 | 852 | } |
| 855 | 853 | .topbar-search:focus-within { border-color: var(--accent); } |
| 856 | 854 | .topbar-search input { |
| @@ -878,7 +876,11 @@ details[open] > summary.row > .row-lead { transform: rotate(90deg); } | ||
| 878 | 876 | .dialog::backdrop { background: color-mix(in srgb, var(--bg) 62%, #0008); backdrop-filter: blur(3px); } |
| 879 | 877 | /* The one open-state rule (#11831): an overlay is laid out only while open, and every overlay |
| 880 | 878 | (dialog, palette) gets its layout here; a component adds only what is its own. */ |
| 881 | .dialog[open] { display: flex; flex-direction: column; animation: pop 140ms var(--ease) both; } | |
| 879 | .dialog[open] { display: flex; flex-direction: column; transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); } | |
| 880 | /* A modal stays centred: it fades and settles from .95 in place. The palette opens from the keyboard | |
| 881 | many times a day, so it has no motion at all. */ | |
| 882 | @starting-style { .dialog[open] { opacity: 0; transform: scale(.95); } } | |
| 883 | .dialog.palette { transition: none; } | |
| 882 | 884 | .dialog-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; } |
| 883 | 885 | .dialog-head h2 { flex: 1; } |
| 884 | 886 | .dialog-body { padding: 12px 16px; } |
| @@ -939,7 +941,8 @@ html[data-overlay] { overflow: hidden; } | ||
| 939 | 941 | } |
| 940 | 942 | /* One highlight. The pointer moves it (the script listens) rather than |
| 941 | 943 | painting a second one under the cursor; the finder keeps plain hover. */ |
| 942 | .palette-item[aria-selected="true"], .finder .palette-item:hover { background: var(--muted); } | |
| 944 | .palette-item[aria-selected="true"] { background: var(--muted); } | |
| 945 | @media (hover: hover) and (pointer: fine) { .finder .palette-item:hover { background: var(--muted); } } | |
| 943 | 946 | /* --muted-fg is 4.40:1 on that highlight in light; the detail takes --fg there. */ |
| 944 | 947 | .palette-item[aria-selected="true"] .cat { color: var(--fg); } |
| 945 | 948 | .palette-foot { |
| @@ -1040,7 +1043,8 @@ a[data-palette] { display: none; } | ||
| 1040 | 1043 | opacity: 0; pointer-events: none; transition: opacity 120ms var(--ease); |
| 1041 | 1044 | } |
| 1042 | 1045 | [data-tip][data-tip-side="bottom"]::after { bottom: auto; top: calc(100% + 6px); } |
| 1043 | [data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; } | |
| 1046 | [data-tip]:focus-visible::after { opacity: 1; } | |
| 1047 | @media (hover: hover) and (pointer: fine) { [data-tip]:hover::after { opacity: 1; } } | |
| 1044 | 1048 | @media (pointer: coarse) { [data-tip]::after { display: none; } } |
| 1045 | 1049 | |
| 1046 | 1050 | /* ---- page head: title, actions, subtitle ---- */ |
| @@ -1145,7 +1149,7 @@ a[data-palette] { display: none; } | ||
| 1145 | 1149 | .bd-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; } |
| 1146 | 1150 | .bd-head h2 { margin: 0; font-size: 16px; } |
| 1147 | 1151 | .bd-head a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--muted-fg); } |
| 1148 | .bd-head a:hover { color: var(--accent); } | |
| 1152 | @media (hover: hover) and (pointer: fine) { .bd-head a:hover { color: var(--accent); } } | |
| 1149 | 1153 | .bd-sub { flex: 1 1 320px; margin: 0; font-size: 13px; color: var(--muted-fg); } |
| 1150 | 1154 | .bd-ask .field { flex: 1 1 240px; max-width: 480px; } |
| 1151 | 1155 | .bd-ask { align-items: flex-end; } |
| @@ -1170,7 +1174,7 @@ a[data-palette] { display: none; } | ||
| 1170 | 1174 | .fold > summary { flex-wrap: wrap; align-items: baseline; gap: 0 12px; padding: 12px 0; } |
| 1171 | 1175 | .fold-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--fg); } |
| 1172 | 1176 | .fold-state { flex: 1 1 200px; font-size: 13px; font-weight: 400; color: var(--muted-fg); } |
| 1173 | .fold > summary:hover .fold-title { color: var(--accent); } | |
| 1177 | @media (hover: hover) and (pointer: fine) { .fold > summary:hover .fold-title { color: var(--accent); } } | |
| 1174 | 1178 | .fold-body { display: flex; flex-direction: column; gap: 8px; padding: 0 0 16px 16px; font-size: 14px; } |
| 1175 | 1179 | .fold-body > p { margin: 0; } |
| 1176 | 1180 | .held-n { display: inline-block; margin-right: 12px; white-space: nowrap; } |
| @@ -1185,7 +1189,7 @@ a[data-palette] { display: none; } | ||
| 1185 | 1189 | .bp-body { min-width: 0; padding-top: 8px; } |
| 1186 | 1190 | .bp-foot { margin: auto 0 0; gap: 16px; font-size: var(--fs-min); color: var(--muted-fg); } |
| 1187 | 1191 | .bp-foot > a { display: inline-flex; align-items: center; min-height: 44px; } |
| 1188 | .bp-foot > a:hover { color: var(--accent); } | |
| 1192 | @media (hover: hover) and (pointer: fine) { .bp-foot > a:hover { color: var(--accent); } } | |
| 1189 | 1193 | .bp-w2 { flex: 2 1 calc(66.667% - 4px); } |
| 1190 | 1194 | .bp-w3 { flex: 1 1 100%; } |
| 1191 | 1195 | @media (min-width: 720px) { |
| @@ -1223,7 +1227,7 @@ a[data-palette] { display: none; } | ||
| 1223 | 1227 | display: flex; align-items: center; min-height: 28px; padding: 0 8px; |
| 1224 | 1228 | font-size: 13px; color: var(--muted-fg); border-radius: var(--radius-sm); |
| 1225 | 1229 | } |
| 1226 | .settings-nav a:hover, .settings-jump-list a:hover { background: var(--muted); color: var(--fg); } | |
| 1230 | @media (hover: hover) and (pointer: fine) { .settings-nav a:hover, .settings-jump-list a:hover { background: var(--muted); color: var(--fg); } } | |
| 1227 | 1231 | .settings-nav a[aria-current="page"], .settings-jump-list a[aria-current="page"] { color: var(--fg); font-weight: 550; background: var(--muted); } |
| 1228 | 1232 | .settings-nav a[hidden], .settings-group[hidden] { display: none; } |
| 1229 | 1233 | .settings-group { display: flex; flex-direction: column; gap: 1px; } |
| @@ -1299,7 +1303,7 @@ a[data-palette] { display: none; } | ||
| 1299 | 1303 | display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; |
| 1300 | 1304 | font: inherit; font-size: 13px; color: var(--muted-fg); background: transparent; border: 0; border-radius: var(--radius-sm); cursor: pointer; |
| 1301 | 1305 | } |
| 1302 | .segmented button:hover { color: var(--fg); } | |
| 1306 | @media (hover: hover) and (pointer: fine) { .segmented button:hover { color: var(--fg); } } | |
| 1303 | 1307 | .segmented-on { color: var(--fg); font-weight: 550; background: var(--card); box-shadow: var(--shadow-1); cursor: default; } |
| 1304 | 1308 | |
| 1305 | 1309 | .setting-table td { vertical-align: middle; } |
| @@ -1366,14 +1370,16 @@ ul.list { overflow-anchor: none; } | ||
| 1366 | 1370 | |
| 1367 | 1371 | /* Asked for less motion, the page keeps every state and loses the movement. |
| 1368 | 1372 | \`!important\` because a bare \`*\` has no specificity: every class rule above |
| 1369 | that sets an animation or transition would win. Durations collapse rather | |
| 1373 | that sets an animation or transition would win. Animations collapse rather | |
| 1370 | 1374 | than \`animation: none\`, so \`animationend\` still fires (src/web/live.ts |
| 1371 | removes its flash class on it). A busy loader stops turning and dims. */ | |
| 1375 | removes its flash class on it); a transition keeps only its fade, so what | |
| 1376 | would travel arrives in place and what fades still fades. A busy loader | |
| 1377 | stops turning and dims. */ | |
| 1372 | 1378 | @media (prefers-reduced-motion: reduce) { |
| 1373 | 1379 | *, *::before, *::after { |
| 1374 | 1380 | animation-duration: .01ms !important; |
| 1375 | 1381 | animation-iteration-count: 1 !important; |
| 1376 | transition-duration: .01ms !important; | |
| 1382 | transition-property: opacity !important; | |
| 1377 | 1383 | } |
| 1378 | 1384 | .btn[aria-busy="true"] .ico-loader { opacity: .6; } |
| 1379 | 1385 | } |
src/web/style/content.ts +32 −24
| @@ -52,9 +52,9 @@ a[data-waves-link] { display: inline-flex; align-items: center; min-height: 44px | ||
| 52 | 52 | white-space: nowrap; cursor: default; |
| 53 | 53 | } |
| 54 | 54 | a.where-place, button.where-place { cursor: pointer; } |
| 55 | a.where-place:hover, button.where-place:hover { | |
| 55 | @media (hover: hover) and (pointer: fine) { a.where-place:hover, button.where-place:hover { | |
| 56 | 56 | border-color: var(--border); background: var(--muted); color: var(--fg); |
| 57 | } | |
| 57 | } } | |
| 58 | 58 | .where-place .ico { color: var(--faint); flex: none; } |
| 59 | 59 | /* The dot is the place's aria-hidden span: ● ○ ◆ are decoration, and the |
| 60 | 60 | state and the word beside them already say what they mean. */ |
| @@ -74,14 +74,15 @@ a.where-place:hover, button.where-place:hover { | ||
| 74 | 74 | .row-meta .where-place .ico { display: none; } |
| 75 | 75 | .row-meta .where-place > span[aria-hidden="true"] { margin-right: 3px; } |
| 76 | 76 | .row-title a { color: inherit; text-decoration: none; } |
| 77 | .row-title a:hover { color: var(--accent); } | |
| 77 | @media (hover: hover) and (pointer: fine) { .row-title a:hover { color: var(--accent); } } | |
| 78 | 78 | /* The signed-in home (#9378). Its rows already clip one line and its |
| 79 | 79 | sections are grid cells with min-width 0 (feed_style.ts); what is left is a |
| 80 | 80 | long app name, which wraps inside its chip, and the tell box's input and |
| 81 | 81 | select, which may shrink. The chip row is server-rendered, so a wrapped |
| 82 | 82 | chip is its final height on first paint. */ |
| 83 | 83 | .home-doors a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; box-sizing: border-box; } |
| 84 | .home-doors a:hover, .home-doors a:focus-visible { text-decoration-thickness: 2px; } | |
| 84 | .home-doors a:focus-visible { text-decoration-thickness: 2px; } | |
| 85 | @media (hover: hover) and (pointer: fine) { .home-doors a:hover { text-decoration-thickness: 2px; } } | |
| 85 | 86 | .home-doors { display: flex; flex-wrap: wrap; gap: 4px 12px; } |
| 86 | 87 | .step-body { padding: 4px 16px 16px 44px; } |
| 87 | 88 | .step-body > :first-child { margin-top: 0; } |
| @@ -125,7 +126,7 @@ a.where-place:hover, button.where-place:hover { | ||
| 125 | 126 | background: var(--muted); color: var(--muted-fg); |
| 126 | 127 | font-size: 12.5px; text-decoration: none; |
| 127 | 128 | } |
| 128 | a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); } | |
| 129 | @media (hover: hover) and (pointer: fine) { a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); } } | |
| 129 | 130 | .origin-chip .ico { color: var(--faint); flex: none; } |
| 130 | 131 | /* An imported author is the origin's login, so it wears the origin's mark |
| 131 | 132 | where a local avatar would be. */ |
| @@ -227,7 +228,8 @@ a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); } | ||
| 227 | 228 | .chart-line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; } |
| 228 | 229 | .chart-wash { fill: currentColor; fill-opacity: 0.08; } |
| 229 | 230 | .chart-hit { fill: currentColor; fill-opacity: 0; } |
| 230 | .chart-hit:hover, .chart a:focus-visible > .chart-hit { fill-opacity: 0.14; } | |
| 231 | .chart a:focus-visible > .chart-hit { fill-opacity: 0.14; } | |
| 232 | @media (hover: hover) and (pointer: fine) { .chart-hit:hover { fill-opacity: 0.14; } } | |
| 231 | 233 | /* A release, roll or config change: a dashed vertical mark; the synced crosshair is solid. */ |
| 232 | 234 | .chart-mark-hit { stroke: transparent; stroke-width: 8; vector-effect: non-scaling-stroke; pointer-events: stroke; } |
| 233 | 235 | .chart-mark { pointer-events: none; stroke: var(--muted-fg); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; } |
| @@ -236,9 +238,11 @@ a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); } | ||
| 236 | 238 | .chart-tip > div > div { display: flex; justify-content: space-between; gap: 16px; } |
| 237 | 239 | .chart-tip > div > div > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-fg); } |
| 238 | 240 | .chart .bar, .chart .cell { fill: currentColor; } |
| 239 | .chart .bar:hover, .chart a:focus-visible > .bar { fill-opacity: 0.7; } | |
| 241 | .chart a:focus-visible > .bar { fill-opacity: 0.7; } | |
| 242 | @media (hover: hover) and (pointer: fine) { .chart .bar:hover { fill-opacity: 0.7; } } | |
| 240 | 243 | .chart .cell { stroke: var(--card); stroke-width: 1; vector-effect: non-scaling-stroke; } |
| 241 | .chart .cell:hover, .chart a:focus-visible > .cell { stroke: var(--fg); } | |
| 244 | .chart a:focus-visible > .cell { stroke: var(--fg); } | |
| 245 | @media (hover: hover) and (pointer: fine) { .chart .cell:hover { stroke: var(--fg); } } | |
| 242 | 246 | .chart .area { fill-opacity: 0.85; } |
| 243 | 247 | .chart a:focus-visible { outline: none; } |
| 244 | 248 | .chart-x { grid-column: 2; display: flex; justify-content: space-between; height: 16px; } |
| @@ -261,7 +265,8 @@ a.origin-chip:hover { border-color: var(--border-strong); color: var(--fg); } | ||
| 261 | 265 | .bp-h3 .chart-box { --chart-h: 536px; } |
| 262 | 266 | /* A narrow chart keeps three of its five labels: the first, the middle and the last. */ |
| 263 | 267 | @container (max-width: 440px) { .chart-x:not(.is-slots) > span:nth-child(2):nth-last-child(4), .chart-x:not(.is-slots) > span:nth-child(4):nth-last-child(2) { display: none; } } |
| 264 | @media (forced-colors: active) { .chart-hit:hover, .chart a:focus-visible > .chart-hit { fill: Highlight; fill-opacity: 0.4; } } | |
| 268 | @media (forced-colors: active) { .chart a:focus-visible > .chart-hit { fill: Highlight; fill-opacity: 0.4; } | |
| 269 | @media (hover: hover) and (pointer: fine) { .chart-hit:hover { fill: Highlight; fill-opacity: 0.4; } } } | |
| 265 | 270 | #summary { display: flex; flex-wrap: wrap; gap: 6px; } |
| 266 | 271 | #summary .pill { max-width: 100%; white-space: normal; } |
| 267 | 272 | /* The stacked bar chart's series colours, for its bars (fleet-graph.ts). |
| @@ -342,15 +347,15 @@ form.inline { display: inline; margin-left: auto; } | ||
| 342 | 347 | .door-shelf > .card { min-width: 0; margin: 0; padding-top: 14px; border: 0; border-top: 1px solid var(--border-strong); border-radius: 0; background: transparent; box-shadow: none; overflow: visible; } |
| 343 | 348 | .door-kick { margin: 0 0 14px; font-family: var(--mono); font-size: 12.5px; color: var(--muted-fg); } |
| 344 | 349 | .door-kick span { color: var(--fg); } |
| 345 | .door-shelf .look { aspect-ratio: 16 / 9; transition: border-color 0.15s ease; } | |
| 346 | .door-shelf .look:hover { border-color: var(--border-strong); } | |
| 350 | .door-shelf .look { aspect-ratio: 16 / 9; } | |
| 351 | @media (hover: hover) and (pointer: fine) { .door-shelf .look:hover { border-color: var(--border-strong); } } | |
| 347 | 352 | .door-shelf .look img { height: 100%; object-fit: cover; object-position: top; } |
| 348 | 353 | .door-shelf .card-body { padding: 14px 0 0; gap: 4px; } |
| 349 | 354 | .door-shelf .card-body strong { font-size: 16px; font-weight: 500; letter-spacing: -0.015em; overflow-wrap: anywhere; } |
| 350 | 355 | .door-line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 3em; line-height: 1.5; } |
| 351 | 356 | .door-verbs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-family: var(--mono); font-size: 12.5px; } |
| 352 | 357 | .door-verbs a { min-height: 24px; color: var(--muted-fg); } |
| 353 | .door-verbs a:hover { color: var(--fg); } | |
| 358 | @media (hover: hover) and (pointer: fine) { .door-verbs a:hover { color: var(--fg); } } | |
| 354 | 359 | .door-verbs .door-verb-first { color: var(--fg); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; } |
| 355 | 360 | .door-more { margin-top: 36px; } |
| 356 | 361 | .door-steps { display: grid; gap: 32px; margin: 44px 0 0; padding: 0; list-style: none; counter-reset: door-step; } |
| @@ -364,7 +369,7 @@ form.inline { display: inline; margin-left: auto; } | ||
| 364 | 369 | .door-pulse { margin: 72px 0 0; } |
| 365 | 370 | .door-pulse svg { display: block; width: 100%; height: clamp(72px, 10vw, 120px); fill: var(--fg); } |
| 366 | 371 | .door-pulse-quiet { fill: var(--border-strong); } |
| 367 | .door-pulse rect:hover { fill: var(--accent); } | |
| 372 | @media (hover: hover) and (pointer: fine) { .door-pulse rect:hover { fill: var(--accent); } } | |
| 368 | 373 | .door-pulse figcaption { margin-top: 10px; } |
| 369 | 374 | .door-org { margin-top: 64px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted-fg); } |
| 370 | 375 | .door-org a { color: var(--fg); } |
| @@ -487,9 +492,9 @@ form.inline { display: inline; margin-left: auto; } | ||
| 487 | 492 | border-right: 1px solid var(--border); |
| 488 | 493 | } |
| 489 | 494 | .code .ln a { color: inherit; display: block; } |
| 490 | .code .ln a:hover { color: var(--accent); } | |
| 495 | @media (hover: hover) and (pointer: fine) { .code .ln a:hover { color: var(--accent); } } | |
| 491 | 496 | .code pre { white-space: pre; line-height: 1.55; min-height: 1.55em; font-variant-ligatures: none; } |
| 492 | .code tr:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); } | |
| 497 | @media (hover: hover) and (pointer: fine) { .code tr:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); } } | |
| 493 | 498 | .code tr:target, .code tr[data-hl] { |
| 494 | 499 | background: color-mix(in srgb, var(--attn) 16%, transparent); |
| 495 | 500 | } |
| @@ -698,9 +703,9 @@ img.img-box, .prose img.img-box, .tell-picture.img-box { display: block; width: | ||
| 698 | 703 | .prose a { |
| 699 | 704 | color: var(--accent); text-decoration: underline; |
| 700 | 705 | text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); |
| 701 | text-underline-offset: 3px; transition: text-decoration-color 140ms var(--ease); | |
| 706 | text-underline-offset: 3px; | |
| 702 | 707 | } |
| 703 | .prose a:hover { text-decoration-color: currentColor; } | |
| 708 | @media (hover: hover) and (pointer: fine) { .prose a:hover { text-decoration-color: currentColor; } } | |
| 704 | 709 | .prose img { border-radius: var(--radius-sm); } |
| 705 | 710 | /* A markdown table is wide by nature: it keeps its own width (headers on one line, body cells wrap only past 32ch) |
| 706 | 711 | and scrolls sideways inside its one frame, with momentum, never the page. The edge shadows are the old |
| @@ -816,7 +821,7 @@ img.img-box, .prose img.img-box, .tell-picture.img-box { display: block; width: | ||
| 816 | 821 | .nonl { color: var(--del-fg); opacity: .7; padding-left: 8px; } |
| 817 | 822 | .dl:target .dc, .dl[data-hl] .dc { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--attn) 55%, transparent); } |
| 818 | 823 | .dn-comment { color: var(--faint); display: inline-block; } |
| 819 | .dn-comment:hover { color: var(--accent-fg); background: var(--accent); border-radius: 4px; } | |
| 824 | @media (hover: hover) and (pointer: fine) { .dn-comment:hover { color: var(--accent-fg); background: var(--accent); border-radius: 4px; } } | |
| 820 | 825 | .dl-bar td { padding: 4px 8px; background: var(--muted); } |
| 821 | 826 | .dl-bar span { position: sticky; left: 8px; display: inline-flex; gap: 8px; font-family: var(--font); } |
| 822 | 827 | /* review comments ride under their line, full width */ |
| @@ -997,7 +1002,7 @@ img.img-box, .prose img.img-box, .tell-picture.img-box { display: block; width: | ||
| 997 | 1002 | .ex-dir > summary > .ico { transition: transform 120ms var(--ease); } |
| 998 | 1003 | .ex-dir[open] > summary > .ico { transform: rotate(90deg); } |
| 999 | 1004 | .ex-dir > summary { font-weight: 500; color: var(--fg); } |
| 1000 | .ex-file:hover, .ex-dir > summary:hover, .ex-more:hover { background: var(--muted); color: var(--fg); } | |
| 1005 | @media (hover: hover) and (pointer: fine) { .ex-file:hover, .ex-dir > summary:hover, .ex-more:hover { background: var(--muted); color: var(--fg); } } | |
| 1001 | 1006 | .ex-file[aria-current="page"] { |
| 1002 | 1007 | background: color-mix(in srgb, var(--accent) 12%, transparent); |
| 1003 | 1008 | color: var(--fg); font-weight: 550; |
| @@ -1045,12 +1050,14 @@ img.img-box, .prose img.img-box, .tell-picture.img-box { display: block; width: | ||
| 1045 | 1050 | } |
| 1046 | 1051 | .code-layout > [data-split]::after { |
| 1047 | 1052 | content: ""; position: absolute; top: 0; bottom: 0; left: 50%; |
| 1048 | width: 1px; margin-left: -0.5px; background: var(--border); | |
| 1049 | transition: background-color 120ms var(--ease), width 120ms var(--ease), margin-left 120ms var(--ease); | |
| 1053 | width: 1px; translate: -50% 0; background: var(--border); | |
| 1050 | 1054 | } |
| 1051 | .code-layout > [data-split]:hover::after, .code-layout > [data-split]:focus-visible::after, .code-layout[data-dragging] > [data-split]::after { | |
| 1052 | width: 3px; margin-left: -1.5px; background: var(--accent); | |
| 1055 | .code-layout > [data-split]:focus-visible::after, .code-layout[data-dragging] > [data-split]::after { | |
| 1056 | width: 3px; background: var(--accent); | |
| 1053 | 1057 | } |
| 1058 | @media (hover: hover) and (pointer: fine) { .code-layout > [data-split]:hover::after { | |
| 1059 | width: 3px; background: var(--accent); | |
| 1060 | } } | |
| 1054 | 1061 | .code-layout > [data-split]:focus-visible { outline-offset: 0; } |
| 1055 | 1062 | /* While a drag is on, nothing beneath the pointer may select or steal |
| 1056 | 1063 | the cursor. */ |
| @@ -1180,7 +1187,8 @@ textarea.editor:focus-visible { outline: none; } | ||
| 1180 | 1187 | .branch-row .row-meta { white-space: normal; overflow-wrap: anywhere; } |
| 1181 | 1188 | .branch-row .row-trail { flex: 0 1 auto; flex-wrap: wrap; gap: 4px 12px; } |
| 1182 | 1189 | .branch-row .branch-del { color: var(--muted-fg); } |
| 1183 | .branch-row .branch-del:hover, .branch-row .branch-del:focus-visible { color: var(--danger); } | |
| 1190 | .branch-row .branch-del:focus-visible { color: var(--danger); } | |
| 1191 | @media (hover: hover) and (pointer: fine) { .branch-row .branch-del:hover { color: var(--danger); } } | |
| 1184 | 1192 | @media (max-width: 719px) { |
| 1185 | 1193 | .branch-row { flex-wrap: wrap; } |
| 1186 | 1194 | .branch-row .row-trail { flex: 1 1 100%; justify-content: flex-start; } |
src/web/talk_parts.ts +1 −1
| @@ -453,7 +453,7 @@ export const widgetCss = /* css */ ` | ||
| 453 | 453 | .wchart stop { stop-color: var(--c); } |
| 454 | 454 | .wchart :is(rect, path):not(.wchart-line, .wchart-fill, .wchart-hit) { fill: var(--c); stroke: var(--card); stroke-width: 1; vector-effect: non-scaling-stroke; } |
| 455 | 455 | .wchart-hit { fill: var(--fg); fill-opacity: 0; } |
| 456 | .wchart-hit:hover { fill-opacity: .05; } | |
| 456 | @media (hover: hover) and (pointer: fine) { .wchart-hit:hover { fill-opacity: .05; } } | |
| 457 | 457 | .wchart-tick { position: absolute; left: 0; width: 28px; text-align: right; top: 0; transform: translateY(-50%); } |
| 458 | 458 | .wchart-tick.is-zero { top: 100%; } |
| 459 | 459 | .wchart-x { display: flex; justify-content: space-between; margin: 6px 12px 0 32px; } |
test/components-reduced-motion.test.ts +2 −2
| @@ -3,9 +3,9 @@ import { components } from "../src/web/style/components"; | ||
| 3 | 3 | |
| 4 | 4 | const block = components.match(/@media \(prefers-reduced-motion: reduce\) \{([\s\S]*?)\n\}\n/)?.[1] ?? ""; |
| 5 | 5 | |
| 6 | test("reduced motion collapses every animation and transition, and wins over class rules", () => { | |
| 6 | test("reduced motion collapses every animation, keeps a transition's fade and drops its travel, and wins over class rules", () => { | |
| 7 | 7 | expect(block).toContain("*, *::before, *::after"); |
| 8 | for (const d of ["animation-duration: .01ms", "animation-iteration-count: 1", "transition-duration: .01ms"]) { | |
| 8 | for (const d of ["animation-duration: .01ms", "animation-iteration-count: 1", "transition-property: opacity"]) { | |
| 9 | 9 | expect(block).toContain(`${d} !important;`); |
| 10 | 10 | } |
| 11 | 11 | }); |
test/design-lint-feel.test.ts added +73
| @@ -0,0 +1,73 @@ | ||
| 1 | /** | |
| 2 | * How motion feels (`src/design/feel.ts`): the design lint refuses ease-in, UI motion over 300 ms, | |
| 3 | * a scale from 0, a transition of anything but transform and opacity, and a hover outside the | |
| 4 | * hover media query; the tree has none but what docs/design/feel-allow.json names, each with its | |
| 5 | * reason, and no allowance outlives its finding. An enter from @starting-style never decides the | |
| 6 | * end state: where the browser does not know the at-rule, the element simply appears whole. | |
| 7 | */ | |
| 8 | import { expect, test } from "bun:test"; | |
| 9 | import { readFileSync } from "node:fs"; | |
| 10 | import { FEEL_ALLOW, feelIn, scanFeel, staleAllows, type FeelAllow } from "../src/design/feel.ts"; | |
| 11 | import { sourceFiles, cssBlocksAt } from "../src/design/overlay.ts"; | |
| 12 | ||
| 13 | const sheet = (css: string): string => `export const x = /* css */ \`${css}\`;`; | |
| 14 | const rules = (css: string): string[] => feelIn(sheet(css)).map((f) => f.rule); | |
| 15 | ||
| 16 | test("each rule is seen, and what keeps to it is not", () => { | |
| 17 | expect(rules(".a { transition: opacity 120ms ease-in; }")).toEqual(["easein"]); | |
| 18 | expect(rules(".a { transition: opacity 120ms ease-in-out; }")).toEqual([]); | |
| 19 | expect(rules(".a { transition: transform 400ms var(--ease); }")).toEqual(["slow"]); | |
| 20 | expect(rules(".a { animation: pop 450ms var(--ease) both; }")).toEqual(["slow"]); | |
| 21 | // A loop is an indicator, not a transition. | |
| 22 | expect(rules(".a { animation: spin 1.1s linear infinite; }")).toEqual([]); | |
| 23 | expect(rules(".a { transform: scale(0); }")).toEqual(["scale0"]); | |
| 24 | expect(rules(".a { transform: scale(.95); }")).toEqual([]); | |
| 25 | expect(rules(".a { transition: background-color 100ms var(--ease); }")).toEqual(["prop"]); | |
| 26 | expect(rules(".a { transition: all 100ms var(--ease); }")).toEqual(["prop"]); | |
| 27 | expect(rules(".a { transition: opacity 100ms var(--ease), transform var(--dur-1) var(--ease); }")).toEqual([]); | |
| 28 | expect(rules(".a { transition-property: opacity !important; }")).toEqual([]); | |
| 29 | expect(rules(".a:hover { color: red; }")).toEqual(["hover"]); | |
| 30 | expect(rules("@media (hover: hover) and (pointer: fine) { .a:hover { color: red; } }")).toEqual([]); | |
| 31 | expect(rules("@media (min-width: 900px) { @media (hover: hover) and (pointer: fine) { .a:hover { color: red; } } }")).toEqual([]); | |
| 32 | expect(rules("@media (min-width: 900px) { .a:hover { color: red; } }")).toEqual(["hover"]); | |
| 33 | }); | |
| 34 | ||
| 35 | test("the tree keeps every rule but its named exceptions, and each exception still has its finding and a reason", () => { | |
| 36 | expect(scanFeel(".")).toEqual([]); | |
| 37 | expect(staleAllows(".")).toEqual([]); | |
| 38 | for (const a of JSON.parse(readFileSync(FEEL_ALLOW, "utf8")) as FeelAllow[]) expect(a.why.length, a.text).toBeGreaterThan(60); | |
| 39 | }); | |
| 40 | ||
| 41 | test("an enter from @starting-style never decides the end state", () => { | |
| 42 | let starts = 0; | |
| 43 | for (const f of sourceFiles(".")) { | |
| 44 | for (const { css } of cssBlocksAt(readFileSync(f, "utf8"))) { | |
| 45 | for (const m of css.matchAll(/@starting-style\s*\{\s*([^{]+)\{([^}]*)\}\s*\}/g)) { | |
| 46 | starts++; | |
| 47 | const selector = m[1]!.trim(); | |
| 48 | // What it starts from is only ever faded, shrunk to .95 or slid: never gone. | |
| 49 | expect(m[2], `${f}: ${selector}`).toMatch(/opacity: 0|scale\(\.95\)|translateY/); | |
| 50 | expect(m[2], `${f}: ${selector}`).not.toMatch(/scale\(\s*0\s*\)|display|visibility/); | |
| 51 | // Outside the at-rule nothing holds that selector faded or shrunk: without it the element | |
| 52 | // is whole. | |
| 53 | const rest = css.replace(m[0], ""); | |
| 54 | for (const r of rest.matchAll(new RegExp(`${selector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*\\{([^}]*)\\}`, "g"))) | |
| 55 | expect(r[1], `${f}: ${selector}`).not.toMatch(/opacity:\s*0[;\s]|scale\(\s*0?\.\d+\s*\)/); | |
| 56 | } | |
| 57 | } | |
| 58 | } | |
| 59 | expect(starts).toBeGreaterThanOrEqual(3); | |
| 60 | }); | |
| 61 | ||
| 62 | test("the strong curve is the one ease, the palette and your own sent message do not move, a button gives under the press", async () => { | |
| 63 | const { base } = await import("../src/web/style/base.ts"); | |
| 64 | const { components } = await import("../src/web/style/components.ts"); | |
| 65 | const { talkCss } = await import("../src/web/pages/talk_client.ts"); | |
| 66 | expect(base).toContain("--ease: cubic-bezier(.23, 1, .32, 1);"); | |
| 67 | expect(base).toContain("--ease-move: cubic-bezier(.77, 0, .175, 1);"); | |
| 68 | expect(components).toContain(".dialog.palette { transition: none; }"); | |
| 69 | expect(components).toContain(".btn:active { opacity: .85; transform: scale(.97); }"); | |
| 70 | expect(talkCss).toContain(".talk-log > [data-in]:not(.talk-person)"); | |
| 71 | // Reduced motion keeps the fade and drops the travel. | |
| 72 | for (const css of [base, components]) expect(css).toContain("transition-property: opacity !important;"); | |
| 73 | }); |
new above
offline