From c03a886a9cc457842fa18cde0817e18bb30a5db7 Mon Sep 17 00:00:00 2001 From: Benny Powers Date: Wed, 15 Apr 2026 15:44:52 +0300 Subject: [PATCH 1/2] 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) --- .changeset/fix-back-to-top-hover.md | 5 +++++ elements/pf-back-to-top/pf-back-to-top.css | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changeset/fix-back-to-top-hover.md diff --git a/.changeset/fix-back-to-top-hover.md b/.changeset/fix-back-to-top-hover.md new file mode 100644 index 0000000000..b90911ab0f --- /dev/null +++ b/.changeset/fix-back-to-top-hover.md @@ -0,0 +1,5 @@ +--- +"@patternfly/elements": patch +--- + +`pf-back-to-top`: background color now changes on hover and focus. diff --git a/elements/pf-back-to-top/pf-back-to-top.css b/elements/pf-back-to-top/pf-back-to-top.css index 2d708fee8c..4d74858c9d 100644 --- a/elements/pf-back-to-top/pf-back-to-top.css +++ b/elements/pf-back-to-top/pf-back-to-top.css @@ -41,14 +41,16 @@ a { gap: var(--pf-c-button__icon--m-end--MarginLeft, var(--pf-global--spacer--xs, 0.25rem)); } -a:hover { +a:hover, +a:focus { --pf-c-button--m-primary--Color: var(--pf-c-button--m-primary--hover--Color, var(--pf-global--Color--light-100, #fff)); --pf-c-button--m-primary--BackgroundColor: var(--pf-c-button--m-primary--hover--BackgroundColor, var(--pf-global--primary-color--200, #004080)); } -a:focus { - --pf-c-button--m-primary--Color: var(--pf-c-button--m-primary--hover--Color, var(--pf-global--Color--light-100,#fff)); +[part="trigger"]:is(pf-button):hover, +[part="trigger"]:is(pf-button):focus-within { --pf-c-button--m-primary--BackgroundColor: var(--pf-c-button--m-primary--hover--BackgroundColor, var(--pf-global--primary-color--200, #004080)); + --pf-c-button--m-primary--Color: var(--pf-c-button--m-primary--hover--Color, var(--pf-global--Color--light-100, #fff)); } [part="trigger"][hidden] { From 6dd562177720f0f0328b572936be10ce80432c35 Mon Sep 17 00:00:00 2001 From: Benny Powers Date: Wed, 15 Apr 2026 16:00:08 +0300 Subject: [PATCH 2/2] docs: changeset --- .changeset/fix-back-to-top-hover.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/fix-back-to-top-hover.md b/.changeset/fix-back-to-top-hover.md index b90911ab0f..c5052c34a9 100644 --- a/.changeset/fix-back-to-top-hover.md +++ b/.changeset/fix-back-to-top-hover.md @@ -2,4 +2,4 @@ "@patternfly/elements": patch --- -`pf-back-to-top`: background color now changes on hover and focus. +``: fixed background color during hover and focus.