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

[Feature] Dark mode #49

Merged
merged 9 commits into from
Apr 25, 2020
Merged

[Feature] Dark mode #49

merged 9 commits into from
Apr 25, 2020

Conversation

seshrs
Copy link
Member

@seshrs seshrs commented Apr 19, 2020

Now that we live in the era of dark mode and auto-switching themes, I think many users may appreciate if Primer Spec switched between a light and dark theme automatically based on the system settings.

After speaking with @bellakiminsun, we decided that we liked Slack's approach to dark-mode the best — each Slack theme has a light variant and a dark variant, and Slack lets users customize whether the variants/modes switch with the system settings.

This PR adds a first-pass implementation of auto-dark mode inspired by Slack:

  • Four subthemes: default, bella, modern and xcode-civic
  • Three modes: light, dark, system (default)
  • With the system mode, the theme changes between light and dark modes based on the system settings.
  • These are configurable via dropdowns in the "Settings" modal. (The Settings modal may be redesigned in a future PR.)
  • Other design updates:
    • Revert "active sidebar highlight" to a banner-style instead of a rounded-rectangle.
    • Float the sidebar toggle hamburger icon to the right of the sidebar

Validation:

Visit the preview URL for this PR, and play around with different combinations of the subthemes and modes. Also play around with your system settings for light/dark mode and verify their interaction with the Primer Spec site's subtheme.

This commit applies the theme variant (light/dark/system) as specified in the settings modal. If the 'system' setting is used, we use window matchMedia queries to check the system theme mode.
Also remove 'midnight' theme since it was used to create the default dark theme
@seshrs seshrs added the semver/minor Pull Request proposes "minor" change label Apr 19, 2020
@seshrs seshrs added this to the SP/SU 2020 milestone Apr 19, 2020
- `default` dark's active sidebar color is the same bright yellow as default light
- All white border lines are made dark grey in the dark themes
- Active sidebar item looks more like a banner than a box
- `xcode-civic` link color is now orange
If a user's local storage is corrupted or specifies a deprecated subtheme name, ignore the value from local storage and use the 'default' theme.
@seshrs seshrs merged commit 171c28d into develop Apr 25, 2020
@seshrs seshrs deleted the subthemes/dark-mode branch April 25, 2020 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/minor Pull Request proposes "minor" change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant