diff --git a/UNRELEASED.md b/UNRELEASED.md index 5862f997fe8..1abd5faa4a7 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -30,4 +30,6 @@ Bump polaris-icons to v4.10.0 ([#4569](https://github.com/Shopify/polaris-react/ ### Code quality +Clean up Button styling and $button-filled mixin([#4635](https://github.com/Shopify/polaris-react/pull/4635)) + ### Deprecations diff --git a/src/components/Button/Button.scss b/src/components/Button/Button.scss index c644e38f9f1..023cb215218 100644 --- a/src/components/Button/Button.scss +++ b/src/components/Button/Button.scss @@ -111,21 +111,28 @@ $stacking-order: ( margin-left: -($spinner-size / 2); } +.primary, +.destructive { + @include button-filled; + + &.disabled { + @include recolor-icon(var(--p-icon-disabled)); + color: var(--p-text-disabled); + box-shadow: none; + border-color: transparent; + } +} + .primary { --p-button-color: var(--p-action-primary); --p-button-text: var(--p-text-on-primary); --p-button-color-hover: var(--p-action-primary-hovered); --p-button-color-active: var(--p-action-primary-pressed); --p-button-color-depressed: var(--p-action-primary-depressed); - @include button-filled(color('indigo'), color('indigo', 'dark')); @include recolor-icon(var(--p-icon-on-primary)); &.disabled { - @include recolor-icon(var(--p-icon-disabled)); background: var(--p-action-primary-disabled); - color: var(--p-text-disabled); - border-color: transparent; - box-shadow: none; } } @@ -135,15 +142,10 @@ $stacking-order: ( --p-button-color-hover: var(--p-action-critical-hovered); --p-button-color-active: var(--p-action-critical-pressed); --p-button-color-depressed: var(--p-action-critical-depressed); - @include button-filled(color('red'), color('red', 'dark')); @include recolor-icon(var(--p-icon-on-critical)); &.disabled { - @include recolor-icon(var(--p-icon-disabled)); background: var(--p-action-critical-disabled); - color: var(--p-text-disabled); - box-shadow: none; - border-color: transparent; } } diff --git a/src/styles/shared/_buttons.scss b/src/styles/shared/_buttons.scss index e3152567d72..ed424193870 100644 --- a/src/styles/shared/_buttons.scss +++ b/src/styles/shared/_buttons.scss @@ -76,10 +76,8 @@ color: var(--p-text-disabled); } -@mixin button-filled($button-color, $focus-color, $outline-color: null) { +@mixin button-filled() { @include focus-ring($border-width: 0); - $border-color: darken($button-color, 10%); - $active-color: darken($button-color, 15%); background: var(--p-button-color); border-width: 0; border-color: transparent;