Skip to content

Commit

Permalink
add ds-grid function
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidstumple committed Oct 30, 2024
1 parent 167b584 commit 8ad1dd2
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions template/src/assets/scss/tools/_index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
@import "../color/index.scss";
@import '../variables/index.scss';
@import '~matise-gryd/gryd-index.scss';

$design-size: 1440;
$col: $design-size / 24;

@function max-grid($value) {
$values: null;
@if length($value) > 1 {
@each $size in $value {
$v: rem((math.div($size, $design-size) * $max-size));
$values: $values #{$v};
}
} @else {
$values: rem((math.div($value, $design-size) * $max-size));
}
@return $values;
}

// Design size grid
@function ds-grid($design-px) {
$values: null;
@if length($design-px) > 1 {
@each $size in $design-px {
$v: grid(math.div($size, $col));
$values: $values #{$v};
}
} @else {
$values: grid(math.div($design-px, $col));
}
@return $values;
}

0 comments on commit 8ad1dd2

Please sign in to comment.