-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update override classes * Refactor space generators * Lint * Allow former class of tna-visually-hidden * Use tna-visually-hidden by default * Add mobile overrides story
- Loading branch information
Showing
11 changed files
with
188 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,32 @@ | ||
@use "../variables/spacing"; | ||
@use "sass:map"; | ||
@use "../tools/media"; | ||
@use "../tools/spacing"; | ||
|
||
@mixin no-spacing-generator($suffix: "") { | ||
@if $suffix != "" { | ||
$suffix: "-" + $suffix; | ||
} | ||
|
||
@each $property in margin, padding { | ||
@each $direction in top, bottom { | ||
.tna-\!--no-#{$property}-#{$direction}#{$suffix}, | ||
.tna-\!--no-#{$property}-vertical#{$suffix} { | ||
#{$property}-#{$direction}: 0 !important; | ||
} | ||
} | ||
@mixin hide-on($suffix) { | ||
.tna-\!--hide-on-#{$suffix} { | ||
display: none; | ||
} | ||
} | ||
|
||
@mixin overrides($spacing, $suffix: "") { | ||
@if $suffix != "" { | ||
$suffix: "-" + $suffix; | ||
} | ||
@include spacing.no-spacing-generator; | ||
@include spacing.spacing-generator; | ||
|
||
@each $property in margin, padding { | ||
@each $direction in top, bottom { | ||
@each $size, $amount in $spacing { | ||
.tna-\!--#{$property}-#{$direction}-#{$size}#{$suffix}, | ||
.tna-\!--#{$property}-vertical-#{$size}#{$suffix} { | ||
#{$property}-#{$direction}: #{$amount} !important; | ||
} | ||
} | ||
} | ||
} | ||
@include media.on-large { | ||
@include spacing.no-spacing-generator("large"); | ||
@include hide-on("large"); | ||
} | ||
|
||
@include no-spacing-generator; | ||
@include overrides(spacing.$spacing); | ||
|
||
@include media.on-medium { | ||
@include no-spacing-generator("medium"); | ||
@include overrides(spacing.$spacing, "medium"); | ||
@include spacing.no-spacing-generator("medium"); | ||
@include hide-on("medium"); | ||
} | ||
|
||
@include media.on-small { | ||
@include no-spacing-generator("small"); | ||
@include overrides(spacing.$spacing-mobile, "small"); | ||
@include spacing.no-spacing-generator("small"); | ||
@include hide-on("small"); | ||
} | ||
|
||
@include media.on-tiny { | ||
@include no-spacing-generator("tiny"); | ||
@include overrides(spacing.$spacing-mobile, "tiny"); | ||
@include spacing.no-spacing-generator("tiny"); | ||
@include hide-on("tiny"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
@use "sass:map"; | ||
|
||
$spacing: ( | ||
"xs": 0.5rem, | ||
"s": 1rem, | ||
"m": 2rem, | ||
"l": 3rem, | ||
"xl": 5rem, | ||
"xxl": 8rem, | ||
); | ||
) !default; | ||
|
||
$spacing-mobile: ( | ||
"xs": 0.5rem, | ||
"s": 0.75rem, | ||
"m": 1.5rem, | ||
"l": 2rem, | ||
"xl": 3rem, | ||
"xxl": 5rem, | ||
); | ||
$spacing-mobile: map.merge( | ||
$spacing, | ||
( | ||
"xs": 0.5rem, | ||
"s": 0.75rem, | ||
"m": 1.5rem, | ||
"l": 2rem, | ||
"xl": 3rem, | ||
"xxl": 5rem, | ||
) | ||
) !default; |