ZotLit 2.2.4 focus selector slows Markdown re-rendering in large Obsidian windows

Steps to reproduce

  1. In Obsidian Sandbox, open two notes side by side in Reading view. Put a Markdown table in the first note and keep a much larger note visible in the second pane. My larger note contained four HTML tables, each with 100 rows and six columns.
  2. Add and enable a CSS snippet containing the rule below. Switch the first note out of Reading view and back a few times to observe the rendering delay.
  3. Remove just :has(:focus-visible:not(.cm-content)) from the snippet, then repeat with both notes still open.
.zt\:group-has-\[\:focus-visible\:not\(\.cm-content\)\]\:opacity-100:is(:where(.zt\:group):has(:focus-visible:not(.cm-content)) *) {
  opacity: 1;
}

Expected behavior

With both notes open, the smaller note should render in roughly the same time whether the ZotLit focus rule is enabled or disabled. Keyboard focus indicators should remain visible in ZotLit.

Actual behavior

In this split view, median reading-view re-render time was 82.5 ms with the original rule and 40.5–41.5 ms with the condition removed. I saw a larger difference in my regular vault. Smaller notes in the sandbox showed no consistent slowdown.

Versions and environment

  • ZotLit plugin and companion versions: 2.2.4
  • Obsidian version: 1.15.1
  • Zotero version: 10.0.9
  • Operating system: macOS 27.2.1
  • Can you reproduce it in an Obsidian sandbox vault? Yes

Obsidian debug info

SYSTEM INFO:
	Obsidian version: 1.15.1
	Installer version: 1.15.1
	Operating system: Darwin Kernel Version 27.2.0: Thu Oct 15 00:02:46 PDT 2026; root:xnu-13432.41.4~25/RELEASE_ARM64_T6000 27.2.0
	Login status: logged in
	Language: zh
	Catalyst license: insider
	Insider build toggle: on
	Live preview: on
	Base theme: adapt to system
	Community theme: Primary Dev 2.11.0-dev.5
	Snippets enabled: 24
	Restricted mode: off
	Plugins installed: 86
	Plugins enabled: 61
		1: Startup Error Recorder v0.0.2
		2: Better footnote v1.0.1
		3: BRAT v2.2.0
		4: Commander v0.7.1
		5: Dataview v0.5.68
		6: Footnote Shortcut v0.2.0
		7: Image2LaTEX v1.1.2
		8: Plugin Update Tracker v1.7.0
		9: Privacy Glasses v0.6.0
		10: QuickAdd v2.33.3
		11: Templater v2.27.0
		12: Workspaces Plus v0.13.0
		13: Zoom v1.1.2
		14: Card Library v0.2.1
		15: Admonition v12.0.11
		16: Better Word Count v0.10.1
		17: Copy Block Link v1.0.4
		18: CardNote v1.7.2
		19: Vertical Tabs v0.18.6
		20: Tasks v8.6.0
		21: Longform v2.1.0
		22: Obsifetch v1.3.2
		23: Keep the Rhythm v0.2.16
		24: Floating Search v4.4.1
		25: Auto switch themes between dark and light mode v0.9.3
		26: Latex Suite v1.14.5
		27: Lineage v0.8.5
		28: Linter v1.35.0
		29: Excalidraw v2.29.4
		30: Export Image plugin v2.4.4
		31: MetaEdit v1.11.0
		32: Style Settings v1.0.9
		33: Heading Decorator v3.1.2
		34: Editing Toolbar v4.1.14
		35: XMind Integration v1.4.0
		36: GridExplorer v3.5.6
		37: Task Genius v9.13.1
		38: AnyBlock v3.5.4
		39: Git v2.43.0
		40: Block Link Plus v2.0.21
		41: Front Matter Title v4.3.0
		42: SnipDock v1.1.3
		43: Simple mind map v0.2.14
		44: Easy Typing v6.0.10
		45: Datacore v0.1.29
		46: YOLO v1.6.17
		47: Folder notes v1.8.26
		48: Deck To Anki v1.0.6
		49: Outline Mindmap v1.3.11
		50: aDHL v1.2.17
		51: Colorful Highlights v1.5.0
		52: Iconize v2.14.7
		53: Better Properties v1.0.0
		54: Image Converter v1.4.7
		55: RavenHogwarts's Toolkit v1.3.1
		56: Pixel Banner v3.7.4
		57: Media Extended v4.2.9
		58: Custom Attachment Location v10.3.4
		59: Typst Toolbox v1.3.0
		60: Enhancing Export v1.11.4
		61: ZotLit v2.2.4

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Confirming this on Linux with ZotLit 2.3.0-beta.0. The rule is unchanged in the beta, and in a large vault the slowdown is much bigger than in the sandbox numbers above. Obsidian freezes for 2–5 seconds whenever a view renders several notes at once.

Steps to reproduce

  1. Enable ZotLit 2.3.0-beta.0 in a vault with a moderately heavy UI (here: ~6,300 DOM nodes, 66 stylesheets, ~15,400 CSS rules).
  2. Open any view that renders several notes at once, e.g. a Bases view that embeds full notes, or a note in Reading view with many callouts and a properties block.
  3. Remove only the :has(:focus-visible:not(.cm-content)) branch of the selector list from ZotLit’s stylesheet at runtime, then repeat step 2.

