Less CSS: Mixins with Variable Number of Arguments

后端 未结 6 924
醉梦人生
醉梦人生 2020-11-30 06:21

LESS allows parametric mixins, such as:

.transition(@property, @duration){
    transition:         @property @duration;
    -moz-transition:    @property @du         


        
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-30 07:22

    This should work, I think:

    .transition(...) {
        transition:         @arguments;
        -moz-transition:    @arguments; /* Firefox 4 */
        -webkit-transition: @arguments; /* Safari and Chrome */
        -o-transition:      @arguments; /* Opera */
    }
    

    ... - is a valid less syntax, not something to be replaced.

提交回复
热议问题