Skip to content

Commit 87f88ed

Browse files
wikirbyclaude
andcommitted
Hide blinking text caret on sidebar UI chrome
Caret browsing mode (F7 in Edge/Chrome) and some accessibility tools force a text caret on every focused element — including buttons, the section combobox, and read-only value displays like the source URL. The caret looks wrong on these controls (they aren't text content meant to be read or edited). Solution: blanket caret-color:transparent on #sidebar, with caret-color restored on input/textarea elements where editing actually happens (Title, Note, PDF page range). Selection still works everywhere — only the visual caret indicator is suppressed. Also adds user-select:none on #section-selected so double-click on the combobox doesn't highlight the section path text (it's a click target, not selectable content). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9a6d7e9 commit 87f88ed

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/styles/renderer.less

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,15 @@ iframe#preview-frame {
206206
display: flex; flex-direction: column;
207207
box-sizing: border-box; overflow: hidden;
208208
border-left: 1px solid @colorNeutralStroke2;
209+
// The sidebar is a control surface, not reading material. Caret browsing
210+
// (F7) and some accessibility tools blink a text caret on every focused
211+
// element including buttons and read-only displays, which looks wrong.
212+
// Hide the caret blanket; restore in actual editable fields below.
213+
caret-color: transparent;
214+
}
215+
#sidebar input,
216+
#sidebar textarea {
217+
caret-color: auto;
209218
}
210219

211220
#sidebar-header {
@@ -349,6 +358,9 @@ iframe#preview-frame {
349358
border: 1px solid @colorNeutralStroke1; border-radius: 4px;
350359
padding: 4px 28px 4px 12px; font-size: 14px; line-height: 20px; font-family: inherit;
351360
cursor: pointer;
361+
// Combobox click target — disable text selection so double-click doesn't
362+
// highlight the section path text. Caret hiding handled by #sidebar above.
363+
user-select: none;
352364
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
353365
// Chevron down arrow
354366
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' stroke='%23424242' stroke-width='1.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

0 commit comments

Comments
 (0)