Skip to content

Commit de22137

Browse files
refactor(web): move terminal chrome to tailwind
Co-authored-by: Julius Marminge <[email protected]>
1 parent 2d800d3 commit de22137

2 files changed

Lines changed: 5 additions & 34 deletions

File tree

‎apps/web/src/index.css‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,36 +1705,6 @@ code {
17051705
}
17061706
}
17071707

1708-
.t3-ghostty-canvas {
1709-
cursor: text;
1710-
}
1711-
1712-
.t3-ghostty-scrollbar {
1713-
position: absolute;
1714-
z-index: 1;
1715-
top: 4px;
1716-
right: 1px;
1717-
bottom: 4px;
1718-
width: var(--app-scrollbar-width);
1719-
cursor: default;
1720-
touch-action: none;
1721-
}
1722-
1723-
.t3-ghostty-scrollbar-thumb {
1724-
position: absolute;
1725-
top: 0;
1726-
right: 1px;
1727-
left: 1px;
1728-
border-radius: 3px;
1729-
background: var(--app-scrollbar-thumb);
1730-
transition: background-color 120ms ease-out;
1731-
}
1732-
1733-
.t3-ghostty-scrollbar:hover .t3-ghostty-scrollbar-thumb,
1734-
.t3-ghostty-scrollbar:focus-visible .t3-ghostty-scrollbar-thumb {
1735-
background: var(--app-scrollbar-thumb-hover);
1736-
}
1737-
17381708
.model-picker-list::-webkit-scrollbar-track {
17391709
margin-block: 0.5rem;
17401710
}

‎apps/web/src/terminal/ghostty/surface.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,7 @@ export class GhosttyTerminalSurface {
577577
options: GhosttyTerminalSurfaceOptions,
578578
): Promise<GhosttyTerminalSurface> {
579579
const canvas = document.createElement("canvas");
580-
canvas.className = "t3-ghostty-canvas";
581-
canvas.style.cssText = "display:block;width:100%;height:100%;";
580+
canvas.className = "block size-full cursor-text";
582581
canvas.setAttribute("aria-hidden", "true");
583582

584583
const input = document.createElement("textarea");
@@ -591,14 +590,16 @@ export class GhosttyTerminalSurface {
591590
"position:absolute;left:4px;top:4px;width:1px;height:1px;opacity:0;padding:0;border:0;resize:none;pointer-events:none;";
592591

593592
const scrollbar = document.createElement("div");
594-
scrollbar.className = "t3-ghostty-scrollbar";
593+
scrollbar.className =
594+
"group absolute top-1 right-px bottom-1 z-1 w-[var(--app-scrollbar-width)] cursor-default touch-none";
595595
scrollbar.setAttribute("role", "scrollbar");
596596
scrollbar.setAttribute("aria-label", "Terminal scrollback");
597597
scrollbar.setAttribute("aria-orientation", "vertical");
598598
scrollbar.tabIndex = 0;
599599
scrollbar.hidden = true;
600600
const scrollbarThumb = document.createElement("div");
601-
scrollbarThumb.className = "t3-ghostty-scrollbar-thumb";
601+
scrollbarThumb.className =
602+
"absolute inset-x-px top-0 rounded-[3px] bg-[var(--app-scrollbar-thumb)] transition-[background-color] duration-[120ms] ease-[ease-out] group-hover:bg-[var(--app-scrollbar-thumb-hover)] group-focus-visible:bg-[var(--app-scrollbar-thumb-hover)]";
602603
scrollbar.append(scrollbarThumb);
603604
mount.replaceChildren(canvas, input, scrollbar);
604605

0 commit comments

Comments
 (0)