A TUI-style CSS theme for Discord built on top of midnight. It is not a standalone theme: src/main.css imports midnight's published build, then System24 adds its own defaults and overrides. The maintainer may be running it through desktop Vencord/BetterDiscord (npm run dev + DEV_OUTPUT_PATH), testing in a browser tab (npm run serve), or having an agent drive their Vesktop over CDP (scripts/cdp.mjs). Most of the time you can just edit files; only spin up a live flow (desktop or browser) when told.
src/*.css— System24 source, layered after midnight:main.css— midnight import, fonts, public defaults, palette, and the small set of general System24 overrides.ascii.css— ASCII channel titles and loading screens.colors.css— System24-specific status-color aliases. Most shared Discord color mapping lives upstream in midnight.panel-labels.css— optional labels around major panels.spotify-bar.css— optional text-style Vencord Spotify progress bar.unrounding.css— square corners, avatars, and status indicators.
theme/system24.theme.css— main user-facing theme file and public variables.theme/flavors/— standalone palette variants that import the same System24 build.build/system24.css— generated fromsrc/*.cssby the build tooling, committed to git, and imported by user theme files. Don't hand-edit.scripts/theme.config.js— System24-specific paths, import, name, and explicit source order used by the shared dev tooling.scripts/build.js— deterministic compiler (npm run build);dev.jsandserve.jsboth use it.scripts/dev.js— rebuildsbuild/system24.css, expands the build import into eachDEV_OUTPUT_PATH, and watchessrc/plustheme/system24.theme.css.scripts/serve.js+scripts/inject.js+scripts/theme-dev.user.js— browser dev flow (npm run serve).scripts/cdp.mjs+scripts/dom.js— desktop dev flow: drives the maintainer's running Vesktop over CDP.scripts/screenshot-flavors.js— captures flavor screenshots intoassets/flavors/(plus README thumbnails inassets/flavors/thumbs/) by cycling each flavor through the live Vesktop theme file (npm run screenshot, macOS only, requiresDEV_OUTPUT_PATH).scripts/check-classes.js— lists Discord classes insrc/*.cssthat no longer exist in the current client, with file, line, and same-name candidates (npm run check-classes; checks Discord Stable by default,-- --canaryfor Canary; data from a mirror of itmesarah/DiscordClasses, cached in.theme-dev/).docs/BROWSER_DEV.md— browser injection and verification flow.docs/DESKTOP_DEV.md— desktop (Vesktop over CDP) injection and verification flow.
- Put TUI-specific presentation here: ASCII treatments, panel labels, unrounding, System24 defaults, and deliberate overrides of midnight.
- Put shared Discord structure and design-system mappings in midnight: app chrome, chatbar, top bar, profiles, modals, shared colors, and other behavior System24 inherits unchanged.
- System24 development assumes the published midnight import is working. Fix and verify upstream problems in midnight first, then return here to test the System24 layer.
- Edit
src/*.css, neverbuild/system24.css. Runnpm run devto regenerate the committed build. - When adding or removing a source file, update the ordered
sourceFileslist inscripts/theme.config.js; builds fail on an unlisted or missing CSS file. - Public defaults are duplicated in
src/main.cssandtheme/system24.theme.css; keep them in sync. When adding or renaming public variables, also update every affected standalone flavor while preserving flavor-specific values. npm run devrequiresDEV_OUTPUT_PATHin.env(comma-separated paths are supported).npm run buildandnpm run servedo not.scripts/build.js,dev.js,serve.js,inject.js,check-classes.js,screenshot-flavors.js,theme-dev.user.js,cdp.mjs,dom.js,docs/BROWSER_DEV.md, anddocs/DESKTOP_DEV.mdare intentionally identical to midnight's copies. Keep theme-specific behavior inscripts/theme.config.jsand theme ownership guidance inAGENTS.md.- Don't add
!importantmerely to fight specificity—tighten the selector first. - After adding or changing Discord class selectors, run
npm run check-classes. It checks this repo'ssrc/only; midnight's selectors are checked in midnight.
- Virtualized lists (channel list, member list, DM list, friends list, messages) place rows at the heights Discord's JS assumes. Changing a row's height desyncs scrolling: rows render off screen or leave gaps. Restyle within the row's box; to make rows shorter or taller,
zoomthe scroller (its scrollTop, clientHeight and spacers all live inside the zoom, so the maths holds) and zoom each row's contents back. Check by scrolling: rows contiguous and filling the viewport at a few offsets. - Some sizes are set in JS and ignore CSS variables: server icons (40px) and folder buttons (48px), open folders' server lists (48px per server), member rows (42px, group headers 38px), DM rows (44px; 40 in compact density, 50 in cozy), friends rows (61px, section titles 50px). Shrink them visually (
zoom,transform: scale) instead of resizing them.
Two ways to read Discord's live HTML/CSS and check changes, each only when the maintainer says to use it:
- Desktop (
docs/DESKTOP_DEV.md): the maintainer's own Vesktop, driven over CDP withscripts/cdp.mjs. It's the real client, with plugin UI and the theme's fonts, but it is their Discord and they may be using it: by default apply, read what is on screen, and ask them to verify. It also covers launching Vesktop with the debug port and several agents sharing one Vesktop. - Browser (
docs/BROWSER_DEV.md): a Discord tab driven through the chrome-devtools MCP. It covers local injection, transient UI states, and verification against real Discord rather than synthetic DOM fragments.
The dependency ownership rules remain in this file. For any visual bug, follow the "Fixing a visual bug" steps in docs/BROWSER_DEV.md (they apply to both flows): compare against unthemed Discord, and check whether the cause is in midnight before editing here.