mirror of
https://github.com/refact0r/midnight-discord.git
synced 2026-08-22 16:21:13 +02:00
3.1 KiB
3.1 KiB
midnight-discord
A CSS theme for Discord. The maintainer may be running it through desktop Vencord (npm run dev + DEV_OUTPUT_PATH) or testing in a browser tab (npm run serve). Most of the time you can just edit files; only spin up the browser injection flow when told.
Layout
src/*.css— theme source, split by area. Index:main.css— structural rules for app chrome (sidebar, members list, profiles, modals, settings, etc.). The big one aftercolors.css.colors.css— overrides of Discord's--*design-system variables, mapped to midnight palette. Most "wrong color" bugs are fixed here.chatbar.css— message input area.top-bar.css— title bar / window controls region above the app.animations.css— transition tokens.background-image.css,transparency-blur.css— toggleable visual effects.dms-button.css,user-panel.css,window-controls.css— small isolated components.
themes/midnight.theme.css— user-facing entry: variables +@importof the build.themes/flavors/— preset palette variants, each a standalone.theme.cssthat@imports the same build (catppuccin macchiato/mocha, nord, rosé pine/moon, tokyo night, lilypichu, plus background and vencord variants).build/midnight.css— generated fromsrc/*.cssby the build tooling and committed to git. Don't hand-edit. User.theme.cssfiles@importthe GitHub-Pages-hosted copy of this.scripts/theme.config.js— theme-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— watcher for desktop Vencord (npm run dev).scripts/serve.js+scripts/inject.js+scripts/theme-dev.user.js— browser dev flow. Seedocs/BROWSER_DEV.md.
Hard rules
- Edit
src/*.css, neverbuild/midnight.css. - When adding or removing a source file, update the ordered
sourceFileslist inscripts/theme.config.js; builds fail on an unlisted or missing CSS file. - User-facing CSS variables (colors, sizes, toggles) are defined in
themes/midnight.theme.css. The flavor files are standalone copies: keep their public variable interface in sync when adding or renaming variables, while preserving flavor-specific values. Structural rules live insrc/*.css. scripts/build.js,dev.js,serve.js,inject.js,theme-dev.user.js, anddocs/BROWSER_DEV.mdare intentionally identical to System24's copies. Keep theme-specific behavior inscripts/theme.config.jsand theme ownership guidance inAGENTS.md.- Don't reach for
!importantto fight specificity — tighten the selector first.
Experimental agentic development
If you're driving Discord through the chrome-devtools MCP to access Discord HTML/CSS or verify changes visually, see docs/BROWSER_DEV.md. It covers the inject flow, re-injection after navigation, debug helpers, the test server, and the rules for verifying message-rendering changes against real Discord rather than synthetic DOM fragments.