'Need some help converting to math.div
Does anyone have any ideas on how I can convert this to use math.div
@function ar($width, $height, $context: 100) {
@return #{$height / ($width / $context) + "%"};
}
I have an equation within an equation, and I thought maybe this
@function ar($width, $height, $context: 100) {
@return #{math.div($height, (#math.div($width, $context))) + "%"};
}
But this doesn't work, my output example should be 31.25%, but it's coming out as 5/0.16%. Could someone help me out and offer a little advice.
Solution 1:[1]
As pointed out by @JSON Derulo, this is the correct way to do it.
@return #{math.div($height, (math.div($width, $context))) + "%"};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Takuhii |
