fix(terminal): make xterm scrollbar gutter transparent (#7876)
* fix(terminal): style xterm scrollbar gutter * fix(terminal): reuse the canonical scrollbar style
This commit is contained in:
@@ -529,27 +529,32 @@
|
||||
|
||||
/* ── Editor-style scrollbar (matches Monaco) ────────── */
|
||||
|
||||
.scrollbar-editor {
|
||||
.scrollbar-editor,
|
||||
.xterm .xterm-viewport {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: rgba(121, 121, 121, 0.4) transparent;
|
||||
}
|
||||
|
||||
.scrollbar-editor::-webkit-scrollbar {
|
||||
.scrollbar-editor::-webkit-scrollbar,
|
||||
.xterm .xterm-viewport::-webkit-scrollbar {
|
||||
width: 14px;
|
||||
}
|
||||
|
||||
.scrollbar-editor::-webkit-scrollbar-track {
|
||||
.scrollbar-editor::-webkit-scrollbar-track,
|
||||
.xterm .xterm-viewport::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.scrollbar-editor::-webkit-scrollbar-thumb {
|
||||
.scrollbar-editor::-webkit-scrollbar-thumb,
|
||||
.xterm .xterm-viewport::-webkit-scrollbar-thumb {
|
||||
background: rgba(121, 121, 121, 0.4);
|
||||
border: 3px solid transparent;
|
||||
border-radius: 7px;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
.scrollbar-editor::-webkit-scrollbar-thumb:hover {
|
||||
.scrollbar-editor::-webkit-scrollbar-thumb:hover,
|
||||
.xterm .xterm-viewport::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(121, 121, 121, 0.7);
|
||||
border: 3px solid transparent;
|
||||
background-clip: padding-box;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import fs from 'node:fs'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
const terminalCss = fs.readFileSync(new URL('./terminal.css', import.meta.url), 'utf8')
|
||||
const mainCss = fs.readFileSync(new URL('./main.css', import.meta.url), 'utf8')
|
||||
|
||||
describe('terminal scrollbar styling', () => {
|
||||
it('reuses the canonical editor scrollbar with a transparent gutter', () => {
|
||||
expect(mainCss).toMatch(
|
||||
/\.scrollbar-editor,\s*\.xterm \.xterm-viewport\s*{[^}]*scrollbar-color:\s*rgba\(121, 121, 121, 0\.4\) transparent/s
|
||||
)
|
||||
expect(mainCss).toMatch(
|
||||
/\.scrollbar-editor::-webkit-scrollbar-track,\s*\.xterm \.xterm-viewport::-webkit-scrollbar-track\s*{[^}]*background:\s*transparent/s
|
||||
)
|
||||
expect(terminalCss).not.toContain('--xterm-scrollbar-thumb')
|
||||
})
|
||||
})
|
||||
@@ -36,8 +36,8 @@
|
||||
the install terminals inside centered setup modals), that black layer
|
||||
anti-aliases into a faint 1px line above/below the themed .xterm. Match
|
||||
xterm's own selector so this also covers terminals mounted outside the pane
|
||||
manager, and let the themed .xterm background show through; our scrollbar is
|
||||
already custom-styled below. */
|
||||
manager, and let the themed .xterm background show through; the viewport
|
||||
reuses the canonical editor scrollbar rules in main.css. */
|
||||
.xterm:not(.allow-transparency) .xterm-viewport {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user