Skip to content

Can we use two different images for light and dark theme in sidebar? #1768

Closed Answered by sy-records
SumithChandran asked this question in Q&A
Discussion options

You must be logged in to vote

Sidebar images? Are you referring to the logo?

Dark mode will show a pink logo.

Add it to index.html:

<style>
    @media (prefers-color-scheme: light) {
        .app-name-link img {
            content: url('https://raw.githubusercontent.com/docsifyjs/docsify/develop/docs/_media/icon.svg');
        }
    }

    @media (prefers-color-scheme: dark) {
        .app-name-link img {
            content: url('https://user-images.githubusercontent.com/7565692/35311593-3edd9102-00f2-11e8-98fb-38be1d0e650f.png');
        }
    }
</style>

Usually only the prefers-color-scheme: dark related style needs to be set separately.

docsify-darklight-theme

If you are using docsify-darklight-theme, it needs…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
8 replies
@sy-records
Comment options

@SumithChandran
Comment options

@sy-records
Comment options

@SumithChandran
Comment options

@SumithChandran
Comment options

Answer selected by sy-records
Comment options

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