Use math.div for division in scss

https://sass-lang.com/d/slash-div
This commit is contained in:
Alex Gleason 2021-09-16 11:30:34 -05:00
parent 4cac9ab1c3
commit 1b1ef51778
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -1,3 +1,5 @@
@use 'sass:math';
// OpenDyslexic
@font-face {
font-family: 'OpenDyslexic';
@ -46,14 +48,14 @@
// html and body declaration allows developer to pass px value as argument
// Rendered css will default to "rem" and fall back to "px" for unsupported browsers
@mixin font-size($size) {
$rem: ($size / 10);
$rem: math.div($size, 10);
$px: $size;
font-size: #{$px + "px"};
font-size: #{$rem + "rem"};
}
@mixin line-height($size) {
$rem: ($size / 10);
$rem: math.div($size, 10);
$px: $size;
line-height: #{$px + "px"};
line-height: #{$rem + "rem"};