From 9e90f22c7e123d656bda6c5b462d940cd27469f2 Mon Sep 17 00:00:00 2001
From: TJ Egan <tw15egan@gmail.com>
Date: Thu, 23 Jan 2020 16:15:17 -0800
Subject: [PATCH 1/3] fix(button): remove margin added by safari

---
 packages/components/src/components/button/_button.scss | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/packages/components/src/components/button/_button.scss b/packages/components/src/components/button/_button.scss
index 903e0b420eda..04735bf3ba69 100644
--- a/packages/components/src/components/button/_button.scss
+++ b/packages/components/src/components/button/_button.scss
@@ -43,6 +43,15 @@
     }
   }
 
+  // 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;

From d1c0061e5c54dd5310da0d6014085bb93a3559ad Mon Sep 17 00:00:00 2001
From: TJ Egan <tw15egan@gmail.com>
Date: Tue, 28 Jan 2020 14:50:54 -0800
Subject: [PATCH 2/3] fix(button): add button fix to reset file as well

---
 packages/components/src/globals/scss/_css--reset.scss | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/packages/components/src/globals/scss/_css--reset.scss b/packages/components/src/globals/scss/_css--reset.scss
index d2e91732e7d3..a74f2ed4e2c6 100644
--- a/packages/components/src/globals/scss/_css--reset.scss
+++ b/packages/components/src/globals/scss/_css--reset.scss
@@ -190,6 +190,15 @@
       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;
+        }
+      }
+    }
+
     @include carbon--type-reset;
     @include carbon--icons;
   }

From b0fdec35e4d222c8cb5994c92cde107f9cbc69d4 Mon Sep 17 00:00:00 2001
From: TJ Egan <tw15egan@gmail.com>
Date: Tue, 28 Jan 2020 15:25:20 -0800
Subject: [PATCH 3/3] 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;