fix: apply theme style to embedded diagram svg (#7903)

* fix: Apply theme style to embedded diagram (#7903)

When diagrams are created with "adaptive colors" they automatically
change to light-/darkmode depending on the browser preference. This
leads to rendering problems when the settings in the browser differ
from the wiki.js theme setting.

Fixes #7677

* fix: Update color scheme for SVG in diagram class

Refactor SVG color scheme handling in diagram class.

* fix: remove duplicate svg first-child class

Removed unnecessary direction property from first SVG in diagram.

---------

Co-authored-by: Nicolas Giard <github@ngpixel.com>
pull/7905/head
Felix Eckhofer 3 months ago committed by GitHub
parent 85c304f583
commit 3ba58f754d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -764,8 +764,17 @@
.diagram {
margin-top: 1rem;
overflow: auto;
svg:first-child {
direction: ltr;
svg {
color-scheme: light;
&:first-child {
direction: ltr;
}
@at-root .theme--dark & {
color-scheme: dark !important;
}
}
}

Loading…
Cancel
Save