Open StudioSpindle opened 2 years ago
Possible approach
Make the code generate:
@use 'sass:math';
@mixin text-crop(...) {
// ...
$dynamic-top-crop: math.div(max(($top-crop + ($line-height - $crop-line-height) * ($crop-font-size * 0.5)), 0), $crop-font-size);
$dynamic-bottom-crop: math.div(max(($bottom-crop + ($line-height - $crop-line-height) * ($crop-font-size * 0.5)), 0), $crop-font-size);
// ...
Possible downsides:
@use
rule has been implemented in Sass since 1.23.0. This will make the code snippet not applicable for versions prior to 1.23.0.
Using the tool on the website generates:
Using this code will generate:
source: https://sass-lang.com/documentation/breaking-changes/slash-div
Recommended is to "...switch all division to use math.div() instead."