Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upfeat(www): Implement dark mode user system preference: `prefers-color-scheme: dark` #18348
Conversation
This comment has been minimized.
This comment has been minimized.
Jest fails with |
This comment has been minimized.
This comment has been minimized.
Sorry for not responding on Twitter yesterday (and still ;-)), got pretty late over here fixing some other dark mode related bugs. |
This comment has been minimized.
This comment has been minimized.
@gillkyle can you halp? 🥰 |
This comment has been minimized.
This comment has been minimized.
I've got this on my list to review (maybe tomorrow?)! Sorry for the wait! |
This comment has been minimized.
This comment has been minimized.
Hey Thomas, hey Kyle! I just realized @thomaswangio I only checked this briefly, wasn't even aware of this — until @johno's Tweet kinda rubbed my nose in it ;-) Would you be willing to adjust your PR, and add |
This comment has been minimized.
This comment has been minimized.
Hey @fk and @gillkyle, I tried adding the flag const config = {
// this enables the color modes feature
// and is used as the name for the top-level colors object
initialColorMode: `light`,
// `prefers-color-scheme: dark` media query
useColorSchemeMediaQuery: true,
// borders: borders,
breakpoints: breakpointsTokens,
colors: col,
fonts: fontsTokens,
fontSizes: fontSizesTokens,
fontWeights: fweights,
letterSpacings: ls,
lineHeights: lineHeightsTokens,
mediaQueries: mq,
radii: r,
shadows: sh,
sizes: si,
space: spaceTokens,
transition: t,
zIndices: z,
buttons: {
large: {
fontSize: 4,
px: 4,
height: `52px`,
},
small: {
fontSize: 2,
py: 2,
px: 3,
},
},
} This doesn't work, however. Even removing |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Ah thanks @gillkyle! I also noticed we're using the flag |
This comment has been minimized.
This comment has been minimized.
Okay! Looks like it works for me (the documented In regards to the naming, it looks like I say update the name of |
This comment has been minimized.
This comment has been minimized.
@gillkyle done! thanks so much for testing that, I think the issue on my end was not clearing local storage. Should be good to go now |
Looks good to me, thanks @thomaswangio |
This comment has been minimized.
This comment has been minimized.
Should probably wait for @fk to give a stamp of approval as well too, since he has done so much work on this |
This comment has been minimized.
This comment has been minimized.
On Fri, Oct 11, 2019 at 3:36 AM Kyle Gill ***@***.***> wrote:
Should probably wait for @fk <https://github.com/fk> to give a stamp of
approval as well too, since he has done so much work on this
|
thomaswang commentedOct 8, 2019
•
edited
Description
Add
prefers-color-scheme: dark
to/www/src/components/with-color-mode.js
to support user system preference.Good for the new OS's that have a user setting for dark mode. Instagram doesn't even have a toggle right now so we're a step ahead!
Related PR
Related to @fk awesome PR #18027