Skip to content
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

No support for dark mode #647

Closed
tedw opened this issue Nov 24, 2020 · 1 comment
Closed

No support for dark mode #647

tedw opened this issue Nov 24, 2020 · 1 comment
Labels
Bug 🪲 Something isn't working

Comments

@tedw
Copy link

tedw commented Nov 24, 2020

Description

The design system doesn’t appear to support the prefers-color-scheme: dark CSS media feature. Not sure if this is on the roadmap but would be a nice feature, though I know it’s not a trivial update.

Here’s a simple example showing the basic idea:

html {
  --bg-color: get-theme('background-color');
  --text-color: get-theme('body-text-color');
  background-color: var(--bg-color);
  color: var(--text-color);
  
}

@media screen and (prefers-color-scheme: dark) {
  html {
    --bg-color: get-theme('background-color-inverse');
    --text-color: get-theme('body-text-color-inverse');
  }
}

I suppose one approach would be to create alternate $theme-colors-mozilla and $theme-colors-firefox maps for dark mode, then create CSS vars for them like in the example above and have the get-theme() function reference the CSS vars instead of hex codes. I think that would avoid having to refactor everything but it would limit browser support.

Steps to reproduce

Enable dark mode.

Expected result

Theme colors should update to dark background with light text.

Actual result

Nothing happens.

Environment

All

@tedw tedw added the Bug 🪲 Something isn't working label Nov 24, 2020
@stephaniehobson
Copy link
Contributor

We would like to do this and #841 makes this easier but realistically this is not on the roadmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants