I use SCSS and have 2 functions:
@function get-size-in-units($size, $unit: px) {
@return #{$size}#{$unit};
}
@function get-container-size($side) {
@return math.ceil(math.sqrt(2 * math.pow($side, 2)));
}
And now i use it like this:
get-size-in-units(get-container-size(40));
Now I have a need for the function get-container-size
to work with string value. I mean I want to call it with '40px'
, '40rem'
and etc, not with 40
How can i do this?