Closed getaaron closed 4 years ago
The navbar does not change color automatically on its own (same as basic Bootstrap), I added a .navbar-themed
to the toggle-*
version of the stylesheet that does what you expect it to do. That said, we need some updates to have that to work on "non-toggleable" bootstraps.
So you/we have a few options:
body
and tell your Navbar
component to use the navbar-themed
CSS class.prefers-color-scheme
instead of body classes, or support both (less opinionated and broader browser support).prefers-color-scheme
and have people choose (less opinionated and broader browser support)navbar-themed
example (assume loadToggleCss = true
and navBarCssClass = 'navbar-themed'
): _Layout.cshtml:33, _Layout.cshtml:21
The navbar does not change color automatically on its own
The navbar background color appears to be changing automatically, it’s just the text that isn’t (see screenshots)
Otherwise I like your third bullet point the best. I don’t have a clear idea of what the implementation would look like, but I’m happy to do a code review or some live pairing if you want to collaborate on it 👍
The navbar does not change color automatically on its own
The navbar background color appears to be changing automatically, it’s just the text that isn’t (see screenshots)
That's most likely only the default colors that are changing.
Otherwise I like your third bullet point the best. I don’t have a clear idea of what the implementation would look like, but I’m happy to do a code review or some live pairing if you want to collaborate on it 👍
I like that one too. I think it could be as easy as doing the same as toggle-bootstrap-dark.scss but change .bootstrap-dark
by a prefers-color-scheme: dark
media query. It would be great to combine both, so one stylesheet, two ways of doing things, and only one scss
file to maintain instead of two! Worst case scenario, we could create a new .scss
that get compiled into CSS (I'm a bit out of name idea tho).
If you want to contribute it, go ahead, that would be great! That said, I would not mind pair-programming it or part of it either; from the beginning or after your first draft, or whatever.
I started to work on prefers-color-scheme
using #39 to track the progress
Hi,
I'm trying to get bootstrap-dark working with the
prefers-color-scheme
media selector. Happy to PR any fixes we find or docs updates.I set up on a test project:
create-react-app
to create an appbootstrap-dark
projectpublic/css/bootstrap-dark.min.css
to../../node_modules/@forevolve/bootstrap-dark/dist/css/bootstrap-dark.min.css
add this to
public/index.html
:App.js looks like:
And then I have some stuff in a Jumbotron which looks fine:
Light Mode Screenshot
Dark Mode Screenshot
Question
Why doesn't the text on the nav bar look nice in dark mode?