Coconut Design System v3.11.0
home Home

Dark Mode

First-class dark theme via CSS tokens. Toggle instantly, see side-by-side comparisons, learn the mapping.

Preview

Dark mode card preview
CARD
Content
Online Error
Surfaces
--bg #f3f4f6
--white #ffffff
sidebar #ffffff
Surfaces
--bg #020617
--white #1e293b
sidebar #0a1120

Token Mapping

TokenLightDarkNotes
--bg#f3f4f6#020617Page background
--white#ffffff#1e293bCards, surfaces
--gray-900#1b1b1f#ffffffPrimary text (inverted)
--gray-500#616568#94a3b8Muted text
--border--gray-200#3b4f6aAll borders
--accent#744F28#C4956APrimary action color
--accent-container#F0E6DA#1e40afActive sidebar bg
--green#006d3b#6ee7b7Success states
--red#ba1a1a#fca5a5Error states
--shadow0.06/0.1 opacity0.5 opacityDeeper in dark

Flash Prevention (FOUC)

warning To prevent white flash on dark mode, apply overrides on html.dark before body loads.
<!-- In <head> before stylesheets --> <script> if (localStorage.getItem("ds-theme") === "dark" || (!localStorage.getItem("ds-theme") && matchMedia("(prefers-color-scheme:dark)").matches)) { document.body.classList.add("dark"); } </script>