info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
This page is about developing dark mode for GitLab. We also have documentation on how
[to enable dark mode](../../user/profile/preferences.md#dark-mode).
# How dark mode works
Short version: Reverse the color palette and override a few Bootstrap variables.
Note the following:
- The dark mode palette is defined in `app/assets/stylesheets/themes/_dark.scss`.
This is loaded _before_ application.scss to generate `application_dark.css`
- We define two types of variables in `_dark.scss`:
In most cases, we can use the same values for light and dark mode. If that is not possible, you
can add an override using the `.gl-dark` class that dark mode adds to `body`:
```scss
color: $gray-700;
.gl-dark & {
color: var(--gray-500);
}
```
NOTE:
Avoid using a different value for the SCSS fallback
```scss
// avoid where possible
// --gray-500 (#999) in dark mode
// $gray-700 (#525252) in light mode
color: var(--gray-500, $gray-700);
```
We [plan to add](https://gitlab.com/gitlab-org/gitlab/-/issues/301147) the CSS variables to light mode. When that happens, different values for the SCSS fallback will no longer work.
## When to use SCSS variables
There are a few things we do in SCSS that we cannot (easily) do with CSS, such as the following