diff options
Diffstat (limited to 'src/_harmony.scss')
-rw-r--r-- | src/_harmony.scss | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/_harmony.scss b/src/_harmony.scss index c3c8633..076fe55 100644 --- a/src/_harmony.scss +++ b/src/_harmony.scss | |||
@@ -8,6 +8,8 @@ | |||
8 | /// @access public | 8 | /// @access public |
9 | //// | 9 | //// |
10 | 10 | ||
11 | @use 'sass:math'; | ||
12 | |||
11 | /// | 13 | /// |
12 | /// Adjust a value to a modular scale. | 14 | /// Adjust a value to a modular scale. |
13 | /// | 15 | /// |
@@ -23,7 +25,7 @@ | |||
23 | /// | 25 | /// |
24 | @function iro-harmony-modular-scale($times, $base, $ratio) { | 26 | @function iro-harmony-modular-scale($times, $base, $ratio) { |
25 | @if type-of($base) == number { | 27 | @if type-of($base) == number { |
26 | @return $base * iro-math-pow($ratio, $times); | 28 | @return $base * math.pow($ratio, $times); |
27 | } | 29 | } |
28 | 30 | ||
29 | $main-base: nth($base, 1); | 31 | $main-base: nth($base, 1); |
@@ -32,7 +34,7 @@ | |||
32 | @each $b in iro-list-slice($base, 2) { | 34 | @each $b in iro-list-slice($base, 2) { |
33 | @if $b > $main-base { | 35 | @if $b > $main-base { |
34 | @while $b > $main-base { | 36 | @while $b > $main-base { |
35 | $b: $b / $ratio; | 37 | $b: math.div($b, $ratio); |
36 | } | 38 | } |
37 | $b: $b * $ratio; | 39 | $b: $b * $ratio; |
38 | } @else if $b < $main-base { | 40 | } @else if $b < $main-base { |
@@ -48,9 +50,9 @@ | |||
48 | $all-bases: iro-quicksort($all-bases); | 50 | $all-bases: iro-quicksort($all-bases); |
49 | 51 | ||
50 | $base-index: $times % length($all-bases) + 1; | 52 | $base-index: $times % length($all-bases) + 1; |
51 | $exp: floor($times / length($all-bases)); | 53 | $exp: math.floor(math.div($times, length($all-bases))); |
52 | 54 | ||
53 | @return nth($all-bases, $base-index) * iro-math-pow($ratio, $exp); | 55 | @return nth($all-bases, $base-index) * math.pow($ratio, $exp); |
54 | } | 56 | } |
55 | 57 | ||
56 | /// | 58 | /// |