diff options
Diffstat (limited to 'src/_functions.scss')
| -rw-r--r-- | src/_functions.scss | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/_functions.scss b/src/_functions.scss index 2f34dc4..92ee262 100644 --- a/src/_functions.scss +++ b/src/_functions.scss | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | /// @access public | 9 | /// @access public |
| 10 | //// | 10 | //// |
| 11 | 11 | ||
| 12 | @use 'sass:math'; | ||
| 13 | |||
| 12 | /// | 14 | /// |
| 13 | /// Replace a substring with a new string. | 15 | /// Replace a substring with a new string. |
| 14 | /// | 16 | /// |
| @@ -303,19 +305,19 @@ | |||
| 303 | /// @return {number} Unit-less variable | 305 | /// @return {number} Unit-less variable |
| 304 | /// | 306 | /// |
| 305 | @function iro-strip-unit($n) { | 307 | @function iro-strip-unit($n) { |
| 306 | @return $n / ($n * 0 + 1); | 308 | @return math.div($n, $n * 0 + 1); |
| 307 | } | 309 | } |
| 308 | 310 | ||
| 309 | /// | 311 | /// |
| 310 | /// Convert a pixel value to a rem value. | 312 | /// Convert a pixel value to a rem value. |
| 311 | /// | 313 | /// |
| 312 | /// @param {number} $size - Pixel value to convert | 314 | /// @param {number} $size - Pixel value to convert |
| 313 | /// @param {number} $base [$iro-root-size] - Reference base font size used for conversion | 315 | /// @param {number} $base [$iro-root-size] - Reference base font size used for conversion |
| 314 | /// | 316 | /// |
| 315 | /// @return {number} Pixel value converted to rem | 317 | /// @return {number} Pixel value converted to rem |
| 316 | /// | 318 | /// |
| 317 | @function iro-px-to-rem($size, $base: $iro-root-size) { | 319 | @function iro-px-to-rem($size, $base: $iro-root-size) { |
| 318 | @return $size / $base * 1rem; | 320 | @return math.div($size, $base) * 1rem; |
| 319 | } | 321 | } |
| 320 | 322 | ||
| 321 | /// | 323 | /// |
