mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 00:50:46 +08:00
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:
parent
2ac8d96409
commit
14f14d34bd
2 changed files with 24 additions and 17 deletions
|
|
@ -1703,31 +1703,30 @@ pre {
|
|||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* span close mark — avoid global `button` border/padding chrome */
|
||||
.webcrt-tabs__close {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
display: inline;
|
||||
margin: 0;
|
||||
margin-left: 2px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
font-weight: 400;
|
||||
font-size: 1em;
|
||||
line-height: 1;
|
||||
font-weight: inherit;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
opacity: 0.45;
|
||||
vertical-align: baseline;
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.webcrt-tabs__close:hover,
|
||||
.webcrt-tabs__item:hover .webcrt-tabs__close {
|
||||
opacity: 0.85;
|
||||
.webcrt-tabs__close::before {
|
||||
content: " ";
|
||||
}
|
||||
|
||||
.webcrt-tabs__item:hover .webcrt-tabs__close,
|
||||
.webcrt-tabs__close:hover {
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.webcrt-tabs__close:focus-visible {
|
||||
|
|
|
|||
|
|
@ -390,17 +390,25 @@ export function WebcrtPage() {
|
|||
<span>
|
||||
{deviceLabel(tab.target)}
|
||||
{tab.status === "connecting" ? ` (${t("webcrt.status.connecting")})` : ""}
|
||||
<button
|
||||
type="button"
|
||||
<span
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
className="webcrt-tabs__close"
|
||||
aria-label={t("webcrt.disconnect")}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
void closeTab(tab.key);
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" || e.key === " ") {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
void closeTab(tab.key);
|
||||
}
|
||||
}}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue