Skip to content

Commit d7ea9eb

Browse files
committed
fix(back-to-top): change background color on hover and focus
Apply hover/focus colors directly rather than through CSS custom property overrides that don't cascade into shadow DOM. Closes #2743 Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1377f14 commit d7ea9eb

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/elements": patch
3+
---
4+
5+
`pf-back-to-top`: background color now changes on hover and focus.

elements/pf-back-to-top/pf-back-to-top.css

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ a {
4141
gap: var(--pf-c-button__icon--m-end--MarginLeft, var(--pf-global--spacer--xs, 0.25rem));
4242
}
4343

44-
a:hover {
45-
--pf-c-button--m-primary--Color: var(--pf-c-button--m-primary--hover--Color, var(--pf-global--Color--light-100, #fff));
46-
--pf-c-button--m-primary--BackgroundColor: var(--pf-c-button--m-primary--hover--BackgroundColor, var(--pf-global--primary-color--200, #004080));
44+
a:hover,
45+
a:focus {
46+
color: var(--pf-c-button--m-primary--hover--Color, var(--pf-global--Color--light-100, #fff));
47+
background-color: var(--pf-c-button--m-primary--hover--BackgroundColor, var(--pf-global--primary-color--200, #004080));
4748
}
4849

49-
a:focus {
50-
--pf-c-button--m-primary--Color: var(--pf-c-button--m-primary--hover--Color, var(--pf-global--Color--light-100,#fff));
50+
[part="trigger"]:is(pf-button):hover,
51+
[part="trigger"]:is(pf-button):focus-within {
5152
--pf-c-button--m-primary--BackgroundColor: var(--pf-c-button--m-primary--hover--BackgroundColor, var(--pf-global--primary-color--200, #004080));
53+
--pf-c-button--m-primary--Color: var(--pf-c-button--m-primary--hover--Color, var(--pf-global--Color--light-100, #fff));
5254
}
5355

5456
[part="trigger"][hidden] {

0 commit comments

Comments
 (0)