Created
February 17, 2022 18:19
-
-
Save napotopia/fff3b346f770bed462a16921e3da6c96 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@use "sass:math"; | |
@use "sass:map"; | |
@function round-decimal($n: 0, $decimals: 1) { | |
$precision: 1; | |
@if $decimals > 0 { | |
@for $i from 1 through $decimals { | |
$precision: $precision * 10; | |
} | |
} | |
$rounded: math.round($n * $precision) / $precision; | |
@return $rounded; | |
} | |
.foo { | |
font-size: round-decimal(1.19); | |
} | |
.bar { | |
font-size: round-decimal(1.3456, 2); | |
} | |
.baz { | |
font-size: round-decimal(1.56456, 3); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.foo { | |
font-size: 1.2; | |
} | |
.bar { | |
font-size: 1.35; | |
} | |
.baz { | |
font-size: 1.565; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sass": { | |
"compiler": "dart-sass/1.32.12", | |
"extensions": {}, | |
"syntax": "SCSS", | |
"outputStyle": "expanded" | |
}, | |
"autoprefixer": false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment