francoischalifour / medium-zoom

🔎🖼 A JavaScript library for zooming images like Medium
https://medium-zoom.francoischalifour.com
MIT License
3.64k stars 165 forks source link

Configure whether a class name can be added? #168

Closed ghost closed 3 years ago

ghost commented 3 years ago

The problem

I want to add a class name to switch the background color, because the background color should also be able to switch between day and night modes

Implementation

Options Add claasName optional attributes

ayushnix commented 3 years ago

An option to automatically switch between dark and light background colors according to prefers-color-scheme would be great.

plivox commented 7 months ago

A trick I use with my Docusaurus documentation:

:root {
  --plugin-image-zoom-background-color: #fff;
}

[data-theme='dark'] {
  --plugin-image-zoom-background-color: #1e2125;
}
imageZoom: {
  options: {
    background: "var(--plugin-image-zoom-background-color)",
  },
},