Skip to content

Commit 7df4d6e

Browse files
authored
fix(label): only thicken border on link hover, not close button (#3104)
Use #container:has(#link:hover) instead of :host(:hover) so the border only thickens when hovering the link text itself, not when hovering the close button. Matches PFv4 behavior. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 14cf0a8 commit 7df4d6e

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

elements/pf-label/pf-label.css

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ pf-icon, ::slotted(pf-icon) {
2020
}
2121

2222
#container {
23-
overflow: hidden;
23+
overflow: clip;
24+
overflow-clip-margin: 6px;
2425
text-overflow: ellipsis;
2526
white-space: nowrap;
2627
border-width: 0;
@@ -305,15 +306,8 @@ pf-button {
305306
cursor: pointer;
306307
}
307308

308-
:host(:hover) #link ~ *,
309-
:host(:focus-within) #link ~ *,
310-
#link:hover,
311-
#link:focus {
312-
cursor: pointer;
313-
}
314-
315-
:host(:hover) #container:has(#link)::before,
316-
:host(:focus-within) #container:has(#link)::before {
309+
#container:has(#link:hover)::before,
310+
#container:has(#link:focus)::before {
317311
border-width: var(--pf-c-label__content--link--hover--before--BorderWidth, 2px);
318312
border-color: var(--_label-link-hover-border-color);
319313
}

0 commit comments

Comments
 (0)