[Bug] Multiple Cursor Selections has a hard-coded background

Hello! I’ve been messing around with multiple cursors and I’ve found an issue with the CSS from presumably Code Mirror overriding the app.css styles.

Specifically, selecting in multiple places with alt+drag has a background color of #d7d4f0 even overriding the the var(--text-selector). This looks decent in light mode but makes dark mode completely unreadable. It also does not respect themes’ custom selection colors.

This comes from the first <style> tag in the <head> element. Specifically, it’s the style from .ͼ2.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground. I assume this has something to do with Code Mirror because the theme template has a line that affects .cm-cursor-layer which seems to be related.

A solution could hopefully also include the ability to customize secondary .cm-selectionBackground elements with some variable like --text-selection-secondary with a default value of that variable being var(--text-selection).

I have included more screenshots of the issue at the bottom.

Steps to reproduce

  1. Go to edit mode (source or live preview)
  2. Hold Alt
  3. Drag to select text
  4. Drag to select more text

You will have to use the debugger command to find the style since it is located under .cm-scroller > .cm-selection-layer. I used setTimeout(()=>{debugger}, 2000) in the console.

A gif of the process:


Expected result

The text background should obey the --text-selector color.

Actual result

The text background is hard coded to be #d7d4f0 in both dark and light modes.


	Obsidian version: v1.2.7
	Installer version: v1.2.7
	Operating system: Windows 10 Pro 10.0.19045
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on


Additional information

Current style:

After removing the hard-coded style:

1 Like

Yeah can confirm this one.

Will be fixed 1.3

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.