Skip to content

Commit 3ba58f7

Browse files
tributNGPixel
andauthored
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>
1 parent 85c304f commit 3ba58f7

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

client/themes/default/scss/app.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,17 @@
764764
.diagram {
765765
margin-top: 1rem;
766766
overflow: auto;
767-
svg:first-child {
768-
direction: ltr;
767+
768+
svg {
769+
color-scheme: light;
770+
771+
&:first-child {
772+
direction: ltr;
773+
}
774+
775+
@at-root .theme--dark & {
776+
color-scheme: dark !important;
777+
}
769778
}
770779
}
771780

0 commit comments

Comments
 (0)