doc/development/fe_guide/dark_mode.md
This page is about developing dark mode for GitLab. For more information on how to enable dark mode, see how to change the UI appearance.
app/assets/stylesheets/color_modes/_dark.scss imports dark mode design tokens SCSS variables for colors.app/assets/stylesheets/framework/variables_overrides.scss are given dark mode values in _dark.scss._dark.scss is loaded before application.scss to generate separate application_dark.css stylesheet for dark mode users only.Design tokens for dark mode can be applied with Tailwind classes (gl-text-subtle) or with @apply rule (@apply gl-text-subtle).
Design tokens generate both CSS custom properties and SCSS variables which are imported into the dark mode stylesheet.
app/assets/stylesheets/page_bundles directory.Create bespoke CSS custom properties when design tokens cannot be used with either Tailwind utilities or existing CSS custom properties. See guidance for manually adding CSS custom properties in projects.
To support dark mode, CSS custom properties should be used in page_bundle styles as we do not generate separate
*_dark.css variants of each page_bundle file.