Theming
Every colour has a light and a dark value, held in CSS variables.
Light and dark
Set data-theme on html. Without it, the tokens follow the operating system.
<html data-theme="dark">Your accent colour
Override the accent tokens. Check that --accent-ink has 4.5:1 contrast on --surface.
:root {
--accent: #7A4DFF;
--accent-ink: #6236E0;
--accent-tint: rgba(122, 77, 255, 0.12);
}Tailwind CSS
// tailwind.config.js
export default {
darkMode: ['selector', '[data-theme="dark"]'],
theme: {
extend: {
colors: {
bg: 'var(--bg)', surface: 'var(--surface)', label: 'var(--label)', 'label-2': 'var(--label-2)',
separator: 'var(--separator)', accent: 'var(--accent)', 'accent-ink': 'var(--accent-ink)',
success: 'var(--success)', warning: 'var(--warning)', danger: 'var(--danger)',
},
borderRadius: { xs: '6px', sm: '10px', md: '14px', lg: '22px', xl: '30px' },
boxShadow: { card: 'var(--shadow-card)', float: 'var(--shadow-float)', modal: 'var(--shadow-modal)' },
},
},
};