/* hackermusic — dark-only base theme + login card. Oxide-inspired: near-black surfaces, hairline borders, tight spacing, small caps labels, one restrained accent — the one colour in here the record chooses, see lib/theme/accent.ts for how, and the block on --accent below for what the app insists on keeping its own. */ /* Registered so the accent can *animate* between two records: a custom property is a string to CSS and has no intermediate values until it is given a syntax, and a theme that snaps from a green album to a red one on the beat the cover loads is the one thing about this feature people notice. With the syntax declared, the transition at the bottom of :root interpolates the colour, and every `color-mix` that reads the token follows it — the whole accent repaints together rather than the washes arriving a frame behind the ink. The initial value is the house accent, so a page whose derivation never came back is exactly what this file looked like before. */ @property --accent { syntax: ""; inherits: true; initial-value: #3fb950; } @property --accent-dim { syntax: ""; inherits: true; initial-value: #237a41; } :root { color-scheme: dark; --bg: #000; /* app background */ --panel: #070708; /* raised surfaces (cards, inputs sit on bg) */ --panel-hover: #0c0d0e; --line: #161719; /* hairlines */ --line-strong: #232527; /* How far the song list recedes when it is left painted behind the gallery (`g`). Not zero, and not 1: the rows are the same library the covers are made of, and seeing them is what makes the two views one screen rather than two — but they are the thing being looked past, so they go to wallpaper. */ --gallery-backdrop: 0.3; --text: #d9dcdf; --text-strong: #f2f4f6; /* hover emphasis — one step above the normal ink */ --text-muted: #8d939a; /* secondary labels: readable, not just legible */ --text-faint: #4d5157; /* gutter furniture: track numbers, rules */ /* The app's own colour, and the default the record has to beat: what is painted before a palette has come back, after one has failed to, and on every page with no playing track to ask. Terminal green. It is a *default*, not a constant — lib/theme/ derives the real value from the current cover and writes both tokens onto the root element, which overrides what is here. What the record is allowed to choose is the hue and the chroma; the lightness stays 0.695, because this token is ink (11px query text, the share line, the playing row's title) as well as fill. Parked there, every hue measures 6.7–8.7:1 against this ground and 4.34–5.15:1 against the typing wash below (the green itself lands at 7.9 and 4.9), so lib/theme/accent.ts lifts a derived accent until it clears 4.5:1 on that wash — about half the wheel needs it, by a few hundredths of a lightness, and never past 0.8. A record that chose the lightness as well would choose it dark, since covers are photographs. */ --accent: #3fb950; --accent-dim: #237a41; /* the same hue at border strength, 3.8:1 */ --danger: #ff6363; /* The A–B region's hue. Deliberately not the accent, which is already four jobs deep here — caret, focus, the playing row, and the fill of the seek row itself — so a region drawn in it disappears behind the playhead, which is exactly where a region begins. That separation used to be free — the accent was green and stayed green — and holding it is now a rule rather than an accident, since an accent drawn out of a photograph can come back in any hue this bar needs to stay legible against: see the bar gate in `lib/theme/accent.ts`, which refuses a candidate that sits near this gold or near the detector's blue below. Those are the only two inks the app draws *over* the accent's own fill, so they are the only two a hue collision is a disappeared region rather than a coincidence. Gold is what every editing surface marks a take in, and it survives being laid over the accent's fill rather than vanishing into it. Its nearest chip-hue neighbours (--chip-aac, --chip-ogg) are text colour on a 12px label, a different enough part of the bar that the format rule — a hue means format — is not being stretched; if it ever feels like it is, this is one token, not a hunt. */ --loop: #e3b341; --loop-dim: #8a6516; /* The detector's own ink, for a region it offered and a key accepted. Gold is the editing ink — the take mark, the thing somebody decided — and a boundary the app inferred from a spectrogram should not be dressed like a boundary the listener placed, least of all when both are on screen with the same two edges and one of them is wrong. Blue rather than the green the codec chips use for a verdict, and deliberately not --chip-mp3's #58a6ff: a hue means format up there, and the one place the two can be seen together is this bar. */ --detected: #79c0ff; --detected-dim: #2f5f86; /* The leading time column's ink: the accent's hue at ink strength, so a duration reads as a measurement rather than as a second title — it shares its row with one, and the two are read side by side. A mix rather than `--accent` itself on purpose: the full accent is the playing row's title, the caret and the focus ring, and a duration wearing it would be yet another thing in the gutter shouting "signal" about a number that only reports length. Held at 40% it stays a tint you notice per-row rather than a hue that means something — chips are where a hue means format — and it keeps 8.7:1 on the playing row at the worst hue the record can bring, so the colour costs nothing in legibility at 11px whichever album is playing. */ --dur-ink: color-mix(in oklab, var(--accent) 40%, var(--text)); /* The favorite heart's ink. Rose is what every music app marks a favorite with, and the one job it has to do is read as *that* and as nothing else on the row — so it is deliberately not the accent (which is the caret and the playing row) and not `--chip-aiff`'s pink either: it ends the title, where the format chips are pushed to the row's right edge and cannot be mistaken for it, which is the rule those chips live by ("a hue means format"). A heart is a state of the track, not a fact about its container, and it gets its own token to keep the two sayings apart. */ --fav: #ff6a9c; /* The heart while its request is still in flight — the optimistic write's own colour, so a press answers at once and the row says "not yet confirmed" until the server says otherwise (see `toggle` in lib/favorites.ts). */ --fav-pending: #a1495f; /* Track info chips: a hue means *format*, and only the codec chip earns one — bitrate / bit depth / sample rate stay neutral, so a color never reads as a verdict on the numbers. Unknown containers fall back to --chip-neutral. */ --chip-neutral: #8d939a; /* Pinned to the house green rather than following the accent, which is what it used to be. "A hue means format" only works while the hue is a constant: driven by the record, flac would be wearing the WAV's violet on one album and the AIFF's pink on the next, and the one reading a chip exists to carry would be gone. The accent and the flac chip being the same green again is fine — that is what they both were before the accent had anywhere to come from. */ --chip-flac: #3fb950; --chip-alac: #39c5cf; --chip-wav: #bc8cff; --chip-aiff: #f778ba; --chip-mp3: #58a6ff; --chip-aac: #d29922; --chip-m4a: #f0883e; --chip-opus: #ff7b72; --chip-ogg: #d5c94f; --radius: 2px; --font-ui: system-ui, -apple-system, "Segoe UI", sans-serif; --font-mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Mono", monospace; /* A few surfaces that are not a mix of anything already here: a button's own hover, a track row's hover, and the two hairlines a raised surface catches the light with. They are drawn as near-black greys and near-white light-edges because the theme is dark; the light theme's block flips each to its own ground. They are tokens rather than literals here so that flip is a change of value and not a hunt through the file. */ --btn-hover: #17181b; --row-hover: #0d0e10; --sheen: rgb(255 255 255 / 6%); /* the light edge a header or thumb catches */ --sheen-faint: rgb(255 255 255 / 3%); /* the same, one step quieter */ /* The cross-fade between two records' accents. Long enough to read as a change of mood rather than a glitch, short enough that nobody waits on it. `steps(8)` rather than `linear`, and the reason is a style recalculation. `--accent` is a registered property, so a `linear` fade changes it on *every frame* — and a registered custom property changing on the root dirties every element that resolves it. Measured over one 400 ms fade (Chrome 152, a 672-element page, a 240 Hz display): 5,966 paint events and 114 ms of paint, plus 158 style recalculations costing 329 ms — a tax paid on every track change, for a colour. With `steps(8)` the value changes eight times instead of ninety-odd: 487 paints, 14 ms, and 20 recalcs at 35 ms. Ten times less work for a fade that arrives in nine visible stages, which at 400 ms between two colours the eye reads as one motion. `linear` is what a machine can afford to do per frame; a hand-drawn eight is what the change was always going to look like. Two properties, both stepped on purpose: dim is derived from the accent in JavaScript, so fading one and snapping the other would separate an ink from its own shadow. */ transition: --accent 400ms steps(8), --accent-dim 400ms steps(8); } /* A colour arriving over 400ms is news that moves, and a listener who has asked for no moving news asked for this too. */ @media (prefers-reduced-motion: reduce) { :root { transition: --accent 0s, --accent-dim 0s; } } /* ------------------------------- Light theme ------------------------------- The same token names on a light ground: `lib/theme/mode.ts` puts `data-theme="light"` on `` when the effective theme is light (the mode was pinned to light, or it is `system` and the machine asked for light), and every surface, ink and hairline below follows. Nothing about the layout changes — only values — which is the point of a token-driven file: a theme is a re-skin of one block, not a second stylesheet. Two things are deliberate here: - **The surfaces grey down, the ink darkens; the accent is derived, not flipped.** On a light ground `--panel` (white) is the *looser* surface and `--bg` the greyed page behind it — the mirror of the dark theme's `--bg`-black / `--panel`-near-black pair. `--accent` here is the house green *worn as dark ink* (`#015b19`), the light theme's `DEFAULT_ACCENTS.light`; in practice `lib/theme/index.ts` overwrites it inline the moment a track is playing, at the light ground's own lightness, so this value is only what shows before the accent paints. The record lends the hue; the ground decides how light the ink is, and on white that means dark. - **The chips darken to stay readable on a light chip.** They are the same hue families as their dark-theme siblings — a hue means format, in either theme — pulled down to ink that clears the same legibility bar on a `--panel`-white background instead of a near-black one. The zoom-modal backdrop, the paused-art scrim, and the login/primary-button greens stay as they are: a black backdrop behind a floated cover and a dark-green primary button read correctly on a light page too, so they are not themed. */ :root[data-theme="light"] { color-scheme: light; --bg: #f4f5f7; /* app background — the greyed page */ --panel: #ffffff; /* raised surfaces (cards, inputs, bars sit on bg) */ --panel-hover: #eef0f2; --line: #d7dadd; /* hairlines */ --line-strong: #c3c8ce; /* On a light page the rows are ink on grey, so the same receding leaves more contrast behind the covers; it has to be pushed further back to read as wallpaper rather than as a list someone forgot to hide. */ --gallery-backdrop: 0.18; --text: #1f2328; --text-strong: #0a0c0e; /* hover emphasis — one step darker than the normal ink */ --text-muted: #5b636c; /* secondary labels */ --text-faint: #979da5; /* gutter furniture: track numbers, rules */ /* The light house pair — the same green as the dark theme's, worn dark enough to be ink on white. Derived in lib/theme/accent.ts, so it clears the same contrast floor there as its bright sibling does on the dark panel; overwritten inline once a record plays. */ --accent: #017523; --accent-dim: #629c66; --danger: #cf222e; --loop: #9a6700; --loop-dim: #7a5400; --detected: #0969da; --detected-dim: #3860a0; --fav: #bf3989; --fav-pending: #cf8aa5; --chip-neutral: #5b636c; --chip-flac: #1a7f37; --chip-alac: #1b9aa5; --chip-wav: #8250df; --chip-aiff: #bf3989; --chip-mp3: #0969da; --chip-aac: #9a6700; --chip-m4a: #bc4c00; --chip-opus: #cf222e; --chip-ogg: #6e7708; --btn-hover: #e9ebee; --row-hover: #eceef1; --sheen: rgb(0 0 0 / 8%); /* a raised edge reads as a faint shadow on a light ground */ --sheen-faint: rgb(0 0 0 / 5%); } * { box-sizing: border-box; } html, body { margin: 0; height: 100%; } body { background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 13px; line-height: 1.45; -webkit-font-smoothing: antialiased; } body, #root { /* A definite height, not a minimum. With min-height the flex column is content-sized, so `flex: 1` on the library panes resolves against their content — and a virtualizer's sizer is hundreds of thousands of px, which made the *document* scroll and the header scroll away. The app shell owns the viewport; the panes scroll inside it. The shell lives on , not just #root: in turnkey client mode the plugin mounts `render(() => , document.body)` — there IS no #root element, and a shell rule that only matches #root silently applies to nothing. Without it the scrollers grow to their sizer, the RO reports 880k px as the viewport, and the virtualizer renders every row. */ height: 100%; display: flex; flex-direction: column; overflow: hidden; } a { color: var(--accent); text-decoration: none; } ::selection { background: color-mix(in oklab, var(--accent) 30%, transparent); } /* ------------------------------- Login ------------------------------- */ .login-overlay { position: fixed; inset: 0; display: grid; /* auto-margined card rather than place-items:center: when the viewport is shorter than the card, centered grid items overflow out of reach at the top, and with #root clipping there is no document scroll left to rescue them. margin:auto degrades to start-alignment and stays scrollable. */ overflow: auto; padding: 16px; background: var(--bg); } .login-card { margin: auto; width: 300px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 0 0 1px rgb(0 0 0 / 40%), 0 16px 40px rgb(0 0 0 / 55%); display: flex; flex-direction: column; gap: 12px; } .login-brand { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; } .login-brand-name { font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--text); } .login-field { display: flex; flex-direction: column; gap: 4px; } .login-field label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); } .login-field input { font-family: var(--font-mono); font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 5px 8px; outline: none; transition: border-color 120ms ease; } .login-field input::placeholder { color: var(--text-muted); opacity: 1; /* placeholders double as field labels — keep them legible */ } .login-field input:focus-visible { border-color: var(--accent-dim); box-shadow: 0 0 0 1px var(--accent-dim); } .login-error { font-size: 13px; color: var(--danger); background: color-mix(in oklab, var(--danger) 8%, transparent); border: 1px solid color-mix(in oklab, var(--danger) 25%, transparent); border-radius: var(--radius); padding: 5px 8px; } /* Buttons ------------------------------------------------------------- */ .btn { font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text); background: var(--panel-hover); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 5px 10px; cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease; } .btn:hover { background: var(--btn-hover); } .btn:focus-visible { outline: none; border-color: var(--accent-dim); box-shadow: 0 0 0 1px var(--accent-dim); } .btn-primary { background: #1f6b34; border-color: #1f6b34; color: #eaffef; } .btn-primary:hover { background: #27853f; } .btn:disabled { cursor: default; opacity: 0.55; } /* ---------------------------- Connected shell ---------------------------- */ /* The harvest readout, in the library toolbar's count gutter. Ready is not rendered at all (see LibraryView), so there is no quiet variant of it: what is left here is the crawl counter and the error, in the voice of lib/harvest/label. */ .harvest-status { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; } .harvest-status--error { color: var(--danger); } /* The crawl line IS the toolbar's bottom border, and is gone when idle. The player bar borrows both halves of it (see .pb-load-track): the harvest waiting for the index and the transport waiting for one track's bytes are the same wait seen from two ends of the server, so they are painted by one definition, each riding the hairline it already had. */ .harvest-track, .pb-load-track { position: absolute; left: 0; right: 0; height: 2px; background: var(--line); overflow: hidden; } .harvest-track { bottom: -1px; /* sit on top of the 1px toolbar border */ transition: opacity 300ms ease; } .pb-load-track { top: -1px; /* ditto, on the bar's own top border */ } .harvest-track--hidden { opacity: 0; } .harvest-bar, .pb-load-bar { position: absolute; inset: 0 auto 0 0; background: var(--accent); } .harvest-bar { width: 0; transition: width 200ms ease; } .harvest-bar--indeterminate, .pb-load-bar { width: 33%; animation: line-crawl 1.1s cubic-bezier(0.65, 0, 0.35, 1) infinite; transition: none; } @keyframes line-crawl { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } } @media (prefers-reduced-motion: reduce) { .harvest-bar--indeterminate, .pb-load-bar { animation-duration: 2.4s; } } .app-placeholder { flex: 1; display: grid; place-items: center; color: var(--text-faint); font-family: var(--font-mono); font-size: 13px; } /* ------------------------------ Library list ------------------------------ */ .lib { flex: 1; min-height: 0; display: flex; flex-direction: column; } .lib-scroll { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; } /* View switch (list ⇄ grid). `g` toggles it, Escape returns to the list. The field that used to sit at this bar's left end is now the command line above the transport (components/CommandLine.tsx), and so is the wash that lit the bar for a search: the instrument that asks "am I inside a search?" is the one holding the text. What is left up here is the collection's own readout — the count, the crawl, the news of a key — and the count is left-anchored because it is the first of them. */ .lib-toolbar { position: relative; /* anchor for the harvest crawl line, which is this border */ flex: none; display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 10px; border-bottom: 1px solid var(--line); background: var(--panel); } /* Searching should look like searching, from across the room. The wash covers the whole line — prompt, query, the count, not the text's line box — because the bar is one instrument and "am I inside a search?" is a question about the bar. It follows the *query*, not the caret: an accepted filter is still a search in progress, the list is narrowed by text you are working on, so it stays lit after Enter hands the keyboard back. The caret is a louder step of the same state. The percentages are measured, not tasted, and they are only right for this theme: --panel is #070708, near black, where a 10-18% mix is #0e150f — a wash you cannot see. These land at #142416 (filtered), #1d3b20 (typing), #301818 / #462121 (no hits) while the accent is the house green, and move with it album to album — which is why the derivation is checked against the 34% wash rather than against the panel alone: it is this rule that decides how bright an accent may be, since text and ground are both made of the same token here. The green's pair is 4.9:1 for the query and 9:1 for the faint counts against their ground; the derivation holds every hue it accepts at 4.5:1 on this wash, and the floor exists to stay above. Do not lower them for aesthetics; on this ground they are the floor of visibility. Mixed against --panel rather than transparent so the result does not depend on what happens to sit behind the bar. The no-hits pair follows the ink rather than the accent: an accent-coloured "you are searching" bar next to red "no matches" says work-in-progress at the exact moment the filter has come up empty. Order is load-bearing — the [data-none] pairs are equal-or-higher specificity and must stay below the plain rules. Command mode borrows none of it. A wash says "you are inside a search", which is a claim about the list, and `:` is a question to the player: the mode is told by its prompt and by the readout that answers the word being typed, and a green bar would say the library is being narrowed when it is the transport being addressed. */ .cmd-line { flex: none; display: flex; align-items: center; gap: 10px; height: 26px; padding: 0 10px; /* The hairline that separates the two bottom rows of the shell. The transport below already carries a --line-strong one of its own, so the pair reads as a stack — this is the line you type at, that is the one that plays. */ border-top: 1px solid var(--line); background: var(--panel); } .cmd-line[data-filtered="true"] { background: color-mix(in oklab, var(--accent) 20%, var(--panel)); } .cmd-line[data-typing="true"] { background: color-mix(in oklab, var(--accent) 34%, var(--panel)); } /* The washes are the dark theme's own arithmetic: 34% of a bright accent into near-black is a clean dark tint the bright ink still reads on, but 34% of the *dark* accent the light theme wears into white is a mud mid-tone nothing reads on. So the light theme tints the query bar far more lightly — a whisper of the record rather than a flooded bar — which is both what a light surface wants and the 18% the accent's contrast floor is derived against in lib/theme/accent.ts (LIGHT_GROUND.wash); the two numbers are the same fact. The `--accent` ink on this wash clears 4.5:1 by construction (see the light-ink sweep in accent.test.ts). */ :root[data-theme="light"] .cmd-line[data-filtered="true"] { background: color-mix(in oklab, var(--accent) 10%, var(--panel)); } :root[data-theme="light"] .cmd-line[data-typing="true"] { background: color-mix(in oklab, var(--accent) 18%, var(--panel)); } .cmd-line[data-filtered="true"][data-none="true"] { background: color-mix(in oklab, var(--danger) 20%, var(--panel)); } .cmd-line[data-typing="true"][data-none="true"] { background: color-mix(in oklab, var(--danger) 30%, var(--panel)); } /* Command mode is armed — you can see it from across the room — but it is armed on the player, not on the list, so it takes a brighter ground rather than the search's wash: green here means "the rows are being narrowed", and `:vol 40` narrows nothing. */ .cmd-line[data-mode="command"] { background: var(--panel-hover); } .lib-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); } /* The build's commit id, stamped at config time and pinned to the right end of the strip: right-anchored and `flex: none` so the news lines, which grow out of the left, can never push it off the bar or squash its eight characters. Fainter than the counts — it is a fact for when you go looking for it, not a readout. */ .lib-commit { margin-left: auto; flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); opacity: 0.6; } /* The share result. Tabular mono like the counts it sits beside, truncated rather than wrapped — a 30px bar that grows a second line would move the library under the reader's cursor. It cannot be focused, and it needs no close button: the next keypress clears it. */ /* The two outcome lines of the toolbar, in the gutter the counts live in: the share result and what `f` did. The latter exists because the row's own mark is CSS, and CSS has no accessibility tree to speak through — so the key says what it did in words as well, and a refusal says it in the server's. */ .lib-share, .lib-note { min-width: 0; /* Wide enough that the URL and the browser's reason for refusing to take it can be on the line at the same time: at 46ch the reason was ellipsised away in exactly the case it was printed for. */ max-width: 64ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 11px; color: var(--accent); } /* The link, selectable as one thing. When the clipboard refused the copy this line is the only copy there is, and a URL set inside a sentence has to be dragged across to be copied; `all` makes one click take the link and leave the prose about it behind. */ .lib-share-url { user-select: all; } .lib-share[data-bad="true"], .lib-note[data-bad="true"] { color: var(--danger); } /* The field inside the command line. It is chromeless — no border, no background, no focus ring — because it lives inside a bar that is already a surface, and a box around it would read as a form control rather than as the keyboard being live. The `:` is prompt chrome outside the value, so selecting, copying and Ctrl-A see only the command; the search half has no glyph at rest, because the caret and the list above already say the keyboard is yours and an idle `/` was a hint about a key rather than a mark of a state. */ .lib-query { display: flex; align-items: baseline; gap: 5px; flex: 1 1 0; min-width: 0; font-family: var(--font-mono); font-size: 11px; color: var(--accent); } .lib-query-prompt { color: var(--accent-dim); } .lib-query-input { flex: 1 1 0; min-width: 0; padding: 0; border: 0; background: none; /* inherits the mono/accent ink above; the caret is the one piece of chrome worth having, so it is the accent too */ color: inherit; font: inherit; caret-color: var(--accent); outline: none; } .lib-query-input::-webkit-search-decoration, .lib-query-input::-webkit-search-cancel-button, .lib-query-input::-webkit-search-results-button { -webkit-appearance: none; appearance: none; } /* Nothing to show and nobody typing: the line is furniture, so it sits with the rest of the gutter. The moment it holds text it is the loudest thing at the bottom of the screen — that is the whole point of arming it from the keyboard. */ .lib-query[data-empty="true"]:not([data-focused="true"]) { color: var(--text-faint); } .lib-query-input[data-none="true"] { color: var(--danger); caret-color: var(--danger); } /* The gutter at the end of the line: the count a search left, the word being typed read back as a sentence, or what the last command did. Muted until it has a reason to be otherwise — a refusal takes the danger ink, and nothing else here does. */ .lib-query-count { flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); } .lib-query-count[data-bad="true"] { color: var(--danger); } /* Both panes are stacked in one grid cell and kept laid out; only visibility flips (.lib-pane--inactive). display:none would cost the hidden view its measured viewport (and with it the windowed rows), and would make the list unscrollable while the grid is up — which is what a cover click has to do before showing it again. */ .lib-panes { flex: 1; min-height: 0; display: grid; /* The two panes deliberately share one cell — the grid is an *overlay* on the list, both mounted and laid out, swapped by visibility/inert. That is what lets a cover click scroll the list before it is shown. The row must be sized by this container, not by the panes: a virtualizer's sizer (height = rows × rowHeight, hundreds of thousands of px on a big library) is a scroller's max-content contribution, and an `auto` grid row would happily grow to it and hand the page a second, giant scrollbar. minmax(0, 1fr) pins the track to the container; overflow is the belt. */ grid-template-rows: minmax(0, 1fr); overflow: hidden; } .lib-pane { grid-area: 1 / 1; min-height: 0; display: flex; flex-direction: column; position: relative; /* anchor for the virtualizer's sticky overlay */ } .lib-pane--inactive { visibility: hidden; pointer-events: none; } /* The song list, seen through the gallery. * * The gallery never had a background to remove: the panes are transparent, and * what stood between a cover and its tracks was the rule above, which does not * paint the list at all while the grid is up. So the list is the one pane * allowed to stay painted — already windowed, already scrolled to where the * reader was, and the same rows the covers are made of, which is what makes the * two views read as one library instead of two screens. * * Only this direction. The grid does not stay painted under the list: 1,703 * sleeves painting behind a list nobody is looking through is paint for * nothing, and unlike these rows they are not already on their way to screen. * * `inert` (set in LibraryView, not here) is load-bearing rather than tidying: it * is what keeps the dimmed rows out of the a11y tree and off the click path now * that visibility is not doing it. The one thing it does not do is find-in-page, * which can now find them — the price of their being on screen at all. */ .lib-pane--behind { visibility: visible; opacity: var(--gallery-backdrop); } /* Its scrollbar belongs to the view that is being looked past. */ .lib-pane--behind .lib-scroll { scrollbar-width: none; } /* The gallery lifted off those rows: a sleeve has to read as the thing on top now that it is not sitting on flat black, and a caption 11px over somebody else's track row needs the ground behind it to stay put. */ .lib-pane:not(.lib-pane--inactive) .album-art { box-shadow: 0 1px 14px rgb(0 0 0 / 0.6); } .lib-pane:not(.lib-pane--inactive) .album-name, .lib-pane:not(.lib-pane--inactive) .album-artist { text-shadow: 0 1px 3px rgb(0 0 0 / 0.85); } /* -------------------------------- Album grid -------------------------------- */ .album-grid { flex: 1; min-height: 0; display: flex; flex-direction: column; } .album-scroll { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; /* The grid is centred, so a scrollbar that eats 10px of the right edge would sit the whole gallery a few px left of the middle of the pane. Reserving the gutter on both edges keeps the block centred whether or not the bar is drawn — and stops the covers sliding a gutter's width when a filter long-enough to bring the scrollbar arrives. Browsers without `scrollbar-gutter` centre against the scrolled box: a few px off, unseen. */ scrollbar-gutter: stable both-edges; } /* One windowed row of the gallery. * * A grid on a fixed lattice rather than a flex row: the columns the virtualizer * counted become the columns the browser lays out (`--album-cols`, set by * AlbumGrid), and `justify-content: center` centres those tracks as a block. * That is what makes this a gallery instead of a strip: the leftover from the * floored column count is split evenly at the sides, and a short trailing row * keeps its covers in the leading tracks — so every cover still stands under * the one above it. Centring each row on its own would float the ragged row * into the middle and break the columns, which is the one thing a grid of * squares must not do. * * The tracks are the cell metric the virtualizer already priced (CELL_W, and * CELL_GAP for the column gap), so the window's rows and this layout cannot * disagree about where a cover is. */ .album-cellrow { display: grid; grid-template-columns: repeat(var(--album-cols, 1), 160px); align-items: flex-start; column-gap: 10px; height: 208px; justify-content: center; } .album-cell { display: flex; flex-direction: column; gap: 5px; width: 160px; height: 208px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; } .album-art { position: relative; display: block; width: 160px; height: 160px; overflow: hidden; /* A visible resting surface: with a near-black tile on a black app the grid reads as empty until getCoverArt answers, which is what made the view look like it took a second to arrive. */ background: var(--panel-hover); border: 1px solid var(--line-strong); border-radius: var(--radius); } .album-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 120ms linear; } .album-art[data-loaded="true"] .album-img { opacity: 1; } /* Shown under the art until it lands, and for ever after if it never does. */ .album-art-ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: 34px; letter-spacing: 0.06em; color: var(--text-muted); } .album-name, .album-artist { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .album-name { font-size: 12px; color: var(--text); } .album-artist { font-size: 11px; color: var(--text-muted); } .album-year { color: var(--text-faint); } .album-cell:hover .album-art { border-color: var(--line-strong); } .album-cell:hover .album-name { color: var(--text-strong); } /* The ring lands on the art, not the button box, so it follows the tile. */ .album-cell:focus-visible { outline: none; } .album-cell:focus-visible .album-art { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-dim); } .vlist-sizer { position: relative; width: 100%; } .vlist-window { position: absolute; top: 0; left: 0; right: 0; will-change: transform; } /* Pinned section headers: an overlay *outside* the scroller (position:sticky cannot work for rows that live inside the translated window — it would confine them to ~a screenful). pointer-events:none so the duplicate never eats a click meant for the real row under it; the pinned artist/album rows bring their own opaque backgrounds, and the drop-shadow keeps the seam legible over busy content. */ .vlist-sticky { position: absolute; top: 0; left: 0; right: 0; z-index: 2; pointer-events: none; contain: layout style paint; box-shadow: 0 1px 0 var(--sheen); } .lib-row { /* No content-visibility here on purpose. docs/research/rendering-performance .md recommends it, but that advice is for blocks the DOM keeps whether or not they are seen; these rows are windowed, so the only rows it could skip are the ones in the scroll buffer — and skipping those is what made text pop in a frame behind the row background on a fast fling. Real virtualization already bounds the node count, which is the thing CV is for. */ display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; font-family: var(--font-mono); font-size: 13px; color: var(--text); white-space: nowrap; cursor: default; } .lib-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; } .lib-row--artist { background: var(--panel-hover); color: var(--text); font-weight: 600; letter-spacing: 0.04em; border-top: 1px solid var(--line); cursor: pointer; /* click to pick the artist up; Enter plays them */ } .lib-row--album { background: var(--panel); padding-left: 22px; border-top: 1px solid var(--sheen-faint); cursor: pointer; /* click to hold the section highlight */ } /* The revealed album's footprint — the album header and its tracks, so the cover click answers "where on the page am I" even after the scroll settles. Outline is inset box-shadow, not border: rows are a fixed 30px in the virtualizer's math, and a border would grow the box; shadow is paint-only and costs nothing on scroll. Caps sit on the first/last row of the section so it reads as one block rather than a stack of outlined rows. */ .lib-row--hl { background: color-mix(in srgb, var(--accent) 8%, var(--panel)); box-shadow: inset 1px 0 0 var(--accent-dim), inset -1px 0 0 var(--accent-dim); } /* The track the player is actually on. Not a selection — the list is not choosing it, the player is — so it borrows the row's own typography instead of adding chrome: a bar in the gutter where the track numbers live (so it cannot shift a glyph), a tint, and the title in the accent. Stronger than .lib-row--hl on purpose. That one means "you asked to look here" and goes stale the moment you scroll away; this one means "this is the music", and the two are different facts worth different inks. The marker is a background-image rather than a box-shadow because the section rules own box-shadow with higher specificity — a two-class .hl-top row that is also the playing row would otherwise lose its marker, which is precisely the row (first track of a revealed album) where someone most wants to know. */ .lib-row--playing { background-color: color-mix(in srgb, var(--accent) 10%, var(--panel)); background-image: linear-gradient(to right, var(--accent) 0 2px, transparent 2px); } .lib-row--playing .lib-title { color: var(--accent); } .lib-row--playing .lib-num { color: var(--accent-dim); } /* The keyboard cursor — where `j`/`k`/arrows have put the reader, and what `Enter` plays. It is a different fact from "this is the music", so it is a different channel: the playing row owns the background (a tint plus the left edge as a background-image) and the section rules own box-shadow at two-class specificity, so a cursor drawn with either of those would be lost on exactly the rows where both marks are wanted — the first track of a revealed album, say. Outline is free of both fights, costs no layout, and dashed says "picked" while the solid tint says "playing", which is the distinction that has to survive a glance. Brighter ink rather than accent ink: two rows in the accent side by side would ask the reader to guess which one is singing. */ .lib-row--cursor { outline: 1px dashed var(--accent-dim); outline-offset: -1px; } /* The cursor walks the section rows too — an album and an artist are things you can play — and those carry their name in `.lib-section-name`, not `.lib-title`. */ .lib-row--cursor .lib-title, .lib-row--cursor .lib-section-name { color: var(--text-strong); } .lib-row--hl.lib-row--hl-top { box-shadow: inset 1px 0 0 var(--accent-dim), inset -1px 0 0 var(--accent-dim), inset 0 1px 0 var(--accent-dim); } .lib-row--hl.lib-row--hl-bottom { box-shadow: inset 1px 0 0 var(--accent-dim), inset -1px 0 0 var(--accent-dim), inset 0 -1px 0 var(--accent-dim); } .lib-row--hl.lib-row--hl-top.lib-row--hl-bottom { box-shadow: inset 1px 0 0 var(--accent-dim), inset -1px 0 0 var(--accent-dim), inset 0 1px 0 var(--accent-dim), inset 0 -1px 0 var(--accent-dim); } .lib-section-name { font-weight: 600; } .lib-section-name--album { font-weight: 500; color: var(--text); } .lib-year { margin-left: 6px; color: var(--text-muted); font-weight: 400; } .lib-side { margin-left: auto; color: var(--text-muted); font-size: 11px; } .lib-row--track { position: relative; /* anchor for the cache wash and the buffering bar, below */ } /* What the cache wears: the row's own background painted the accent from the left as the track's bytes arrive, and fully worn while they sit in memory — one determinate bar at row scale, not a hairline and not a crawl. The accent at a low fraction is deliberate: this is cache news, not a second playing marker, and the row already spends the full accent on its title when it is the track being heard. Rendered as the row's first child so the text sits over it, and never interactive. */ .lib-cache-fill { position: absolute; inset: 0 auto 0 0; height: 100%; pointer-events: none; background: color-mix(in oklab, var(--accent) 10%, transparent); transition: width 200ms ease; } .lib-row--track:hover { background: var(--row-hover); } .lib-row--track .lib-title { color: var(--text); } .lib-row--track:hover .lib-title { color: var(--text-strong); } .lib-num { width: 20px; flex: none; text-align: right; color: var(--text-faint); } .lib-quality, .lib-dur { flex: none; color: var(--text-muted); font-size: 11px; } /* Leading time column: fixed to the widest cell (`00:00:00`), right-aligned + tabular figures, so every title starts on the same x and a hour-long track can't shove the row sideways. The row is mono, so 8ch is an exact fit. Green-tinted rather than plain ink so the eye can separate "how long" from "what is it called" without a rule or a column gap doing it (see --dur-ink). The measurement is still the brightest thing in the gutter; only the zero-padding recedes (see .lib-dur-pad). */ .lib-dur { width: 8ch; text-align: right; font-variant-numeric: tabular-nums; color: var(--dur-ink); } /* `00:` segments that the width forces us to render but that say nothing. !empty spans, so this rule also covers the album row's total. */ .lib-dur-pad { color: var(--text-faint); } .lib-quality { margin-left: auto; /* Air of the chips' own, so the favorite's heart is not pressed against the first of them: the two arrive at this column from opposite ends — the heart ends the name, the chips are their own column — and marks that nearly touch read as one label, which is the last thing a format chip wants. This app spends hues on formats and gave the heart rose precisely so it could never be mistaken for one of these. The row's `gap` cannot do this: it is one value for every boundary in the row, and spending it here would widen the space between the chips as well. */ padding-left: 8px; margin-right: 10px; display: flex; align-items: center; gap: 4px; } /* The favorite's heart, at the end of the row's name — after the title on a track, after the label (and its year) on a record or an artist — and drawn as `content` on that cell rather than as a node per row, because this list is virtualized and an element here is paid for again on every scroll: ~2ms of the row window's mount budget went to one before it became this rule (see `favMark`). Absolutely positioned inside a reserved gutter, and that is the whole trick. An inline `::after` is part of the text the cell truncates, so the heart would be ellipsised away on exactly the long-titled rows that need the room — the worst possible day for the mark to go missing, and the reason a leading mark was tempting. Parked in the padding instead it sits outside the ellipsis's reach, hugs the end of a short title where a reader expects it, and stands in the same air after a long one. The gutter is reserved on every row, worn or not, so a row gaining its first heart moves neither its own name nor the chips — which the title cell pushes aside with `margin-left: auto` anyway, so the only thing the extra padding can reach is the truncation point, 28px earlier. 28px of gutter around an 18px glyph, which puts ten clear pixels between a name and its heart, and the chip column keeps eight of its own — sixteen counting the row's cell gap. The two sides are not equal and the inequality is the mark's meaning: a heart sitting nearer the format chips than the title would be read as a fact about the file, which is the one thing it must never be mistaken for, while ten pixels is close enough to belong to the name and far enough that a long title's ellipsis cannot lean on it. Sized well above the row's own type on purpose: at 13px, in a mono row that already carries a dozen thin glyphs, a heart reads as decoration bolted to the title instead of the one thing about it worth a glance. Big enough that the rose carries, because this is the mark the whole feature exists to make visible and it has to survive a glance at the far end of a long list. Reserved on all three row kinds, though only two of them can wear the mark (`favMark` marks a track and a record's header, never an artist's): the gutter is a fact about where a name breaks, and the two header kinds truncating at different places would be ragged for a reason nobody can see. */ .lib-row--track .lib-title, .lib-row--album .lib-section-name, .lib-row--artist .lib-section-name { position: relative; padding-right: 28px; } .lib-row--track .lib-title::after, .lib-row--album .lib-section-name::after, .lib-row--artist .lib-section-name::after { content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 18px; font-size: 17px; line-height: 1; text-align: center; /* Centered on the cell rather than nudged by a baseline, which is what `middle` would have wanted and what an absolutely positioned box has no baseline to use. The glyph comes from a font fallback in any case — a mono row's font carries no U+2665 — so this is the one alignment that does not depend on whose heart it drew. */ color: var(--fav); } .lib-row--fav .lib-title::after, .lib-row--fav .lib-section-name::after { content: "\2665"; } /* The heart while its request is still on the wire — the optimistic write made visible, the same glyph in the pending ink until the server's answer arrives. */ .lib-row--fav-wait .lib-title::after, .lib-row--fav-wait .lib-section-name::after { color: var(--fav-pending); } /* Idle, the status line has nothing to say and takes no room: the toolbar's gap would otherwise open a hole in the middle of it for an empty span. It is not removed, only unrendered — see the comment on the element in components/LibraryView.tsx for why a live region has to stay in the document to be heard. */ .lib-note:empty { display: none; } /* Codec/format chips. Fixed 15px box so a row's height never depends on whether the metadata arrived; --radius is already 2px app-wide. */ .lib-badge { flex: none; padding: 0 4px; font-size: 10px; line-height: 15px; white-space: nowrap; color: var(--text-muted); background: var(--panel-hover); border: 1px solid var(--line-strong); border-radius: var(--radius); } /* Codec chips tint text / border / fill from a single --chip hue. The default is neutral, so a container we hold no hue for is uncolored rather than wrongly colored — teach it a format by adding a token above and a selector below. */ .lib-badge--codec { --chip: var(--chip-neutral); color: var(--chip); background: color-mix(in oklab, var(--chip) 10%, var(--panel)); border-color: color-mix(in oklab, var(--chip) 32%, var(--line)); } .lib-badge--codec[data-codec="flac"] { --chip: var(--chip-flac); } .lib-badge--codec[data-codec="alac"] { --chip: var(--chip-alac); } .lib-badge--codec[data-codec="wav"] { --chip: var(--chip-wav); } .lib-badge--codec[data-codec="aiff"] { --chip: var(--chip-aiff); } .lib-badge--codec[data-codec="mp3"] { --chip: var(--chip-mp3); } .lib-badge--codec[data-codec="aac"] { --chip: var(--chip-aac); } .lib-badge--codec[data-codec="m4a"] { --chip: var(--chip-m4a); } .lib-badge--codec[data-codec="opus"] { --chip: var(--chip-opus); } .lib-badge--codec[data-codec="ogg"] { --chip: var(--chip-ogg); } /* Hover lifts the chips off the row background without shifting their hue. */ .lib-row--track:hover .lib-badge { color: var(--text); background: var(--panel-hover); border-color: var(--line-strong); } .lib-row--track:hover .lib-badge--codec { color: var(--chip); background: color-mix(in oklab, var(--chip) 18%, var(--panel-hover)); border-color: color-mix(in oklab, var(--chip) 48%, var(--line)); } /* ------------------------------- Transport ------------------------------- The player bar is a flex sibling of the routed view, not a fixed overlay: the shell owns the viewport (body is a non-scrolling flex column), so a flex item here is pinned by construction — and unlike an overlay it cannot hide the last rows of a list that does not know the bar exists. */ .player-bar { flex: none; position: relative; /* anchor for the crawl line, which is this border */ display: flex; flex-direction: column; gap: 2px; /* Two rows: the readout, then the progress line under it. The height is content rather than a number — the art column (tile + caption) is the tallest thing on the top row and nothing in here grows — so the bar cannot clip what it lays out, which a fixed height once did at a wider font. */ padding: 4px 10px 6px; border-top: 1px solid var(--line-strong); background: var(--panel); font-family: var(--font-mono); font-size: 11px; } /* The top row: cover with its caption, the meta, the transport at the right. */ .pb-main { display: flex; align-items: center; gap: 10px; min-width: 0; } /* The progress line, and the two clocks that bracket it. Negative margins take it out of the bar's padding so the hairline runs the full width of the window — the whole point of moving it down here — while the clocks are inset again, because numbers against an edge have nowhere to go. */ .pb-progress { display: flex; align-items: center; gap: 8px; margin-inline: -10px; } /* Bottom-left corner, and the one thing in the bar with a real size: it is the anchor the eye finds when the text scrolls by. */ /* A button, so the tile that opens the zoom has a hover edge, an accessible name, and a pointer that says "this opens something". The reset (padding, font, appearance) is what lets a