docsify-darklight-theme icon indicating copy to clipboard operation
docsify-darklight-theme copied to clipboard

Different image for dark-mode

Open alexnix opened this issue 3 years ago • 1 comments

Is it possible to load different image in markdown based on dark/light mode ? (ie. one logo for light mode, another logo for dark mode) ?

alexnix avatar Mar 23 '21 08:03 alexnix

You must add a variable that then from style modifies the content of the desired img tag

Example:

 light: {
            logo: 'url("assets/logo_light.png")',
          },
<style>
      .sidebar .app-name-link img {
        content: var(--logo, url(assets/logo_dark.png)); 
      }
</style>

lpose avatar May 18 '21 21:05 lpose