Foundations
Theming
RunningFailed
- The choices are system (the default, listed first), light and dark. The choice is stored per device and applies as soon as it is picked.
- System is pure CSS.
tokens.cssfollowsprefers-color-schemewith no JavaScript, and changes live when the OS setting changes.data-theme="light"ordata-theme="dark"on<html>forces a theme. - To avoid a flash of the wrong theme when the user has forced one, add
the inline snippet from
adapters/theme.jsto<head>. - Marketing pages are light for everyone. They are designed white edge
to edge, so they set
data-theme="light"in their own markup. - Give every coloured element its dark value at the same time as its light one.