From 8091240360a393c0c03bc10ac2dae72131133e64 Mon Sep 17 00:00:00 2001 From: Danny Kim Date: Wed, 30 Aug 2023 15:52:38 -0400 Subject: [PATCH 01/10] feat: initial utilities doc --- .../vanilla/src/sass/utilities/_spacing.scss | 2 +- .../vanilla/src/stories/Utilities.stories.mdx | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 packages/vanilla/src/stories/Utilities.stories.mdx diff --git a/packages/vanilla/src/sass/utilities/_spacing.scss b/packages/vanilla/src/sass/utilities/_spacing.scss index 0095fb7e..7bee7610 100644 --- a/packages/vanilla/src/sass/utilities/_spacing.scss +++ b/packages/vanilla/src/sass/utilities/_spacing.scss @@ -17,7 +17,7 @@ $spacing: ( @each $name, $space in $spacing { .cbp-margin-#{$name} { - margin-left: #{$space} !important; + margin: #{$space} !important; } .cbp-margin-top-#{$name} { diff --git a/packages/vanilla/src/stories/Utilities.stories.mdx b/packages/vanilla/src/stories/Utilities.stories.mdx new file mode 100644 index 00000000..542f5628 --- /dev/null +++ b/packages/vanilla/src/stories/Utilities.stories.mdx @@ -0,0 +1,42 @@ +import { Meta } from '@storybook/addon-docs'; + + + +# Utilities + +Utility classes refer to small, reusable CSS classes that are designed to provide specific styling or functionality to HTML elements. + +## Spacing + +### Margin + +
+ + + + + + + + + + + + + +
Utility ClassCSS
.cbp-margin-0`margin: 0 !important`
+ + + + + + + + + + + + + +
Utility ClassCSS
.cbp-margin-0`margin: 0 !important`
+
\ No newline at end of file From f79dfd685be2bd370504205b7df3e54e281a4208 Mon Sep 17 00:00:00 2001 From: Danny Kim Date: Tue, 5 Sep 2023 10:36:40 -0400 Subject: [PATCH 02/10] chore: deleted _z-index.scss utlities file --- packages/vanilla/src/sass/utilities/_z-index.scss | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 packages/vanilla/src/sass/utilities/_z-index.scss diff --git a/packages/vanilla/src/sass/utilities/_z-index.scss b/packages/vanilla/src/sass/utilities/_z-index.scss deleted file mode 100644 index be157f82..00000000 --- a/packages/vanilla/src/sass/utilities/_z-index.scss +++ /dev/null @@ -1,8 +0,0 @@ -/* - TODO: delete? -*/ - -$z: ( - "application-header": 9997, - "backdrop": 9998 -) \ No newline at end of file From 3b83515dfd2562816c0d69a5d10acad5c3c2b150 Mon Sep 17 00:00:00 2001 From: Danny Kim Date: Tue, 5 Sep 2023 14:31:50 -0400 Subject: [PATCH 03/10] chore: reorder spacing utlities docs --- .../vanilla/src/stories/Utilities.stories.mdx | 42 -------- .../src/stories/utilities/doc.stories.mdx | 7 ++ .../src/stories/utilities/spacing.stories.mdx | 98 +++++++++++++++++++ 3 files changed, 105 insertions(+), 42 deletions(-) delete mode 100644 packages/vanilla/src/stories/Utilities.stories.mdx create mode 100644 packages/vanilla/src/stories/utilities/doc.stories.mdx create mode 100644 packages/vanilla/src/stories/utilities/spacing.stories.mdx diff --git a/packages/vanilla/src/stories/Utilities.stories.mdx b/packages/vanilla/src/stories/Utilities.stories.mdx deleted file mode 100644 index 542f5628..00000000 --- a/packages/vanilla/src/stories/Utilities.stories.mdx +++ /dev/null @@ -1,42 +0,0 @@ -import { Meta } from '@storybook/addon-docs'; - - - -# Utilities - -Utility classes refer to small, reusable CSS classes that are designed to provide specific styling or functionality to HTML elements. - -## Spacing - -### Margin - -
- - - - - - - - - - - - - -
Utility ClassCSS
.cbp-margin-0`margin: 0 !important`
- - - - - - - - - - - - - -
Utility ClassCSS
.cbp-margin-0`margin: 0 !important`
-
\ No newline at end of file diff --git a/packages/vanilla/src/stories/utilities/doc.stories.mdx b/packages/vanilla/src/stories/utilities/doc.stories.mdx new file mode 100644 index 00000000..e656e36c --- /dev/null +++ b/packages/vanilla/src/stories/utilities/doc.stories.mdx @@ -0,0 +1,7 @@ +import { Meta } from '@storybook/addon-docs'; + + + +# Utilities + +Utility classes refer to small, reusable CSS classes that are designed to provide specific styling or functionality to HTML elements. diff --git a/packages/vanilla/src/stories/utilities/spacing.stories.mdx b/packages/vanilla/src/stories/utilities/spacing.stories.mdx new file mode 100644 index 00000000..129e0a8d --- /dev/null +++ b/packages/vanilla/src/stories/utilities/spacing.stories.mdx @@ -0,0 +1,98 @@ +import { Meta } from '@storybook/addon-docs'; + + + +# Spacing + +Spacing utility classes are CSS classes that are used to manage and control the spacing (margins and padding) of elements. +They provide a convenient way to apply consistent and predefined spacing values to various elements. + +## Margin + +
+
+

Margin Top

+ + + + + + + + + + + + + +
Utility ClassCSS
.cbp-margin-top-0`margin-top: 0 !important`
+
+
+

Margin Bottom

+ + + + + + + + + + + + + +
Utility ClassCSS
.cbp-margin-bottom-0`margin-bottom: 0 !important`
+
+
+

Margin Left

+ + + + + + + + + + + + + +
Utility ClassCSS
.cbp-margin-left-0`margin-left: 0 !important`
+
+
+

Margin Right

+ + + + + + + + + + + + + +
Utility ClassCSS
.cbp-margin-right-0`margin-right: 0 !important`
+
+
+

Margin

+ + + + + + + + + + + + + +
Utility ClassCSS
.cbp-margin-0`margin: 0 !important`
+
+
\ No newline at end of file From 17917bfbcfbe26c9aa59ee75795e093f5783e747 Mon Sep 17 00:00:00 2001 From: Danny Kim Date: Mon, 11 Sep 2023 11:30:51 -0400 Subject: [PATCH 04/10] chore: remove /demo from scss folder --- packages/vanilla/src/sass/demo/_index.scss | 44 ---------------------- 1 file changed, 44 deletions(-) delete mode 100644 packages/vanilla/src/sass/demo/_index.scss diff --git a/packages/vanilla/src/sass/demo/_index.scss b/packages/vanilla/src/sass/demo/_index.scss deleted file mode 100644 index a9fc5f57..00000000 --- a/packages/vanilla/src/sass/demo/_index.scss +++ /dev/null @@ -1,44 +0,0 @@ -@use '../base/colors' as *; - -.demo-container { - align-items: center; - display: flex; - justify-content: center; - margin-top: 4rem; - margin-bottom: 6rem; -} - -.sandbox { - width: 100%; -} - -.sandbox__demo-container { - display: flex; -} - -.sandbox__demo { - align-items: center; - border: 2px solid $cbp-base-neutral-dark; - border-top-left-radius: 5px; - border-bottom-left-radius: 5px; - display: flex; - justify-content: center; - min-height: 24rem; - padding: 4rem 2rem; - width: 100%; -} - -.sandbox__modifiers { - border: 2px solid $cbp-base-neutral-dark; - border-left: 0; - border-top-right-radius: 5px; - border-bottom-right-radius: 5px; - width: 239px; - - & > h2 { - background: $cbp-base-neutral-lighter; - font-size: 1rem; - margin: 0; - padding: 1rem; - } -} \ No newline at end of file From 6bcf99329e857486f1dda32a524e718c64731c33 Mon Sep 17 00:00:00 2001 From: Danny Kim Date: Mon, 11 Sep 2023 14:10:54 -0400 Subject: [PATCH 05/10] chore: add margin utilities class table as docs --- .../src/stories/utilities/spacing.stories.mdx | 192 +++++++++++++++++- 1 file changed, 186 insertions(+), 6 deletions(-) diff --git a/packages/vanilla/src/stories/utilities/spacing.stories.mdx b/packages/vanilla/src/stories/utilities/spacing.stories.mdx index 129e0a8d..1a8e814e 100644 --- a/packages/vanilla/src/stories/utilities/spacing.stories.mdx +++ b/packages/vanilla/src/stories/utilities/spacing.stories.mdx @@ -9,10 +9,10 @@ They provide a convenient way to apply consistent and predefined spacing values ## Margin -
+

Margin Top

- +
@@ -24,12 +24,48 @@ They provide a convenient way to apply consistent and predefined spacing values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Utility Class.cbp-margin-top-0 `margin-top: 0 !important`
.cbp-margin-top-1x`margin-top: var(--cbp-space-1x) !important;`
.cbp-margin-top-2x`margin-top: var(--cbp-space-2x) !important;`
.cbp-margin-top-3x`margin-top: var(--cbp-space-3x) !important;`
.cbp-margin-top-4x`margin-top: var(--cbp-space-4x) !important;`
.cbp-margin-top-5x`margin-top: var(--cbp-space-5x) !important;`
.cbp-margin-top-6x`margin-top: var(--cbp-space-6x) !important;`
.cbp-margin-top-8x`margin-top: var(--cbp-space-8x) !important;`
.cbp-margin-top-12x`margin-top: var(--cbp-space-12x) !important;`
.cbp-margin-top-18x`margin-top: var(--cbp-space-18x) !important;`

Margin Bottom

- +
@@ -41,12 +77,48 @@ They provide a convenient way to apply consistent and predefined spacing values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Utility Class.cbp-margin-bottom-0 `margin-bottom: 0 !important`
.cbp-margin-bottom-1x`margin-bottom: var(--cbp-space-1x) !important;`
.cbp-margin-bottom-2x`margin-bottom: var(--cbp-space-2x) !important;`
.cbp-margin-bottom-3x`margin-bottom: var(--cbp-space-3x) !important;`
.cbp-margin-bottom-4x`margin-bottom: var(--cbp-space-4x) !important;`
.cbp-margin-bottom-5x`margin-bottom: var(--cbp-space-5x) !important;`
.cbp-margin-bottom-6x`margin-bottom: var(--cbp-space-6x) !important;`
.cbp-margin-bottom-8x`margin-bottom: var(--cbp-space-8x) !important;`
.cbp-margin-bottom-12x`margin-bottom: var(--cbp-space-12x) !important;`
.cbp-margin-bottom-18x`margin-bottom: var(--cbp-space-18x) !important;`

Margin Left

- +
@@ -58,12 +130,48 @@ They provide a convenient way to apply consistent and predefined spacing values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Utility Class.cbp-margin-left-0 `margin-left: 0 !important`
.cbp-margin-left-1x`margin-left: var(--cbp-space-1x) !important;`
.cbp-margin-left-2x`margin-left: var(--cbp-space-2x) !important;`
.cbp-margin-left-3x`margin-left: var(--cbp-space-3x) !important;`
.cbp-margin-left-4x`margin-left: var(--cbp-space-4x) !important;`
.cbp-margin-left-5x`margin-left: var(--cbp-space-5x) !important;`
.cbp-margin-left-6x`margin-left: var(--cbp-space-6x) !important;`
.cbp-margin-left-8x`margin-left: var(--cbp-space-8x) !important;`
.cbp-margin-left-12x`margin-left: var(--cbp-space-12x) !important;`
.cbp-margin-left-18x`margin-left: var(--cbp-space-18x) !important;`

Margin Right

- +
@@ -75,12 +183,48 @@ They provide a convenient way to apply consistent and predefined spacing values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Utility Class.cbp-margin-right-0 `margin-right: 0 !important`
.cbp-margin-right-1x`margin-right: var(--cbp-space-1x) !important;`
.cbp-margin-right-2x`margin-right: var(--cbp-space-2x) !important;`
.cbp-margin-right-3x`margin-right: var(--cbp-space-3x) !important;`
.cbp-margin-right-4x`margin-right: var(--cbp-space-4x) !important;`
.cbp-margin-right-5x`margin-right: var(--cbp-space-5x) !important;`
.cbp-margin-right-6x`margin-right: var(--cbp-space-6x) !important;`
.cbp-margin-right-8x`margin-right: var(--cbp-space-8x) !important;`
.cbp-margin-right-12x`margin-right: var(--cbp-space-12x) !important;`
.cbp-margin-right-18x`margin-right: var(--cbp-space-18x) !important;`

Margin

- +
@@ -92,6 +236,42 @@ They provide a convenient way to apply consistent and predefined spacing values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Utility Class.cbp-margin-0 `margin: 0 !important`
.cbp-margin-1x`margin: var(--cbp-space-1x) !important;`
.cbp-margin-2x`margin: var(--cbp-space-2x) !important;`
.cbp-margin-3x`margin: var(--cbp-space-3x) !important;`
.cbp-margin-4x`margin: var(--cbp-space-4x) !important;`
.cbp-margin-5x`margin: var(--cbp-space-5x) !important;`
.cbp-margin-6x`margin: var(--cbp-space-6x) !important;`
.cbp-margin-8x`margin: var(--cbp-space-8x) !important;`
.cbp-margin-12x`margin: var(--cbp-space-12x) !important;`
.cbp-margin-18x`margin: var(--cbp-space-18x) !important;`
From 1e33f623f58fcc695aa2bb82fbe39ca4378c3421 Mon Sep 17 00:00:00 2001 From: Danny Kim Date: Mon, 11 Sep 2023 14:13:43 -0400 Subject: [PATCH 06/10] chore: delete utilities doc.mdx --- packages/vanilla/src/stories/utilities/doc.stories.mdx | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 packages/vanilla/src/stories/utilities/doc.stories.mdx diff --git a/packages/vanilla/src/stories/utilities/doc.stories.mdx b/packages/vanilla/src/stories/utilities/doc.stories.mdx deleted file mode 100644 index e656e36c..00000000 --- a/packages/vanilla/src/stories/utilities/doc.stories.mdx +++ /dev/null @@ -1,7 +0,0 @@ -import { Meta } from '@storybook/addon-docs'; - - - -# Utilities - -Utility classes refer to small, reusable CSS classes that are designed to provide specific styling or functionality to HTML elements. From 1e35f6e4400b02de872365932dd47aa7f46cd450 Mon Sep 17 00:00:00 2001 From: Danny Kim Date: Mon, 11 Sep 2023 15:20:18 -0400 Subject: [PATCH 07/10] chore: add missing margin utility classes --- .../vanilla/src/sass/utilities/_spacing.scss | 9 + .../src/stories/utilities/spacing.stories.mdx | 320 +++++++++++++++--- 2 files changed, 279 insertions(+), 50 deletions(-) diff --git a/packages/vanilla/src/sass/utilities/_spacing.scss b/packages/vanilla/src/sass/utilities/_spacing.scss index 7bee7610..6ce829a3 100644 --- a/packages/vanilla/src/sass/utilities/_spacing.scss +++ b/packages/vanilla/src/sass/utilities/_spacing.scss @@ -4,14 +4,23 @@ $spacing: ( 16x: var(--cbp-space-16x), + 15x: var(--cbp-space-15x), + 14x: var(--cbp-space-14x), + 13x: var(--cbp-space-13x), 12x: var(--cbp-space-12x), + 11x: var(--cbp-space-11x), + 10x: var(--cbp-space-10x), + 9x: var(--cbp-space-9x), 8x: var(--cbp-space-8x), + 7x: var(--cbp-space-7x), 6x: var(--cbp-space-6x), 5x: var(--cbp-space-5x), 4x: var(--cbp-space-4x), 3x: var(--cbp-space-3x), 2x: var(--cbp-space-2x), 1x: var(--cbp-space-1x), + half-x: var(--cbp-space-half-x), + 1px: 1px, 0: 0 ); diff --git a/packages/vanilla/src/stories/utilities/spacing.stories.mdx b/packages/vanilla/src/stories/utilities/spacing.stories.mdx index 1a8e814e..40ed6e0b 100644 --- a/packages/vanilla/src/stories/utilities/spacing.stories.mdx +++ b/packages/vanilla/src/stories/utilities/spacing.stories.mdx @@ -21,43 +21,87 @@ They provide a convenient way to apply consistent and predefined spacing values - .cbp-margin-top-0 + cbp-margin-top-0 `margin-top: 0 !important` - .cbp-margin-top-1x + cbp-margin-top-1px + `margin-top: 1px !important` + + + cbp-margin-top-half-x + `margin-top: var(--cbp-space-half-x) !important` + + + cbp-margin-top-1x `margin-top: var(--cbp-space-1x) !important;` - .cbp-margin-top-2x + cbp-margin-top-2x `margin-top: var(--cbp-space-2x) !important;` - .cbp-margin-top-3x + cbp-margin-top-3x `margin-top: var(--cbp-space-3x) !important;` - .cbp-margin-top-4x + cbp-margin-top-4x `margin-top: var(--cbp-space-4x) !important;` - .cbp-margin-top-5x + cbp-margin-top-5x `margin-top: var(--cbp-space-5x) !important;` - .cbp-margin-top-6x + cbp-margin-top-6x `margin-top: var(--cbp-space-6x) !important;` - .cbp-margin-top-8x + cbp-margin-top-7x + `margin-top: var(--cbp-space-7x) !important;` + + + cbp-margin-top-8x `margin-top: var(--cbp-space-8x) !important;` - .cbp-margin-top-12x + cbp-margin-top-9x + `margin-top: var(--cbp-space-9x) !important;` + + + cbp-margin-top-10x + `margin-top: var(--cbp-space-10x) !important;` + + + cbp-margin-top-11x + `margin-top: var(--cbp-space-11x) !important;` + + + cbp-margin-top-12x `margin-top: var(--cbp-space-12x) !important;` - .cbp-margin-top-18x + cbp-margin-top-13x + `margin-top: var(--cbp-space-13x) !important;` + + + cbp-margin-top-14x + `margin-top: var(--cbp-space-14x) !important;` + + + cbp-margin-top-15x + `margin-top: var(--cbp-space-15x) !important;` + + + cbp-margin-top-16x + `margin-top: var(--cbp-space-16x) !important;` + + + cbp-margin-top-17x + `margin-top: var(--cbp-space-17x) !important;` + + + cbp-margin-top-18x `margin-top: var(--cbp-space-18x) !important;` @@ -74,43 +118,87 @@ They provide a convenient way to apply consistent and predefined spacing values - .cbp-margin-bottom-0 + cbp-margin-bottom-0 `margin-bottom: 0 !important` - .cbp-margin-bottom-1x + cbp-margin-bottom-1px + `margin-bottom: 1px !important` + + + cbp-margin-bottom-half-x + `margin-bottom: var(--cbp-space-half-x) !important` + + + cbp-margin-bottom-1x `margin-bottom: var(--cbp-space-1x) !important;` - .cbp-margin-bottom-2x + cbp-margin-bottom-2x `margin-bottom: var(--cbp-space-2x) !important;` - .cbp-margin-bottom-3x + cbp-margin-bottom-3x `margin-bottom: var(--cbp-space-3x) !important;` - .cbp-margin-bottom-4x + cbp-margin-bottom-4x `margin-bottom: var(--cbp-space-4x) !important;` - .cbp-margin-bottom-5x + cbp-margin-bottom-5x `margin-bottom: var(--cbp-space-5x) !important;` - .cbp-margin-bottom-6x + cbp-margin-bottom-6x `margin-bottom: var(--cbp-space-6x) !important;` - .cbp-margin-bottom-8x + cbp-margin-bottom-7x + `margin-bottom: var(--cbp-space-7x) !important;` + + + cbp-margin-bottom-8x `margin-bottom: var(--cbp-space-8x) !important;` - .cbp-margin-bottom-12x + cbp-margin-bottom-9x + `margin-bottom: var(--cbp-space-9x) !important;` + + + cbp-margin-bottom-10x + `margin-bottom: var(--cbp-space-10x) !important;` + + + cbp-margin-bottom-11x + `margin-bottom: var(--cbp-space-11x) !important;` + + + cbp-margin-bottom-12x `margin-bottom: var(--cbp-space-12x) !important;` - .cbp-margin-bottom-18x + cbp-margin-bottom-13x + `margin-bottom: var(--cbp-space-13x) !important;` + + + cbp-margin-bottom-14x + `margin-bottom: var(--cbp-space-14x) !important;` + + + cbp-margin-bottom-15x + `margin-bottom: var(--cbp-space-15x) !important;` + + + cbp-margin-bottom-16x + `margin-bottom: var(--cbp-space-16x) !important;` + + + cbp-margin-bottom-17x + `margin-bottom: var(--cbp-space-17x) !important;` + + + cbp-margin-bottom-18x `margin-bottom: var(--cbp-space-18x) !important;` @@ -127,43 +215,87 @@ They provide a convenient way to apply consistent and predefined spacing values - .cbp-margin-left-0 + cbp-margin-left-0 `margin-left: 0 !important` - .cbp-margin-left-1x + cbp-margin-left-1px + `margin-left: 1px !important` + + + cbp-margin-left-half-x + `margin-left: var(--cbp-space-half-x) !important` + + + cbp-margin-left-1x `margin-left: var(--cbp-space-1x) !important;` - .cbp-margin-left-2x + cbp-margin-left-2x `margin-left: var(--cbp-space-2x) !important;` - .cbp-margin-left-3x + cbp-margin-left-3x `margin-left: var(--cbp-space-3x) !important;` - .cbp-margin-left-4x + cbp-margin-left-4x `margin-left: var(--cbp-space-4x) !important;` - .cbp-margin-left-5x + cbp-margin-left-5x `margin-left: var(--cbp-space-5x) !important;` - .cbp-margin-left-6x + cbp-margin-left-6x `margin-left: var(--cbp-space-6x) !important;` - .cbp-margin-left-8x + cbp-margin-left-7x + `margin-left: var(--cbp-space-7x) !important;` + + + cbp-margin-left-8x `margin-left: var(--cbp-space-8x) !important;` - .cbp-margin-left-12x + cbp-margin-left-9x + `margin-left: var(--cbp-space-9x) !important;` + + + cbp-margin-left-10x + `margin-left: var(--cbp-space-10x) !important;` + + + cbp-margin-left-11x + `margin-left: var(--cbp-space-11x) !important;` + + + cbp-margin-left-12x `margin-left: var(--cbp-space-12x) !important;` - .cbp-margin-left-18x + cbp-margin-left-13x + `margin-left: var(--cbp-space-13x) !important;` + + + cbp-margin-left-14x + `margin-left: var(--cbp-space-14x) !important;` + + + cbp-margin-left-15x + `margin-left: var(--cbp-space-15x) !important;` + + + cbp-margin-left-16x + `margin-left: var(--cbp-space-16x) !important;` + + + cbp-margin-left-17x + `margin-left: var(--cbp-space-17x) !important;` + + + cbp-margin-left-18x `margin-left: var(--cbp-space-18x) !important;` @@ -180,43 +312,87 @@ They provide a convenient way to apply consistent and predefined spacing values - .cbp-margin-right-0 + cbp-margin-right-0 `margin-right: 0 !important` - .cbp-margin-right-1x + cbp-margin-right-1px + `margin-right: 1px !important` + + + cbp-margin-right-half-x + `margin-right: var(--cbp-space-half-x) !important` + + + cbp-margin-right-1x `margin-right: var(--cbp-space-1x) !important;` - .cbp-margin-right-2x + cbp-margin-right-2x `margin-right: var(--cbp-space-2x) !important;` - .cbp-margin-right-3x + cbp-margin-right-3x `margin-right: var(--cbp-space-3x) !important;` - .cbp-margin-right-4x + cbp-margin-right-4x `margin-right: var(--cbp-space-4x) !important;` - .cbp-margin-right-5x + cbp-margin-right-5x `margin-right: var(--cbp-space-5x) !important;` - .cbp-margin-right-6x + cbp-margin-right-6x `margin-right: var(--cbp-space-6x) !important;` - .cbp-margin-right-8x + cbp-margin-right-7x + `margin-right: var(--cbp-space-7x) !important;` + + + cbp-margin-right-8x `margin-right: var(--cbp-space-8x) !important;` - .cbp-margin-right-12x + cbp-margin-right-9x + `margin-right: var(--cbp-space-9x) !important;` + + + cbp-margin-right-10x + `margin-right: var(--cbp-space-10x) !important;` + + + cbp-margin-right-11x + `margin-right: var(--cbp-space-11x) !important;` + + + cbp-margin-right-12x `margin-right: var(--cbp-space-12x) !important;` - .cbp-margin-right-18x + cbp-margin-right-13x + `margin-top: var(--cbp-space-13x) !important;` + + + cbp-margin-right-14x + `margin-right: var(--cbp-space-14x) !important;` + + + cbp-margin-right-15x + `margin-right: var(--cbp-space-15x) !important;` + + + cbp-margin-right-16x + `margin-right: var(--cbp-space-16x) !important;` + + + cbp-margin-right-17x + `margin-right: var(--cbp-space-17x) !important;` + + + cbp-margin-right-18x `margin-right: var(--cbp-space-18x) !important;` @@ -233,43 +409,87 @@ They provide a convenient way to apply consistent and predefined spacing values - .cbp-margin-0 + cbp-margin-0 `margin: 0 !important` - .cbp-margin-1x + cbp-margin-1px + `margin: 1px !important` + + + cbp-margin-half-x + `margin: var(--cbp-space-half-x) !important` + + + cbp-margin-1x `margin: var(--cbp-space-1x) !important;` - .cbp-margin-2x + cbp-margin-2x `margin: var(--cbp-space-2x) !important;` - .cbp-margin-3x + cbp-margin-3x `margin: var(--cbp-space-3x) !important;` - .cbp-margin-4x + cbp-margin-4x `margin: var(--cbp-space-4x) !important;` - .cbp-margin-5x + cbp-margin-5x `margin: var(--cbp-space-5x) !important;` - .cbp-margin-6x + cbp-margin-6x `margin: var(--cbp-space-6x) !important;` - .cbp-margin-8x + cbp-margin-7x + `margin: var(--cbp-space-7x) !important;` + + + cbp-margin-8x `margin: var(--cbp-space-8x) !important;` - .cbp-margin-12x + cbp-margin-9x + `margin: var(--cbp-space-9x) !important;` + + + cbp-margin-10x + `margin: var(--cbp-space-10x) !important;` + + + cbp-margin-11x + `margin: var(--cbp-space-11x) !important;` + + + cbp-margin-12x `margin: var(--cbp-space-12x) !important;` - .cbp-margin-18x + cbp-margin-13x + `margin: var(--cbp-space-13x) !important;` + + + cbp-margin-14x + `margin: var(--cbp-space-14x) !important;` + + + cbp-margin-15x + `margin: var(--cbp-space-15x) !important;` + + + cbp-margin-16x + `margin: var(--cbp-space-16x) !important;` + + + cbp-margin-17x + `margin: var(--cbp-space-17x) !important;` + + + cbp-margin-18x `margin: var(--cbp-space-18x) !important;` From f1a33fff16b7ac5b2e8f089c5a760773b48f59fb Mon Sep 17 00:00:00 2001 From: Danny Kim Date: Tue, 12 Sep 2023 13:13:02 -0400 Subject: [PATCH 08/10] fix: removed important's from margin/padding utility classes --- .../vanilla/src/sass/utilities/_spacing.scss | 20 +- .../src/stories/utilities/spacing.stories.mdx | 430 ++++++++++++------ 2 files changed, 305 insertions(+), 145 deletions(-) diff --git a/packages/vanilla/src/sass/utilities/_spacing.scss b/packages/vanilla/src/sass/utilities/_spacing.scss index 6ce829a3..05b1eab9 100644 --- a/packages/vanilla/src/sass/utilities/_spacing.scss +++ b/packages/vanilla/src/sass/utilities/_spacing.scss @@ -26,44 +26,44 @@ $spacing: ( @each $name, $space in $spacing { .cbp-margin-#{$name} { - margin: #{$space} !important; + margin: #{$space}; } .cbp-margin-top-#{$name} { - margin-top: #{$space} !important;; + margin-top: #{$space}; } .cbp-margin-bottom-#{$name} { - margin-bottom: #{$space} !important;; + margin-bottom: #{$space}; } .cbp-margin-right-#{$name} { - margin-right: #{$space} !important;; + margin-right: #{$space}; } .cbp-margin-left-#{$name} { - margin-left: #{$space} !important;; + margin-left: #{$space}; } } @each $name, $space in $spacing { .cbp-padding-#{$name} { - padding: #{$space} !important;; + padding: #{$space}; } .cbp-padding-top-#{$name} { - padding-top: #{$space} !important;; + padding-top: #{$space}; } .cbp-padding-bottom-#{$name} { - padding-bottom: #{$space} !important;; + padding-bottom: #{$space}; } .cbp-padding-right-#{$name} { - padding-right: #{$space} !important;; + padding-right: #{$space}; } .cbp-padding-left-#{$name} { - padding-left: #{$space} !important;; + padding-left: #{$space}; } } diff --git a/packages/vanilla/src/stories/utilities/spacing.stories.mdx b/packages/vanilla/src/stories/utilities/spacing.stories.mdx index 40ed6e0b..624af64e 100644 --- a/packages/vanilla/src/stories/utilities/spacing.stories.mdx +++ b/packages/vanilla/src/stories/utilities/spacing.stories.mdx @@ -17,92 +17,124 @@ They provide a convenient way to apply consistent and predefined spacing values Utility Class CSS + Value (rem) + Pixel Translation (px) cbp-margin-top-0 - `margin-top: 0 !important` + `margin-top: 0` + `0` + `0` cbp-margin-top-1px - `margin-top: 1px !important` + `margin-top: 1px` + `1px` + `1px` cbp-margin-top-half-x - `margin-top: var(--cbp-space-half-x) !important` + `margin-top: var(--cbp-space-half-x)` + `0.125rem` + `0.5px` cbp-margin-top-1x - `margin-top: var(--cbp-space-1x) !important;` + `margin-top: var(--cbp-space-1x);` + `0.25rem` + `4px` cbp-margin-top-2x - `margin-top: var(--cbp-space-2x) !important;` + `margin-top: var(--cbp-space-2x);` + `0.5rem` + `8px` cbp-margin-top-3x - `margin-top: var(--cbp-space-3x) !important;` + `margin-top: var(--cbp-space-3x);` + `0.75rem` + `12px` cbp-margin-top-4x - `margin-top: var(--cbp-space-4x) !important;` + `margin-top: var(--cbp-space-4x);` + `1rem` + `16px` cbp-margin-top-5x - `margin-top: var(--cbp-space-5x) !important;` + `margin-top: var(--cbp-space-5x);` + `1.25rem` + `20px` cbp-margin-top-6x - `margin-top: var(--cbp-space-6x) !important;` + `margin-top: var(--cbp-space-6x);` + `1.5rem` + `24px` cbp-margin-top-7x - `margin-top: var(--cbp-space-7x) !important;` + `margin-top: var(--cbp-space-7x);` + `1.75rem` + `28px` cbp-margin-top-8x - `margin-top: var(--cbp-space-8x) !important;` + `margin-top: var(--cbp-space-8x);` + `2rem` + `32px` cbp-margin-top-9x - `margin-top: var(--cbp-space-9x) !important;` + `margin-top: var(--cbp-space-9x);` + `2.25rem` + `36px` cbp-margin-top-10x - `margin-top: var(--cbp-space-10x) !important;` + `margin-top: var(--cbp-space-10x);` + `2.5rem` + `40px` cbp-margin-top-11x - `margin-top: var(--cbp-space-11x) !important;` + `margin-top: var(--cbp-space-11x);` + `2.75rem` + `44px` cbp-margin-top-12x - `margin-top: var(--cbp-space-12x) !important;` + `margin-top: var(--cbp-space-12x);` + `3rem` + `48px` cbp-margin-top-13x - `margin-top: var(--cbp-space-13x) !important;` + `margin-top: var(--cbp-space-13x);` + `3.25rem` + `52px` cbp-margin-top-14x - `margin-top: var(--cbp-space-14x) !important;` + `margin-top: var(--cbp-space-14x);` + `3.5rem` + `56px` cbp-margin-top-15x - `margin-top: var(--cbp-space-15x) !important;` + `margin-top: var(--cbp-space-15x);` + `3.75rem` + `60px` cbp-margin-top-16x - `margin-top: var(--cbp-space-16x) !important;` - - - cbp-margin-top-17x - `margin-top: var(--cbp-space-17x) !important;` - - - cbp-margin-top-18x - `margin-top: var(--cbp-space-18x) !important;` + `margin-top: var(--cbp-space-16x);` + `4rem` + `64px` @@ -114,92 +146,124 @@ They provide a convenient way to apply consistent and predefined spacing values Utility Class CSS + Value (rem) + Pixel Translation (px) cbp-margin-bottom-0 - `margin-bottom: 0 !important` + `margin-bottom: 0` + `0` + `0` cbp-margin-bottom-1px - `margin-bottom: 1px !important` + `margin-bottom: 1px` + `1px` + `1px` cbp-margin-bottom-half-x - `margin-bottom: var(--cbp-space-half-x) !important` + `margin-bottom: var(--cbp-space-half-x)` + `0.125rem` + `0.5px` cbp-margin-bottom-1x - `margin-bottom: var(--cbp-space-1x) !important;` + `margin-bottom: var(--cbp-space-1x);` + `0.25rem` + `4px` cbp-margin-bottom-2x - `margin-bottom: var(--cbp-space-2x) !important;` + `margin-bottom: var(--cbp-space-2x);` + `0.5rem` + `8px` cbp-margin-bottom-3x - `margin-bottom: var(--cbp-space-3x) !important;` + `margin-bottom: var(--cbp-space-3x);` + `0.75rem` + `12px` cbp-margin-bottom-4x - `margin-bottom: var(--cbp-space-4x) !important;` + `margin-bottom: var(--cbp-space-4x);` + `1rem` + `16px` cbp-margin-bottom-5x - `margin-bottom: var(--cbp-space-5x) !important;` + `margin-bottom: var(--cbp-space-5x);` + `1.25rem` + `20px` cbp-margin-bottom-6x - `margin-bottom: var(--cbp-space-6x) !important;` + `margin-bottom: var(--cbp-space-6x);` + `1.5rem` + `24px` cbp-margin-bottom-7x - `margin-bottom: var(--cbp-space-7x) !important;` + `margin-bottom: var(--cbp-space-7x);` + `1.75rem` + `28px` cbp-margin-bottom-8x - `margin-bottom: var(--cbp-space-8x) !important;` + `margin-bottom: var(--cbp-space-8x);` + `2rem` + `32px` cbp-margin-bottom-9x - `margin-bottom: var(--cbp-space-9x) !important;` + `margin-bottom: var(--cbp-space-9x);` + `2.25rem` + `36px` cbp-margin-bottom-10x - `margin-bottom: var(--cbp-space-10x) !important;` + `margin-bottom: var(--cbp-space-10x);` + `2.5rem` + `40px` cbp-margin-bottom-11x - `margin-bottom: var(--cbp-space-11x) !important;` + `margin-bottom: var(--cbp-space-11x);` + `2.75rem` + `44px` cbp-margin-bottom-12x - `margin-bottom: var(--cbp-space-12x) !important;` + `margin-bottom: var(--cbp-space-12x);` + `3rem` + `48px` cbp-margin-bottom-13x - `margin-bottom: var(--cbp-space-13x) !important;` + `margin-bottom: var(--cbp-space-13x);` + `3.25rem` + `52px` cbp-margin-bottom-14x - `margin-bottom: var(--cbp-space-14x) !important;` + `margin-bottom: var(--cbp-space-14x);` + `3.5rem` + `56px` cbp-margin-bottom-15x - `margin-bottom: var(--cbp-space-15x) !important;` + `margin-bottom: var(--cbp-space-15x);` + `3.75rem` + `60px` cbp-margin-bottom-16x - `margin-bottom: var(--cbp-space-16x) !important;` - - - cbp-margin-bottom-17x - `margin-bottom: var(--cbp-space-17x) !important;` - - - cbp-margin-bottom-18x - `margin-bottom: var(--cbp-space-18x) !important;` + `margin-bottom: var(--cbp-space-16x);` + `4rem` + `64px` @@ -211,92 +275,124 @@ They provide a convenient way to apply consistent and predefined spacing values Utility Class CSS + Value (rem) + Pixel Translation (px) cbp-margin-left-0 - `margin-left: 0 !important` + `margin-left: 0` + `0` + `0` cbp-margin-left-1px - `margin-left: 1px !important` + `margin-left: 1px` + `1px` + `1px` cbp-margin-left-half-x - `margin-left: var(--cbp-space-half-x) !important` + `margin-left: var(--cbp-space-half-x)` + `0.125rem` + `0.5px` cbp-margin-left-1x - `margin-left: var(--cbp-space-1x) !important;` + `margin-left: var(--cbp-space-1x);` + `0.25rem` + `4px` cbp-margin-left-2x - `margin-left: var(--cbp-space-2x) !important;` + `margin-left: var(--cbp-space-2x);` + `0.5rem` + `8px` cbp-margin-left-3x - `margin-left: var(--cbp-space-3x) !important;` + `margin-left: var(--cbp-space-3x);` + `0.75rem` + `12px` cbp-margin-left-4x - `margin-left: var(--cbp-space-4x) !important;` + `margin-left: var(--cbp-space-4x);` + `1rem` + `16px` cbp-margin-left-5x - `margin-left: var(--cbp-space-5x) !important;` + `margin-left: var(--cbp-space-5x);` + `1.25rem` + `20px` cbp-margin-left-6x - `margin-left: var(--cbp-space-6x) !important;` + `margin-left: var(--cbp-space-6x);` + `1.5rem` + `24px` cbp-margin-left-7x - `margin-left: var(--cbp-space-7x) !important;` + `margin-left: var(--cbp-space-7x);` + `1.75rem` + `28px` cbp-margin-left-8x - `margin-left: var(--cbp-space-8x) !important;` + `margin-left: var(--cbp-space-8x);` + `2rem` + `32px` cbp-margin-left-9x - `margin-left: var(--cbp-space-9x) !important;` + `margin-left: var(--cbp-space-9x);` + `2.25rem` + `36px` cbp-margin-left-10x - `margin-left: var(--cbp-space-10x) !important;` + `margin-left: var(--cbp-space-10x);` + `2.5rem` + `40px` cbp-margin-left-11x - `margin-left: var(--cbp-space-11x) !important;` + `margin-left: var(--cbp-space-11x);` + `2.75rem` + `44px` cbp-margin-left-12x - `margin-left: var(--cbp-space-12x) !important;` + `margin-left: var(--cbp-space-12x);` + `3rem` + `48px` cbp-margin-left-13x - `margin-left: var(--cbp-space-13x) !important;` + `margin-left: var(--cbp-space-13x);` + `3.25rem` + `52px` cbp-margin-left-14x - `margin-left: var(--cbp-space-14x) !important;` + `margin-left: var(--cbp-space-14x);` + `3.5rem` + `56px` cbp-margin-left-15x - `margin-left: var(--cbp-space-15x) !important;` + `margin-left: var(--cbp-space-15x);` + `3.75rem` + `60px` cbp-margin-left-16x - `margin-left: var(--cbp-space-16x) !important;` - - - cbp-margin-left-17x - `margin-left: var(--cbp-space-17x) !important;` - - - cbp-margin-left-18x - `margin-left: var(--cbp-space-18x) !important;` + `margin-left: var(--cbp-space-16x);` + `4rem` + `64px` @@ -308,92 +404,124 @@ They provide a convenient way to apply consistent and predefined spacing values Utility Class CSS + Value (rem) + Pixel Translation (px) cbp-margin-right-0 - `margin-right: 0 !important` + `margin-right: 0` + `0` + `0` cbp-margin-right-1px - `margin-right: 1px !important` + `margin-right: 1px` + `1px` + `1px` cbp-margin-right-half-x - `margin-right: var(--cbp-space-half-x) !important` + `margin-right: var(--cbp-space-half-x)` + `0.125rem` + `0.5px` cbp-margin-right-1x - `margin-right: var(--cbp-space-1x) !important;` + `margin-right: var(--cbp-space-1x);` + `0.25rem` + `4px` cbp-margin-right-2x - `margin-right: var(--cbp-space-2x) !important;` + `margin-right: var(--cbp-space-2x);` + `0.5rem` + `8px` cbp-margin-right-3x - `margin-right: var(--cbp-space-3x) !important;` + `margin-right: var(--cbp-space-3x);` + `0.75rem` + `12px` cbp-margin-right-4x - `margin-right: var(--cbp-space-4x) !important;` + `margin-right: var(--cbp-space-4x);` + `1rem` + `16px` cbp-margin-right-5x - `margin-right: var(--cbp-space-5x) !important;` + `margin-right: var(--cbp-space-5x);` + `1.25rem` + `20px` cbp-margin-right-6x - `margin-right: var(--cbp-space-6x) !important;` + `margin-right: var(--cbp-space-6x);` + `1.5rem` + `24px` cbp-margin-right-7x - `margin-right: var(--cbp-space-7x) !important;` + `margin-right: var(--cbp-space-7x);` + `1.75rem` + `28px` cbp-margin-right-8x - `margin-right: var(--cbp-space-8x) !important;` + `margin-right: var(--cbp-space-8x);` + `2rem` + `32px` cbp-margin-right-9x - `margin-right: var(--cbp-space-9x) !important;` + `margin-right: var(--cbp-space-9x);` + `2.25rem` + `36px` cbp-margin-right-10x - `margin-right: var(--cbp-space-10x) !important;` + `margin-right: var(--cbp-space-10x);` + `2.5rem` + `40px` cbp-margin-right-11x - `margin-right: var(--cbp-space-11x) !important;` + `margin-right: var(--cbp-space-11x);` + `2.75rem` + `44px` cbp-margin-right-12x - `margin-right: var(--cbp-space-12x) !important;` + `margin-right: var(--cbp-space-12x);` + `3rem` + `48px` cbp-margin-right-13x - `margin-top: var(--cbp-space-13x) !important;` + `margin-top: var(--cbp-space-13x);` + `3.25rem` + `52px` cbp-margin-right-14x - `margin-right: var(--cbp-space-14x) !important;` + `margin-right: var(--cbp-space-14x);` + `3.5rem` + `56px` cbp-margin-right-15x - `margin-right: var(--cbp-space-15x) !important;` + `margin-right: var(--cbp-space-15x);` + `3.75rem` + `60px` cbp-margin-right-16x - `margin-right: var(--cbp-space-16x) !important;` - - - cbp-margin-right-17x - `margin-right: var(--cbp-space-17x) !important;` - - - cbp-margin-right-18x - `margin-right: var(--cbp-space-18x) !important;` + `margin-right: var(--cbp-space-16x);` + `4rem` + `64px` @@ -405,92 +533,124 @@ They provide a convenient way to apply consistent and predefined spacing values Utility Class CSS + Value (rem) + Pixel Translation (px) cbp-margin-0 - `margin: 0 !important` + `margin: 0` + `0` + `0` cbp-margin-1px - `margin: 1px !important` + `margin: 1px` + `1px` + `1px` cbp-margin-half-x - `margin: var(--cbp-space-half-x) !important` + `margin: var(--cbp-space-half-x)` + `0.125rem` + `0.5px` cbp-margin-1x - `margin: var(--cbp-space-1x) !important;` + `margin: var(--cbp-space-1x);` + `0.25rem` + `4px` cbp-margin-2x - `margin: var(--cbp-space-2x) !important;` + `margin: var(--cbp-space-2x);` + `0.5rem` + `8px` cbp-margin-3x - `margin: var(--cbp-space-3x) !important;` + `margin: var(--cbp-space-3x);` + `0.75rem` + `12px` cbp-margin-4x - `margin: var(--cbp-space-4x) !important;` + `margin: var(--cbp-space-4x);` + `1rem` + `16px` cbp-margin-5x - `margin: var(--cbp-space-5x) !important;` + `margin: var(--cbp-space-5x);` + `1.25rem` + `20px` cbp-margin-6x - `margin: var(--cbp-space-6x) !important;` + `margin: var(--cbp-space-6x);` + `1.5rem` + `24px` cbp-margin-7x - `margin: var(--cbp-space-7x) !important;` + `margin: var(--cbp-space-7x);` + `1.75rem` + `28px` cbp-margin-8x - `margin: var(--cbp-space-8x) !important;` + `margin: var(--cbp-space-8x);` + `2rem` + `32px` cbp-margin-9x - `margin: var(--cbp-space-9x) !important;` + `margin: var(--cbp-space-9x);` + `2.25rem` + `36px` cbp-margin-10x - `margin: var(--cbp-space-10x) !important;` + `margin: var(--cbp-space-10x);` + `2.5rem` + `40px` cbp-margin-11x - `margin: var(--cbp-space-11x) !important;` + `margin: var(--cbp-space-11x);` + `2.75rem` + `44px` cbp-margin-12x - `margin: var(--cbp-space-12x) !important;` + `margin: var(--cbp-space-12x);` + `3rem` + `48px` cbp-margin-13x - `margin: var(--cbp-space-13x) !important;` + `margin: var(--cbp-space-13x);` + `3.25rem` + `52px` cbp-margin-14x - `margin: var(--cbp-space-14x) !important;` + `margin: var(--cbp-space-14x);` + `3.5rem` + `56px` cbp-margin-15x - `margin: var(--cbp-space-15x) !important;` + `margin: var(--cbp-space-15x);` + `3.75rem` + `60px` cbp-margin-16x - `margin: var(--cbp-space-16x) !important;` - - - cbp-margin-17x - `margin: var(--cbp-space-17x) !important;` - - - cbp-margin-18x - `margin: var(--cbp-space-18x) !important;` + `margin: var(--cbp-space-16x);` + `4rem` + `64px` From a4f79dfdd17c69867dcfd79a4de58b3d0fc2d2c4 Mon Sep 17 00:00:00 2001 From: Danny Kim Date: Tue, 12 Sep 2023 13:59:24 -0400 Subject: [PATCH 09/10] chore: replace margin-top in correct table --- packages/vanilla/src/stories/utilities/spacing.stories.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vanilla/src/stories/utilities/spacing.stories.mdx b/packages/vanilla/src/stories/utilities/spacing.stories.mdx index 624af64e..483a3150 100644 --- a/packages/vanilla/src/stories/utilities/spacing.stories.mdx +++ b/packages/vanilla/src/stories/utilities/spacing.stories.mdx @@ -501,7 +501,7 @@ They provide a convenient way to apply consistent and predefined spacing values cbp-margin-right-13x - `margin-top: var(--cbp-space-13x);` + `margin-right: var(--cbp-space-13x);` `3.25rem` `52px` From 63bfd6e6684de8ba08d701b3eadc9a8ebb6307da Mon Sep 17 00:00:00 2001 From: Danny Kim Date: Tue, 12 Sep 2023 14:41:29 -0400 Subject: [PATCH 10/10] fix: px value for half-x --- .../vanilla/src/stories/utilities/spacing.stories.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/vanilla/src/stories/utilities/spacing.stories.mdx b/packages/vanilla/src/stories/utilities/spacing.stories.mdx index 483a3150..639fa4cd 100644 --- a/packages/vanilla/src/stories/utilities/spacing.stories.mdx +++ b/packages/vanilla/src/stories/utilities/spacing.stories.mdx @@ -38,7 +38,7 @@ They provide a convenient way to apply consistent and predefined spacing values cbp-margin-top-half-x `margin-top: var(--cbp-space-half-x)` `0.125rem` - `0.5px` + `2px` cbp-margin-top-1x @@ -167,7 +167,7 @@ They provide a convenient way to apply consistent and predefined spacing values cbp-margin-bottom-half-x `margin-bottom: var(--cbp-space-half-x)` `0.125rem` - `0.5px` + `2px` cbp-margin-bottom-1x @@ -296,7 +296,7 @@ They provide a convenient way to apply consistent and predefined spacing values cbp-margin-left-half-x `margin-left: var(--cbp-space-half-x)` `0.125rem` - `0.5px` + `2px` cbp-margin-left-1x @@ -425,7 +425,7 @@ They provide a convenient way to apply consistent and predefined spacing values cbp-margin-right-half-x `margin-right: var(--cbp-space-half-x)` `0.125rem` - `0.5px` + `2px` cbp-margin-right-1x @@ -554,7 +554,7 @@ They provide a convenient way to apply consistent and predefined spacing values cbp-margin-half-x `margin: var(--cbp-space-half-x)` `0.125rem` - `0.5px` + `2px` cbp-margin-1x