From 163271e84132c31fd8bd1c54e3715b6ed9871326 Mon Sep 17 00:00:00 2001 From: antoKeinanen Date: Sun, 14 Apr 2024 14:19:45 +0300 Subject: [PATCH] feat(#218): add option to disable image desaturation --- src/scss/info/style-settings.scss | 14 +++++++++++++- src/scss/obsidian/images.scss | 10 ++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/scss/info/style-settings.scss b/src/scss/info/style-settings.scss index f9088ef..6219195 100644 --- a/src/scss/info/style-settings.scss +++ b/src/scss/info/style-settings.scss @@ -3,6 +3,7 @@ name: Sanctum id: sanctum +collapsed: false settings: - id: light-mode-contrast-mode @@ -1473,12 +1474,23 @@ settings: id: wrap-kanban-lanes title: Wrap kanban lanes type: class-toggle + - + id: image + title: Image + type: heading + level: 1 + collapsed: true + - + id: desaturate-images + title: Desaturate images in dark mode + type: class-toggle + default: true - id: advanced title: Advanced Settings type: heading level: 1 - collapsed: false + collapsed: true - id: no-sanctum-icons title: Disable custom icons diff --git a/src/scss/obsidian/images.scss b/src/scss/obsidian/images.scss index d907834..8494b86 100644 --- a/src/scss/obsidian/images.scss +++ b/src/scss/obsidian/images.scss @@ -1,14 +1,12 @@ // @use 'variables/root'; -.theme-dark .markdown-rendered img:not(:hover), -.theme-dark .workspace-leaf-content img:not(:hover) { +body.desaturate-images .image-embed { opacity: 0.7; transition: opacity var(--duration-slow-2) var(--motion-entrance-expressive); -} -.theme-dark .markdown-rendered img:hover, -.theme-dark .workspace-leaf-content img:hover { - transition: opacity var(--duration-slow-2) var(--motion-entrance-expressive); + &:hover { + opacity: 1; + } } .markdown-rendered img,