Skip to content

Changing blockquote & other css formatting based on color theme #1838

Answered by huanyushi
groundedtako asked this question in Q&A
Discussion options

You must be logged in to vote

Adding the following code to assets/jekyll-theme-chirpy.scss can solve your problem:

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by groundedtako
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants