Skip to content

Commit

Permalink
fixup! fixup! Feat(web): Add spacing property to Grid #DS-1388
Browse files Browse the repository at this point in the history
  • Loading branch information
dlouhak committed Jul 25, 2024
1 parent d3d6294 commit 6f8ff7c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions packages/web/src/scss/components/Grid/_Grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@
@include tools.gutters(theme.$grid-gutters, theme.$breakpoints);
}

// stylelint-disable-next-line selector-max-universal -- Let's be bold and reset spacing for all direct descendants regardless of their type.
.Grid > * {
@each $breakpoint-name, $breakpoint-value in theme.$breakpoints {
@if $breakpoint-value > 0 {
--grid-spacing-x-#{$breakpoint-name}: initial;
--grid-spacing-y-#{$breakpoint-name}: initial;
} @else {
--grid-spacing-x: initial;
--grid-spacing-y: initial;
}
}
}

@include tools.equal-columns(theme.$grid-equal-columns, theme.$breakpoints);

@include tools.item(theme.$breakpoints);
6 changes: 3 additions & 3 deletions packages/web/src/scss/components/Grid/_tools.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
$row-property-name: --grid-spacing-y;
// stylelint-enable

$column-fallback: map.get($gutters, 'mobile');
$row-fallback: map.get($gutters, 'mobile');

@each $breakpoint-name, $breakpoint-value in $breakpoints {
$column-fallback: map.get($gutters, $breakpoint-name);
$row-fallback: map.get($gutters, $breakpoint-name);

@if not map.has-key($gutters, $breakpoint-name) {
@error 'Invalid breakpoint specified! #{$breakpoint-name} doesn\'t exist. Use one of #{map.keys($breakpoints)}';
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6f8ff7c

Please sign in to comment.