Skip to content

Commit

Permalink
fix: use sass math.div instead of simple paren
Browse files Browse the repository at this point in the history
  • Loading branch information
Borderliner committed Nov 24, 2023
1 parent 5055081 commit 1ae81b6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/scss/utils/functions/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
// Now we divide it to 12, to use a 12th-width grid.
// Also, 2/3 means 0.666667, which is a number decreased or added to the result
// of 96/12 to balance everything.
@use 'sass:math';

@function column-width($part) {
@if $part >= 1 and $part < 6 {
$size: (((96 / 12) * $part) - ((6 - $part) * (2 / 3)));
@return percentage($size / 100);
$size: ((math.div(96, 12) * $part) - ((6 - $part) * math.div(2, 3)));
@return percentage(calc($size / 100));
}

@else if $part >= 6 and $part < 12 {
$size: (((96 / 12) * $part) + (($part - 6) * (2 / 3)));
@return percentage($size / 100);
$size: ((math.div(96, 12) * $part) + (($part - 6) * math.div(2, 3)));
@return percentage(math.div($size, 100));
}
}

@function offset-column-margin($part) {
$size: ((96 / 12) * $part) + ($part * (2 / 3));
@return percentage($size / 100);
$size: (math.div(96, 12) * $part) + ($part * math.div(2, 3));
@return percentage(math.div($size, 100));
}

0 comments on commit 1ae81b6

Please sign in to comment.