LESS mixin - Output values without quotes

前端 未结 1 1310
天涯浪人
天涯浪人 2020-12-06 22:37

I am trying to write a LESS mixin with multiple input parameter values for CSS transforms. The input values are the type of transformation to be done and the value associate

相关标签:
1条回答
  • 2020-12-06 23:41

    Just escape the string using ~ like shown below. Doing this would make sure that the quotes are not printed in the output CSS.

    Input Code:

    transform: ~"@{type}(@{value})";
    

    or

    transform: e("@{type}(@{value})");
    

    Mixin Call:

    .transform(rotateY;360deg);
    

    Output CSS:

    transform: rotateY(360deg);
    
    0 讨论(0)
提交回复
热议问题