Multiple properties are getting treated as separate arguments in mixins

后端 未结 4 1627
北海茫月
北海茫月 2020-12-03 05:31

I\'m trying to write a mixin, but I can\'t seem to get the arguments working the way I want: multiple properties are getting treated each as a separate argument.

Cu

4条回答
  •  鱼传尺愫
    2020-12-03 06:08

    I'd suggest using LESS's escape function, i.e.:

    a:link, a:visited { 
        color: green;
        opacity: .5;
        font-size: 1em;
    }
    
    a:hover {
        color: red;
        opacity: 1;
        font-size: 2em;
        .transition(e("font-size, color"));
    }
    

    And though it seems that LESS accepts that, it will only animate the last property in the comma-separated string you send through. A pity.

提交回复
热议问题