From 4ec6225a9273b8f0c93e4b3d93ecf1e1686b719c Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 4 Feb 2022 20:28:18 +0100 Subject: Fix errors from transition from node-sass to sass --- test/_harmony.scss | 16 +++++++++------- test/_math.scss | 21 --------------------- test/_responsive.scss | 4 ++-- test/test.scss | 1 - 4 files changed, 11 insertions(+), 31 deletions(-) delete mode 100644 test/_math.scss (limited to 'test') diff --git a/test/_harmony.scss b/test/_harmony.scss index 25560f0..7945be1 100644 --- a/test/_harmony.scss +++ b/test/_harmony.scss @@ -1,5 +1,7 @@ +@use 'sass:math'; + @function _limit-decimals($n) { - @return floor($n * 1000) / 1000; + @return math.div(math.floor($n * 1000), 1000); } @include describe('Harmony') { @@ -47,7 +49,7 @@ font-size: 1rem; @media (min-width: 320px) and (max-width: 640px) { - font-size: calc(1rem + 0 * ((100vw - #{$rem320px}) / #{$diff320px})); + font-size: calc(1rem + 0 * (100vw - #{$rem320px}) / #{$diff320px}); } @media (min-width: 640px) { @@ -59,7 +61,7 @@ font-size: 1.1rem; @media (min-width: 320px) and (max-width: 640px) { - font-size: calc(1.1rem + 0.1 * ((100vw - #{$rem320px}) / #{$diff320px})); + font-size: calc(1.1rem + 0.1 * (100vw - #{$rem320px}) / #{$diff320px}); } @media (min-width: 640px) { @@ -71,7 +73,7 @@ font-size: 1.21rem; @media (min-width: 320px) and (max-width: 640px) { - font-size: calc(1.21rem + 0.23 * ((100vw - #{$rem320px}) / #{$diff320px})); + font-size: calc(1.21rem + 0.23 * (100vw - #{$rem320px}) / #{$diff320px}); } @media (min-width: 640px) { @@ -161,7 +163,7 @@ font-size: 1rem; @media (min-width: 320px) and (max-width: 640px) { - font-size: calc(1rem + 0 * ((100vw - #{$rem320px}) / #{$diff320px})); + font-size: calc(1rem + 0 * (100vw - #{$rem320px}) / #{$diff320px}); } @media (min-width: 640px) { @@ -173,7 +175,7 @@ font-size: 1.0263162365rem; @media (min-width: 320px) and (max-width: 640px) { - font-size: calc(1.0263162365rem + 0.1310911709 * ((100vw - #{$rem320px}) / #{$diff320px})); + font-size: calc(1.0263162365rem + 0.1310911709 * (100vw - #{$rem320px}) / #{$diff320px}); } @media (min-width: 640px) { @@ -185,7 +187,7 @@ font-size: 1.1rem; @media (min-width: 320px) and (max-width: 640px) { - font-size: calc(1.1rem + 0.1 * ((100vw - #{$rem320px}) / #{$diff320px})); + font-size: calc(1.1rem + 0.1 * (100vw - #{$rem320px}) / #{$diff320px}); } @media (min-width: 640px) { diff --git a/test/_math.scss b/test/_math.scss deleted file mode 100644 index 5f40499..0000000 --- a/test/_math.scss +++ /dev/null @@ -1,21 +0,0 @@ -// sass-lint:disable empty-args - -@include describe('Math') { - @include it('iro-math-pow') { - @include assert-equal(iro-math-pow(2, 2), 2 * 2, '2^2'); - @include assert-equal(iro-math-pow(2, 3), 2 * 2 * 2, '2^3'); - @include assert-equal(iro-math-pow(4, 3), 4 * 4 * 4, '4^3'); - @include assert-equal(iro-math-pow(3, -1), 1 / 3, '3^(-1)'); - @include assert-equal(iro-math-pow(4, -2), 1 / (4 * 4), '4^(-2)'); - @include assert-equal(iro-math-pow(3, 0), 1, '3^0'); - } - - @include it('iro-math-clamp') { - @include assert-equal(iro-math-clamp(0, 0, 10), 0, '0 in [0, 10]'); - @include assert-equal(iro-math-clamp(10, 0, 10), 10, '10 in [0, 10]'); - @include assert-equal(iro-math-clamp(20, 0, 10), 10, '20 in [0, 10]'); - @include assert-equal(iro-math-clamp(3, 10, 20), 10, '3 in [10, 20]'); - @include assert-equal(iro-math-clamp(-5, -30, -10), -10, '-5 in [-30, -10]'); - @include assert-equal(iro-math-clamp(-5, -30, -2), -5, '-5 in [-30, -2]'); - } -} diff --git a/test/_responsive.scss b/test/_responsive.scss index cdda40c..6dfe868 100644 --- a/test/_responsive.scss +++ b/test/_responsive.scss @@ -3,7 +3,7 @@ $rem600px: iro-px-to-rem(600px); $rem800px: iro-px-to-rem(800px); - @include assert-equal(iro-responsive-fluid-calc(2rem, 4rem, 600px, 800px), 'calc(2rem + 2 * ((100vw - #{$rem600px}) / #{iro-strip-unit($rem800px - $rem600px)}))', 'Responsive value from 2rem to 4rem over 600px to 800px'); - @include assert-equal(iro-responsive-fluid-calc(4px, 12px, 600px, 800px), 'calc(4px + 8 * ((100vw - 600px) / 200))', 'Responsive value from 4px to 12px over 600px to 800px'); + @include assert-equal('#{iro-responsive-fluid-calc(2rem, 4rem, 600px, 800px)}', 'calc(2rem + 2 * (100vw - #{$rem600px}) / #{iro-strip-unit($rem800px - $rem600px)})', 'Responsive value from 2rem to 4rem over 600px to 800px'); + @include assert-equal('#{iro-responsive-fluid-calc(4px, 12px, 600px, 800px)}', 'calc(4px + 8 * (100vw - 600px) / 200)', 'Responsive value from 4px to 12px over 600px to 800px'); } } diff --git a/test/test.scss b/test/test.scss index 9e3cf6b..86c86e9 100644 --- a/test/test.scss +++ b/test/test.scss @@ -5,7 +5,6 @@ $iro-easing-gradient-steps: 4; @import 'functions'; -@import 'math'; @import 'contexts'; @import 'bem'; @import 'responsive'; -- cgit v1.2.3-54-g00ecf