damiankorcz / Prism-Theme

A Comprehensive, Highly-Customisable and Elegant Light/Dark Theme for Obsidian.md
https://www.buymeacoffee.com/DamianKorcz
MIT License
369 stars 13 forks source link

Dark Mode Selected Text is Hard To See #151

Closed themensch closed 6 months ago

themensch commented 8 months ago

In the dark mode themes (I've tried them all) the color to indicate selected text is very faint and regardless of any tweaks I make, I cannot make it more visually distinct.

OSes tested: macOS 14.2, iPadOS 17.2, iOS 17.2 Obsidian Version: 1.4.16 Plugin Versions: Style Settings 1.02 Theme Version: 3.4.3

A previous issue #53 solved this problem for light mode themes.

I hope there is a way to apply the same adjustment to dark mode themes so that selected text is easier to see. The problem is less pronounced on mobile because there are constraint indicators for selected text.

ShahriarKh commented 8 months ago
::selection {
    background-color: var(--text-selection);
}

--text-selection: var(--background-modifier-hover);

--background-modifier-hover: hsla(var(--interactive-accent-base-hsl), 90%);

⬇ (assuming accent color is 'cyan')

--interactive-accent-base-hsl: var(--color-cyan-base-hsl);
--interactive-accent-text-hsl: var(--color-cyan-text-hsl);
...

Fix

As a quick fix, this snippet works for me:

body {
  --text-selection: hsla(var(--interactive-accent-text-hsl), 80%) !important;
}

Modifying --background-modifier-hover breaks other things, so I directly edited the --text-selection.

themensch commented 8 months ago
::selection {
    background-color: var(--text-selection);
}

--text-selection: var(--background-modifier-hover);

--background-modifier-hover: hsla(var(--interactive-accent-base-hsl), 90%);

⬇ (assuming accent color is 'cyan')

--interactive-accent-base-hsl: var(--color-cyan-base-hsl);
--interactive-accent-text-hsl: var(--color-cyan-text-hsl);
...

Fix

As a quick fix, this snippet works for me:

body {
  --text-selection: hsla(var(--interactive-accent-text-hsl), 80%) !important;
}

Modifying --background-modifier-hover breaks other things, so I directly edited the --text-selection.

Adding this css snipped as suggested works great for me, thank you! I will continue to observe to make sure there are no Unintended Consequences™.

damiankorcz commented 6 months ago

Hi @themensch, This should now be addressed in Prism 3.4.4.