Skip to content

First steps towards a dark theme - #4849

Merged
niik merged 64 commits into
masterfrom
oh-darth-where-art-thou
Jun 13, 2018
Merged

niik merged 64 commits into
masterfrom
oh-darth-where-art-thou

Conversation

@niik

@niik niik commented Jun 1, 2018 •

Copy link
Copy Markdown
Member

This PR adds the first piece of what will become a dark theme for GitHub Desktop. #4780 and #4810 preceded this PR in order to get us to a point where we could start working on a dark theme. The final colors and contrasts have not been locked in yet, think of this as a preview of roughly what we're thinking.

screen shot 2018-06-01 at 15 30 30
screen shot 2018-06-01 at 15 29 56

Enabling the dark theme

This PR only adds the style sheet itself and doesn't contain any method to select the dark theme in the UI. For testing purposes the theme can be enabled by setting the theme localStorage variable to dark and reloading the app.

We'll work on a proper UI for selecting a theme as well as being able to switch themes without reloading the app in a follow-up PR.

// To enable the dark theme, open DevTools and execute
localStorage.setItem('theme', 'dark');
// To revert to default theme
localStorage.removeItem('theme')

Illustration woes

We've had some excellent help from @OiYouYeahYou (#3135, #3773) and @NickCraver (#1515 (comment)) towards making our illustrations dynamically styleable ❤️

Unfortunately that work hasn't made it into this PR. There are unfortunate edge cases with both approaches that we haven't had time to address. In the monochrome svgs colorized with css filters approach the feColorMatrix approach didn't want cooperate and always rendered the colors slightly off, I imagine this is due to use of different color spaces or perhaps simply incompetence on my part but I couldn't afford to spend more time looking into it. The second approach of inlining the SVGs into the markup doesn't suffer from that problem but unfortunately makes it a bit trickier for us to scale the illustrations correctly.

I'm hoping we can get back to investigating these approaches and finding a way to accurately colorize our illustrations but for now I've had to settle for the quick-n-dirty approach of regular CSS filters.

TODO

These are the general TODOs that I've got on my list. I imagine we'll land this PR without solving most of them and instead address them in subsequent PRs but that's TBD.

niik added 30 commits May 23, 2018 14:26
These variables should be a good start but they're all still just copies of the light theme
The tertiary color had way to little contrast anyway
We need to lift this so that the `color: inherit` from CodeMirror's styles doesn't apply
We should probably split this out into a dedicated text box color
Withouth this the selected border and gutter color won't get applied
...  so we can introduce another one for the count bubble in the PR tab

/** Dialog */
--dialog-warning-color: $yellow-600;
--dialog-warning-text-color: $yellow-800;

This comment was marked as spam.

@niik niik added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jun 12, 2018
@niik

niik commented Jun 12, 2018

Copy link
Copy Markdown
Member Author

This is ready for review. Note that I don't expect the reviewer to manually validate all of these color choices that I've made. We'll address those in an ongoing fashion. The review here should focus on whether enabling the dark theme manually and reloading works and whether the app in dark mode looks decent without anything major standing out.

There's a few tasks in the PR body that's not done yet and that's also fine. I'll tackle those in follow-up PRs.

@nerdneha nerdneha self-assigned this Jun 12, 2018

@nerdneha nerdneha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks fine. but found this weird edge case for the background of the merge tool in the advanced preferences. will include image in a followup comment. i'm open to us fixing it in a future PR.

otherwise code looks fine

tested:

  • toggling theme on/off
  • panes/dropdowns: repositories, branches, PRs, changes, history, compare to branch
  • resizing
  • popups: discard changes, merge branch, preferences
  • actions: coauthoring, undo,

@nerdneha

Copy link
Copy Markdown
Contributor

here's the weird background:
screen shot 2018-06-12 at 9 45 28 am

@niik

niik commented Jun 12, 2018

Copy link
Copy Markdown
Member Author

here's the weird background:

Yeah, that's the salmon pink brutalism color, courtesy of @joshaber in this particular instance. It's a class that's defined in our globals.scss

screen shot 2018-06-12 at 18 53 41

It's only used as a means to ensure that @github/design never let's a feature through that hasn't been fully designed yet 😛 It's so ugly that we can't miss it. Additionally, and more importantly, it's only ever used for things hidden under a feature flag such as __DEV__

It serves its purpose as well in the dark theme as it does in the light theme.

@iAmWillShepherd iAmWillShepherd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@donokuda donokuda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good here. Thanks for taking this on 🙏✨

@niik

niik commented Jun 13, 2018

Copy link
Copy Markdown
Member Author

Thumb up all around! Gonna get this merged so we can get #4919 reviewed and merged

@niik
niik merged commit 48060ab into master Jun 13, 2018
@niik
niik deleted the oh-darth-where-art-thou branch June 13, 2018 14:32
@nehayward

Copy link
Copy Markdown

Is there anyway to automate this from the CLI? I'm looking to do some further testing with it?

@shiftkey

Copy link
Copy Markdown
Member

@nehayward not currently

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 24, 2018
@desktop desktop unlocked this conversation Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants