fix(webcrt): remove tab close border by dropping button chrome

Global app button styles forced a boxed ×; use an inline span so it reads as part of the device name.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hansjone 2026-07-30 02:34:25 +00:00
parent 2ac8d96409
commit 14f14d34bd
2 changed files with 24 additions and 17 deletions

View file

@ -1703,31 +1703,30 @@ pre {
font-weight: 600; font-weight: 600;
} }
/* span close mark — avoid global `button` border/padding chrome */
.webcrt-tabs__close { .webcrt-tabs__close {
appearance: none;
-webkit-appearance: none;
display: inline; display: inline;
margin: 0; margin: 0;
margin-left: 2px;
padding: 0; padding: 0;
border: 0; border: none;
border-radius: 0; background: none;
background: transparent;
box-shadow: none; box-shadow: none;
outline: none; outline: none;
cursor: pointer; cursor: pointer;
font: inherit; font: inherit;
font-weight: 400; font-weight: inherit;
font-size: 1em; line-height: inherit;
line-height: 1;
color: inherit; color: inherit;
opacity: 0.45; opacity: 0.4;
vertical-align: baseline;
} }
.webcrt-tabs__close:hover, .webcrt-tabs__close::before {
.webcrt-tabs__item:hover .webcrt-tabs__close { content: " ";
opacity: 0.85; }
.webcrt-tabs__item:hover .webcrt-tabs__close,
.webcrt-tabs__close:hover {
opacity: 0.75;
} }
.webcrt-tabs__close:focus-visible { .webcrt-tabs__close:focus-visible {

View file

@ -390,17 +390,25 @@ export function WebcrtPage() {
<span> <span>
{deviceLabel(tab.target)} {deviceLabel(tab.target)}
{tab.status === "connecting" ? ` (${t("webcrt.status.connecting")})` : ""} {tab.status === "connecting" ? ` (${t("webcrt.status.connecting")})` : ""}
<button <span
type="button" role="button"
tabIndex={0}
className="webcrt-tabs__close" className="webcrt-tabs__close"
aria-label={t("webcrt.disconnect")} aria-label={t("webcrt.disconnect")}
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
void closeTab(tab.key); void closeTab(tab.key);
}} }}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault();
e.stopPropagation();
void closeTab(tab.key);
}
}}
> >
× ×
</button> </span>
</span> </span>
</div> </div>
))} ))}