Changing blockquote & other css formatting based on color theme #1838
-
Checklist
How did you create the site?Generated from Descriptionblockquote { p { @media (prefers-color-scheme: dark) {
} I have this css for blockquote. I was hoping that it would apply different formatting to dark and light, but that's not happening. Is there a way to apply different css based on current theme_mode? Operations you have already triedI tried generating two Anything else?No response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Adding the following code to html {
@media (prefers-color-scheme: light) {
&:not([data-mode]),
&[data-mode='light'] {
//your styles
}
&[data-mode='dark'] {
//your styles
}
}
@media (prefers-color-scheme: dark) {
&:not([data-mode]),
&[data-mode='dark'] {
//your styles
}
&[data-mode='light'] {
//your styles
}
}
} As an example, you can see the source code of jekyll-theme-chirpy. |
Beta Was this translation helpful? Give feedback.
Adding the following code to
assets/jekyll-theme-chirpy.scss
can solve your problem:As an example, you can see the source code of jekyll-theme-chirpy.