CIMSTA / obsidiosaurus

Obsidian -> Docusaurus Converter
https://cimsta.github.io/obsidiosaurus-docs/
MIT License
143 stars 12 forks source link

Excalidraw images duplicated: light and dark versions are both present #19

Closed travisaustin closed 4 months ago

travisaustin commented 5 months ago

When I embed an Excalidraw image to my documentation, both the dark and light versions of that image are imported to my Docusaurus website.

Here's a sample showing a page with a single embedded in Obsidian. When published to Docusaurus, two versions are included in the page at the same time.

Obsidian screen:

CleanShot 2024-06-18 at 10 26 28

Docusaurus website in light mode:

CleanShot 2024-06-18 at 10 25 17

Docusaurus website in dark mode:

CleanShot 2024-06-18 at 10 25 21

Firefox developer tools shows the image is in the DOM twice:

CleanShot 2024-06-18 at 10 29 25

Has anyone else seen this?

Mat4m0 commented 4 months ago

You need to add to your CSS:

[data-theme='light'] img[src$='#dark'],
[data-theme='dark'] img[src$='#light'] {
  display: none;
}

In the Docusaurus Docs

travisaustin commented 4 months ago

Thank you!