From 84417c34a9f894a1c51004081416d4185037c352 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Wed, 31 Jul 2024 11:58:52 +0200 Subject: [PATCH] Fix is-pressed disabled styles regression --- packages/components/src/button/style.scss | 24 ++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/components/src/button/style.scss b/packages/components/src/button/style.scss index 8b2bf2f0b6a978..210cd92a70f6fc 100644 --- a/packages/components/src/button/style.scss +++ b/packages/components/src/button/style.scss @@ -333,8 +333,23 @@ // Toggled style. &.is-pressed { - color: $components-color-foreground-inverted; - background: $components-color-foreground; + &, + &:hover { + color: $components-color-foreground-inverted; + &:not(:disabled, [aria-disabled="true"]) { + background: $components-color-foreground; + } + } + + &:disabled, + &[aria-disabled="true"] { + color: $gray-500; + + &:not(.is-primary):not(.is-secondary):not(.is-tertiary) { + color: $components-color-foreground-inverted; + background: $gray-500; + } + } &:focus:not(:disabled) { box-shadow: inset 0 0 0 1px $components-color-background, 0 0 0 var(--wp-admin-border-width-focus) $components-color-accent; @@ -342,11 +357,6 @@ // Windows High Contrast mode will show this outline, but not the box-shadow. outline: 2px solid transparent; } - - &:hover:not(:disabled) { - color: $components-color-foreground-inverted; - background: $components-color-foreground; - } } svg {