-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dark mode support #35857
Add dark mode support #35857
Conversation
2dbd701
to
8785109
Compare
@mdo consider also adding root CSS vars for
and convert all SASS calculations to calc(). This change will probably lead to other changes in a bunch of files, but would be definitely a good addition in one of future updates. |
75e2cac
to
4d1d58c
Compare
8785109
to
c905212
Compare
2ab5a4f
to
2ce19a3
Compare
2ce19a3
to
825d67d
Compare
825d67d
to
22cd75e
Compare
85be61d
to
a3c6ffd
Compare
…s, mention new variables-dark in sass docs
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It becomes very difficult to review it globally with all the comments and various topics mentioned by everyone so IMHO we got a first version that can be merged already.
@mdo tracked a part of all the discussions that happened in this PR in #37549. I'll complete it with my remaining feedback and double check we haven't forgotten any other feedback done by everyone. Thanks all for that 🙏
If we merge this PR, we could continue to tackle the different topics separately in dedicated PRs. And it'll allow us to manipulate on a daily-basis the light and dark mode while reviewing other PRs.
At some point, let's release an alpha version just to have first feedbacks regarding the color modes but also how the documentation allow the users to install this new color mode and also to evaluate the impact as a 5.3.0 (if there are no ultra breaking changes that should rather end up in a v6 rather than a v5.3.0).
😮 We merged it! I ended up removing the fix for the text underline CSS variable on links, but that could maybe come back. It was a little rougher to tackle than I expected, so waiting on a new fix there. |
Excellent! Thank you so much @mdo! Which release do you expect this to be in? Will it be in 5.3.0 or something earlier? |
It'll come in a v5.3.0-alpha1 release, 🔜 |
thank you @mdo you're a rock star |
@mdo any idea when we can install this via something like |
Something is not right with the merge or modified code has been uploaded. In the _root.scss at line 135, it is trying to use some variables that not defined as in the |
@burdittw |
release v5.3.0-alpha1 |
You can always install it using npm as a git repo (and hash) |
Why not publish? |
The next release will ship when it's ready :). |
Heavily WIP still, but this begins the process of implementing dark mode for our docs and across the project itself. Here's a quick look at what's coming. Builds on #35736.
Live Preview
Toggling
Color modes are toggled in the docs navbar with a custom toggler, which stores the select color mode in local storage. Color modes are set via data attribute via
data-theme
(with light or dark options available currently). This allows us to theme the entire page, or specific components, like so.New Sass and CSS variables
In order to best implement color modes, I've spiked out a number of new Sass and CSS variables (e.g.,
--bs-secondary-bg
and--bs-tertiary-bg
). In addition, I've added new global CSS variables like--bs-border-color
and more. So, in addition to general color modes and theming support, we get greater real-time customization, too.This allows us to have more nuance coloring, and a more system-wide color scheme, than we currently support. Some inspiration of the new CSS variables comes from macOS and other design systems where there are global constants (e.g., using the same
border-color
or blue being the color for links, primary actions, etc).Todos and open questions:
$dropdown-*
Sass variable changes in the diff).