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

DARK MODE! #451

Merged
merged 8 commits into from
Apr 4, 2020
Merged

DARK MODE! #451

merged 8 commits into from
Apr 4, 2020

Conversation

NickCraver
Copy link
Member

@NickCraver NickCraver commented Jan 20, 2020

Made to address #450...and because it's fun! Since MiniProfiler no longer supports IE 11, we can take advantage of CSS variables and help some users here.

Note: this isn't only dark mode. It's really 2 things:

  • Convert all colors (and the rounded borders) to CSS variables
  • Introduce a dark mode via selectors that override those variables

Overall, this also allows a user to theme these variables however they want - it's not limited to the 2 included themes, that's just what's "in-box". I need to consult some experts but I'd love to also add a "High Contrast" theme to help another set of users...we just need color codes for it.

Here are some screens of dark mode (light is equivalent to today):
image
image
image
image

Full pages respect this theme setting as well:
image
image

Needs a lot more color overrides, sanity checking, actual code to set it, etc. but hey - it's a start! Made to address #450...and because it's fun.
@NickCraver NickCraver mentioned this pull request Jan 20, 2020
Nick Craver added 2 commits January 20, 2020 10:08
This hooks up the color scheme to options, adds it to docs, etc.

There's a "light" (previous and still default), "dark" (yeah...it's dark, what do you want me to say?) and "auto", which picks "dark" based on the browser's preference.
There was a test checking for the start of the .css which I changed...fun!
Nick Craver added 3 commits January 20, 2020 13:25
This does it all in JS to keep us consistent (thought about the rendering code doing it but....nah). This makes the full page variants respect dark mode and fills in a few missing colors.
@NickCraver NickCraver marked this pull request as ready for review January 22, 2020 01:33
Nick Craver added 2 commits April 2, 2020 20:45
Also surfaces ColorScheme up through the layers and to the tag helper.
@NickCraver NickCraver merged commit f7f7b96 into master Apr 4, 2020
@NickCraver NickCraver linked an issue Apr 4, 2020 that may be closed by this pull request
NickCraver pushed a commit that referenced this pull request Apr 4, 2020
Fix for #393, allows passing a nonce through the new `RenderOptions` API added in #451.
NickCraver added a commit that referenced this pull request Apr 4, 2020
Fix for #393, allows passing a nonce through the new `RenderOptions` API added in #451.

Also a minor optimization for async...we don't need that attribute value for any browser that'll support us today.
@NickCraver NickCraver deleted the craver/dark-mode branch April 19, 2020 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dark Mode
1 participant