From b0fdec35e4d222c8cb5994c92cde107f9cbc69d4 Mon Sep 17 00:00:00 2001 From: TJ Egan Date: Tue, 28 Jan 2020 15:25:20 -0800 Subject: [PATCH] fix(button): make margin reset less browser specific --- packages/components/src/components/button/_button.scss | 9 --------- packages/components/src/components/button/_mixins.scss | 2 ++ packages/components/src/globals/scss/_css--reset.scss | 10 +++------- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/packages/components/src/components/button/_button.scss b/packages/components/src/components/button/_button.scss index 03dddeb3368a..0d560ba257a7 100644 --- a/packages/components/src/components/button/_button.scss +++ b/packages/components/src/components/button/_button.scss @@ -43,15 +43,6 @@ } } - // Safari only fix to remove added margins on buttons (see #5155) - @media not all and (min-resolution: 0.001dpcm) { - @supports (-webkit-appearance: none) { - .#{$prefix}--btn { - margin: 0; - } - } - } - // Reset intrisic padding in Firefox (see #731) .#{$prefix}--btn::-moz-focus-inner { padding: 0; diff --git a/packages/components/src/components/button/_mixins.scss b/packages/components/src/components/button/_mixins.scss index 020f645206cc..c97aea4c4cec 100644 --- a/packages/components/src/components/button/_mixins.scss +++ b/packages/components/src/components/button/_mixins.scss @@ -29,6 +29,8 @@ outline: none; position: relative; max-width: rem(320px); + // Fix to remove added margins on buttons in safari (see #5155) + margin: 0; &:disabled, &.#{$prefix}--btn--disabled { diff --git a/packages/components/src/globals/scss/_css--reset.scss b/packages/components/src/globals/scss/_css--reset.scss index a74f2ed4e2c6..8d60fd07128d 100644 --- a/packages/components/src/globals/scss/_css--reset.scss +++ b/packages/components/src/globals/scss/_css--reset.scss @@ -190,13 +190,9 @@ box-sizing: border-box; } - // Safari only fix to remove added margins on buttons (see #5155) - @media not all and (min-resolution: 0.001dpcm) { - @supports (-webkit-appearance: none) { - button { - margin: 0; - } - } + // Fix to remove added margins on buttons in safari (see #5155) + button { + margin: 0; } @include carbon--type-reset;