Isolated measurement (paste in the dev console):

const d = document.createElement('div'); d.className = 'callout';
document.querySelector('.workspace').appendChild(d);
const t = performance.now(); getComputedStyle(d).getPropertyValue('--callout-icon');
console.log(performance.now() - t, 'ms'); d.remove();

Obsidian core runs exactly this read for every rendered callout (--callout-icon), so each callout pays one forced style recalculation.

Expected behavior

A forced style recalculation after inserting one element costs a few milliseconds, and rendering a note doesn’t block the main thread for seconds.

Actual behavior

I measured long tasks via PerformanceObserver. Each of the 66 stylesheets was disabled one at a time, then each :has() rule in ZotLit’s sheet was removed one at a time. Only this rule made a difference:

.zt\:group-focus-visible\:opacity-100:is(:where(.zt\:group):focus-visible *),
.zt\:group-has-\[\:focus-visible\:not\(\.cm-content\)\]\:opacity-100:is(:where(.zt\:group):has(:focus-visible:not(.cm-content)) *) { opacity: 1 }
Measurement With the rule Without the :has() branch
Forced recalc after inserting one .callout ~165 ms ~21–25 ms
Opening a Bases view that renders 5 full notes (main thread blocked within 12 s) 3.3 s, longest task 2.4 s 0.9 s, longest task 0.6 s
Opening a dashboard note (tabs, Dataview, Tasks, Bases embeds) 7.0 s, longest task 0.9 s 1.6 s, longest task 0.24 s

Removing the other 14 :has() rules in the sheet changed nothing (155–172 ms vs a 163 ms baseline). Disabling the entire ZotLit sheet gave 21 ms, the same as removing just this branch.

The first branch (:focus-visible *) is harmless. The cost comes from :has() nested inside :is(... *): Chromium appears to re-match this descendant selector against the whole document after any DOM insertion. Possible fixes: scope it as .zt\:group:has(:focus-visible:not(.cm-content)) .zt\:group-has-…, or replace the Tailwind group-has-[…] variant with a :focus-within-based one.

Local workaround: a tiny plugin that removes only the :has( branch from ZotLit’s sheet on load. Focus indicators via the first branch keep working.

Versions and environment

  • ZotLit plugin: 2.3.0-beta.0 (via BRAT); Zotero companion: 2.2.4
  • Obsidian version: 1.15.1 (installer 1.15.1)
  • Zotero version: 9.0.6
  • Operating system: Manjaro Linux, kernel 7.3.4
  • Can you reproduce it in an Obsidian sandbox vault? Haven’t tried. The effect scales with DOM/CSS size, as the original post notes.

Obsidian debug info

SYSTEM INFO:
	Obsidian version: 1.15.1
	Installer version: 1.15.1
	Operating system: #1 SMP PREEMPT_DYNAMIC Sun, 15 Nov 2026 15:48:27 +0000 7.3.4-3-MANJARO
	Login status: not logged in
	Language: en
	Insider build toggle: off
	Live preview: on
	Base theme: dark
	Community theme: Base16 Default Dark 4.4.9
	Snippets enabled: 4
	Restricted mode: off
	Plugins installed: 52
	Plugins enabled: 48
		1: Calendar v1.7.2
		2: Periodic Notes v1.0.0
		3: Footnote Shortcut v0.2.0
		4: Outliner v4.12.3
		5: Editing Toolbar v4.1.14
		6: QuickAdd v2.33.3
		7: List Callouts v1.2.9
		8: Tasks v8.7.0
		9: Templater v2.27.0
		10: Dataview v0.5.68
		11: Longform v2.1.0
		12: Linter v1.35.0
		13: Spaced Repetition v1.15.4
		14: Excalidraw v2.29.4
		15: Local Images Plus v0.20.6
		16: Meta Bind v1.5.1
		17: BRAT v2.2.0
		18: Bases Chart Views v1.3.1
		19: Timeline for Bases v0.1.11
		20: Block View v1.7.2
		21: Local Fonts v1.4.1
		22: Janitor v1.2.0
		23: Force note view mode v1.3.0
		24: Another Quick Switcher v14.9.0
		25: Claudian v2.3.49
		26: Automatic Table Of Contents v1.8.0
		27: Supercharged Links v0.14.0
		28: Obsidian_to_Anki v3.6.0
		29: Tabbed v2.2.3
		30: Bases Board v1.3.0
		31: fakelink v1.24.37
		32: Abyss Tasks v2.4.1
		33: Various Complements v11.4.2
		34: Attachment Management v0.12.1
		35: Hybrid Search v0.12.0
		36: ZotLit v2.3.0-beta.0
		37: Micropatches v1.11.4
		38: aDHL v1.2.17
		39: Metadata Validator v1.1.5
		40: Journal Bases v2.2.0
		41: Life Tracker v3.6.1
		42: Dynamic Views v0.15.0
		43: Bases Structure v1.1.0
		44: Just Simple Calendar v1.7.0
		45: Image Context Menus v1.14.0
		46: Commander v0.7.1
		47: Navbar Composer v1.1.0
		48: ZotLit :has() perf fix v1.0.0

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Will be fixed in v2.3.0 betas