Skip to content

Commit

Permalink
Add multiple gap value to layout-* mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlaki committed Nov 29, 2023
1 parent d7071b2 commit 4745579
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion preview/assets/scss/component/_color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@use 'spruce' as *;

.colors {
@include layout-grid($minimum: 15rem);
@include layout-grid('s:m', $minimum: 15rem);
}

.color-item {
Expand Down
18 changes: 14 additions & 4 deletions scss/mixin/_layout.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@use 'sass:map';
@use 'sass:meta';
@use 'sass:string';
@use 'sass:list';
@use '../function' as *;
@use '../config' as *;

Expand All @@ -11,7 +13,9 @@
$gap: m,
$max-inline-size: config('container-inline-size', $layout)
) {
@if map.has-key($spacers, $gap) {
@if meta.type-of($gap) == string and string.index($gap, ':') {
$gap: spacer($gap);
} @else if map.has-key($spacers, $gap) {
$gap: map.get($spacers, $gap);
}

Expand All @@ -33,7 +37,9 @@
$align: none,
$important: false
) {
@if map.has-key($spacers, $gap) {
@if meta.type-of($gap) == string and string.index($gap, ':') {
$gap: spacer($gap);
} @else if map.has-key($spacers, $gap) {
$gap: map.get($spacers, $gap);
}

Expand Down Expand Up @@ -76,7 +82,9 @@
$gap: 'm',
$minimum: 12.5rem
) {
@if map.has-key($spacers, $gap) {
@if meta.type-of($gap) == string and string.index($gap, ':') {
$gap: spacer($gap);
} @else if map.has-key($spacers, $gap) {
$gap: map.get($spacers, $gap);
}

Expand All @@ -98,7 +106,9 @@
$gap: 'm',
$inline-size: 18.75rem
) {
@if map.has-key($spacers, $gap) {
@if meta.type-of($gap) == string and string.index($gap, ':') {
$gap: spacer($gap);
} @else if map.has-key($spacers, $gap) {
$gap: map.get($spacers, $gap);
}

Expand Down

0 comments on commit 4745579

Please sign in to comment.