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
Allow manual switch of dark/light mode #39
Comments
There are ways you can do it, like using replaceColor, but I’m considering adding a one-liner config option to help with this. |
This option could be implemented like this: colorTheme: {
defaultTheme: 'Solarized Light',
darkTheme: 'Monokai Dimmed',
lightTheme: 'Quiet Light',
detectionMethod: 'prefers-color-scheme' | 'classname/manual',
classNames: {
dark: 'gatsby-remark-vscode-dark',
light: 'gatsby-remark-vscode-light',
}
} So one could manually add |
More or less, except
|
I'm also looking into this - i'm not sure if we would have to generate styles for both the media query and an additional selector. Most manual toggles that i've seen read their initial value from the media query, but then store it somewhere else, so i'd prefer to have an option to generate something like this: .dark-mode .pd--ayu-mirage {
background-color: #1f2430;
color: #cbccc6;
}
.dark-mode .pd--ayu-mirage .mtk1 {
color: #CBCCC6;
} instead of this: @media (prefers-color-scheme: dark) {
.pd--ayu-mirage {
background-color: #1f2430;
color: #cbccc6;
}
.pd--ayu-mirage .mtk1 {
color: #CBCCC6;
}
} |
First I would like to say this is a great idea! :)
Now to the matter at hand,
prefers-color-scheme: dark
is all the hot fuss, but I would like to allow my users to override that if they want, so I have a switch to select the themes.Is there an easy way to switch themes like that? Be it a
css
variable or aclassName
?The text was updated successfully, but these errors were encountered: