Skip to content

Commit cce19e3

Browse files
fix: cursor visibility in light theme
- Add --color-caret CSS variable (white for dark, dark for light) - Update VimTextArea to use theme-aware caret color - Apply to both insert mode cursor and vim normal mode block cursor
1 parent a7808d3 commit cce19e3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/browser/components/VimTextArea.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ export const VimTextArea = React.forwardRef<HTMLTextAreaElement, VimTextAreaProp
234234
: "bg-dark border-border-light",
235235
!isEditing && (mode === "plan" ? "focus:border-plan-mode" : "focus:border-exec-mode"),
236236
vimMode === "normal"
237-
? "caret-transparent selection:bg-white/50"
238-
: "caret-white selection:bg-selection"
237+
? "caret-transparent selection:bg-caret/50"
238+
: "caret-caret selection:bg-selection"
239239
)}
240240
/>
241241
{trailingAction && (
@@ -244,7 +244,7 @@ export const VimTextArea = React.forwardRef<HTMLTextAreaElement, VimTextAreaProp
244244
</div>
245245
)}
246246
{vimEnabled && vimMode === "normal" && value.length === 0 && (
247-
<div className="pointer-events-none absolute top-1.5 left-2 h-4 w-2 bg-white/50" />
247+
<div className="pointer-events-none absolute top-1.5 left-2 h-4 w-2 bg-caret/50" />
248248
)}
249249
</div>
250250
</div>

src/browser/styles/globals.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@
235235
--color-selection: hsl(204 100% 60% / 0.5); /* selection blue with 50% opacity */
236236
--color-vim-status: hsl(0 0% 83% / 0.6); /* status text with 60% opacity */
237237
--color-code-keyword-overlay-light: hsl(210 100% 70% / 0.05); /* code keyword with 5% opacity */
238+
239+
/* Caret */
240+
--color-caret: hsl(0 0% 100%);
238241
--color-code-keyword-overlay: hsl(210 100% 70% / 0.2); /* code keyword with 20% opacity */
239242

240243
/* Info/status colors */
@@ -453,6 +456,9 @@
453456
--color-selection: hsl(204 100% 45% / 0.3);
454457
--color-vim-status: hsl(210 18% 32% / 0.6);
455458
--color-code-keyword-overlay-light: hsl(210 88% 28% / 0.16);
459+
460+
/* Caret */
461+
--color-caret: hsl(210 18% 16%);
456462
--color-code-keyword-overlay: hsl(210 88% 28% / 0.32);
457463

458464
--color-info-light: hsl(5 90% 70%);

0 commit comments

Comments
 (0)