From a4f79a9ebd8963b99becb3b97433c9e5d6b5675d Mon Sep 17 00:00:00 2001 From: Tobias Ahlin Date: Thu, 18 Mar 2021 16:25:43 +0100 Subject: [PATCH 01/11] Add negative margins --- src/marketing/utilities/margin.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/marketing/utilities/margin.scss b/src/marketing/utilities/margin.scss index 61cde8de..39eea32c 100644 --- a/src/marketing/utilities/margin.scss +++ b/src/marketing/utilities/margin.scss @@ -8,6 +8,9 @@ .mt#{$variant}-#{$scale} { margin-top: $size !important; } .mb#{$variant}-#{$scale} { margin-bottom: $size !important; } + .mt#{$variant}-n#{$scale} { margin-top: -$size !important; } + .mb#{$variant}-n#{$scale} { margin-bottom: -$size !important; } + .my#{$variant}-#{$scale} { margin-top: $size !important; margin-bottom: $size !important; From efcd58df7dd2ba91dc0972fceaecb3580e5930ab Mon Sep 17 00:00:00 2001 From: Tobias Ahlin Date: Thu, 18 Mar 2021 16:34:49 +0100 Subject: [PATCH 02/11] Add common margin auto utilities --- src/marketing/utilities/margin.scss | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/marketing/utilities/margin.scss b/src/marketing/utilities/margin.scss index 39eea32c..ff3e8e8e 100644 --- a/src/marketing/utilities/margin.scss +++ b/src/marketing/utilities/margin.scss @@ -18,3 +18,21 @@ } } } + +.mt-auto { + margin-top: auto !important; +} + +.mx-auto { + margin-right: auto !important; + margin-left: auto !important; +} + +.my-auto { + margin-top: auto !important; + margin-bottom: auto !important; +} + +.m-auto { + margin: auto !important; +} From ba0bb9e583ecfb2afe7dd9895f3bc7a163e0edfb Mon Sep 17 00:00:00 2001 From: Tobias Ahlin Date: Thu, 18 Mar 2021 16:45:45 +0100 Subject: [PATCH 03/11] Add sizing utilities --- src/marketing/utilities/sizing.scss | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/marketing/utilities/sizing.scss diff --git a/src/marketing/utilities/sizing.scss b/src/marketing/utilities/sizing.scss new file mode 100644 index 00000000..e8e38fd9 --- /dev/null +++ b/src/marketing/utilities/sizing.scss @@ -0,0 +1,13 @@ +// Sizing utilities for marketing + +.width-auto { + width: auto !important; +} + +.height-auto { + height: auto !important; +} + +.object-fit-cover { + object-fit: cover !important; +} From 14514bc937fb3c48a519b55131ccd212b7f3c3c2 Mon Sep 17 00:00:00 2001 From: Tobias Ahlin Date: Thu, 18 Mar 2021 16:47:42 +0100 Subject: [PATCH 04/11] Add z-index --- src/marketing/utilities/layout.scss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/marketing/utilities/layout.scss b/src/marketing/utilities/layout.scss index c17f5f51..a0baf645 100644 --- a/src/marketing/utilities/layout.scss +++ b/src/marketing/utilities/layout.scss @@ -27,3 +27,12 @@ } } } + +// Handling z-index +.z-1 { z-index: 1 !important; } +.z-2 { z-index: 2 !important; } +.z-3 { z-index: 3 !important; } + +// Negative z-index +.z-n1 { z-index: -1 !important; } +.z-n2 { z-index: -2 !important; } From c03f6d3f50fc67ee93b4664d65550d6f9c123497 Mon Sep 17 00:00:00 2001 From: Tobias Ahlin Date: Thu, 18 Mar 2021 17:06:11 +0100 Subject: [PATCH 05/11] Import sizing utilities --- src/marketing/utilities/index.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/marketing/utilities/index.scss b/src/marketing/utilities/index.scss index 4ba10efa..15d74b0f 100644 --- a/src/marketing/utilities/index.scss +++ b/src/marketing/utilities/index.scss @@ -5,3 +5,4 @@ @import "./layout.scss"; @import "./margin.scss"; @import "./padding.scss"; +@import "./sizing.scss"; From 8d0ca03ed7d7caf87646d00f633258f8845b1d0d Mon Sep 17 00:00:00 2001 From: Tobias Ahlin Date: Thu, 18 Mar 2021 18:36:50 +0100 Subject: [PATCH 06/11] Add hover animation --- src/marketing/utilities/animation.scss | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/marketing/utilities/animation.scss diff --git a/src/marketing/utilities/animation.scss b/src/marketing/utilities/animation.scss new file mode 100644 index 00000000..fcb16059 --- /dev/null +++ b/src/marketing/utilities/animation.scss @@ -0,0 +1,9 @@ +// Animation utilities for marketing + +.hover-grow-mktg { + transition: transform 0.25s cubic-bezier(0.76, 0, 0.24, 1); + + &:hover { + transform: scale3d(1.025, 1.025, 1.025); + } +} From f60b78151a7c790d648f4314e0f395ce3cc1e523 Mon Sep 17 00:00:00 2001 From: Tobias Ahlin Bjerrome Date: Fri, 19 Mar 2021 14:09:01 +0100 Subject: [PATCH 07/11] Move utility classes to layout, to align with rest of primer --- src/marketing/utilities/index.scss | 1 - src/marketing/utilities/layout.scss | 8 ++++++++ src/marketing/utilities/sizing.scss | 13 ------------- 3 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 src/marketing/utilities/sizing.scss diff --git a/src/marketing/utilities/index.scss b/src/marketing/utilities/index.scss index 15d74b0f..4ba10efa 100644 --- a/src/marketing/utilities/index.scss +++ b/src/marketing/utilities/index.scss @@ -5,4 +5,3 @@ @import "./layout.scss"; @import "./margin.scss"; @import "./padding.scss"; -@import "./sizing.scss"; diff --git a/src/marketing/utilities/layout.scss b/src/marketing/utilities/layout.scss index a0baf645..0e8c05ba 100644 --- a/src/marketing/utilities/layout.scss +++ b/src/marketing/utilities/layout.scss @@ -28,6 +28,14 @@ } } +// Width and height utilities, especially needed when the +// dimensions of an image are set in HTML +.width-auto { width: auto !important; } +.height-auto { height: auto !important; } + +// Make an object fill its parent +.object-fit-cover { object-fit: cover !important; } + // Handling z-index .z-1 { z-index: 1 !important; } .z-2 { z-index: 2 !important; } diff --git a/src/marketing/utilities/sizing.scss b/src/marketing/utilities/sizing.scss deleted file mode 100644 index e8e38fd9..00000000 --- a/src/marketing/utilities/sizing.scss +++ /dev/null @@ -1,13 +0,0 @@ -// Sizing utilities for marketing - -.width-auto { - width: auto !important; -} - -.height-auto { - height: auto !important; -} - -.object-fit-cover { - object-fit: cover !important; -} From 9a976291310efbc957dbe285794624d3c9cfca43 Mon Sep 17 00:00:00 2001 From: Tobias Ahlin Bjerrome Date: Wed, 24 Mar 2021 11:42:04 +0100 Subject: [PATCH 08/11] Add and use easing variable --- src/marketing/support/variables.scss | 1 + src/marketing/utilities/{animation.scss => animations.scss} | 2 +- src/marketing/utilities/index.scss | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) rename src/marketing/utilities/{animation.scss => animations.scss} (66%) diff --git a/src/marketing/support/variables.scss b/src/marketing/support/variables.scss index 7d0ec1ca..7164093c 100644 --- a/src/marketing/support/variables.scss +++ b/src/marketing/support/variables.scss @@ -37,6 +37,7 @@ $blue-mktg: mix($blue-400, $blue-500, 42%) !default; // Animations $transition-time: 0.4s !default; +$ease-mktg: cubic-bezier(0.16, 1, 0.3, 1); // Increases the core spacing scale first by 8px for $spacer-7, then by 16px // increments from $spacer-8 to $spacer-12, i.e. after 40px, we have 48, 64, diff --git a/src/marketing/utilities/animation.scss b/src/marketing/utilities/animations.scss similarity index 66% rename from src/marketing/utilities/animation.scss rename to src/marketing/utilities/animations.scss index fcb16059..49061405 100644 --- a/src/marketing/utilities/animation.scss +++ b/src/marketing/utilities/animations.scss @@ -1,7 +1,7 @@ // Animation utilities for marketing .hover-grow-mktg { - transition: transform 0.25s cubic-bezier(0.76, 0, 0.24, 1); + transition: transform 0.4s $ease-mktg; &:hover { transform: scale3d(1.025, 1.025, 1.025); diff --git a/src/marketing/utilities/index.scss b/src/marketing/utilities/index.scss index 4ba10efa..80bb1bb6 100644 --- a/src/marketing/utilities/index.scss +++ b/src/marketing/utilities/index.scss @@ -1,7 +1,8 @@ @import "../support/index.scss"; // utilities -@import "./filters.scss"; +@import "./animations.scss"; @import "./borders.scss"; +@import "./filters.scss"; @import "./layout.scss"; @import "./margin.scss"; @import "./padding.scss"; From 3ec257dffa1ca8dfd7192b9d2c0a3c0f54fc8486 Mon Sep 17 00:00:00 2001 From: Tobias Ahlin Bjerrome Date: Wed, 24 Mar 2021 13:04:49 +0100 Subject: [PATCH 09/11] Clean up most of the new margin utilities --- src/marketing/utilities/margin.scss | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/marketing/utilities/margin.scss b/src/marketing/utilities/margin.scss index ff3e8e8e..b9207dea 100644 --- a/src/marketing/utilities/margin.scss +++ b/src/marketing/utilities/margin.scss @@ -23,16 +23,4 @@ margin-top: auto !important; } -.mx-auto { - margin-right: auto !important; - margin-left: auto !important; -} - -.my-auto { - margin-top: auto !important; - margin-bottom: auto !important; -} - -.m-auto { - margin: auto !important; -} +.m-auto { margin: auto !important; } From c4761ac425a990f90aaf0321dff1ae728ddf7061 Mon Sep 17 00:00:00 2001 From: Tobias Ahlin Bjerrome Date: Wed, 24 Mar 2021 13:04:58 +0100 Subject: [PATCH 10/11] Add default for easing var --- src/marketing/support/variables.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/marketing/support/variables.scss b/src/marketing/support/variables.scss index 7164093c..49629bfc 100644 --- a/src/marketing/support/variables.scss +++ b/src/marketing/support/variables.scss @@ -37,7 +37,7 @@ $blue-mktg: mix($blue-400, $blue-500, 42%) !default; // Animations $transition-time: 0.4s !default; -$ease-mktg: cubic-bezier(0.16, 1, 0.3, 1); +$ease-mktg: cubic-bezier(0.16, 1, 0.3, 1) !default; // Increases the core spacing scale first by 8px for $spacer-7, then by 16px // increments from $spacer-8 to $spacer-12, i.e. after 40px, we have 48, 64, From 5d2f0beb58b6fab795d5b720e9a14da2f649265c Mon Sep 17 00:00:00 2001 From: Jon Rohan Date: Fri, 26 Mar 2021 08:57:08 -0700 Subject: [PATCH 11/11] Create nervous-plants-smell.md --- .changeset/nervous-plants-smell.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/nervous-plants-smell.md diff --git a/.changeset/nervous-plants-smell.md b/.changeset/nervous-plants-smell.md new file mode 100644 index 00000000..385c84c8 --- /dev/null +++ b/.changeset/nervous-plants-smell.md @@ -0,0 +1,5 @@ +--- +"@primer/css": minor +--- + +Add common marketing utilities to primer/marketing