Is it possible to have SCSS render a transform property like rotate()
with a dynamic variable? To be clear, I'm NOT asking how to create a dynamic mixin or variable. I'm asking the appropriate way to interpolate transform properties like rotate()
and not lose the brackets.
For example, albeit contrived, I'd like to do something like:
@mixin dynamic-var($target, $property, $val) {
.class {
$target: $property($val * 10);
}
}
@include dynamic-var('transform', 'rotate', '36deg');
To produce:
.class { transform: rotate(360deg); }