How to set keyframes name in LESS

前端 未结 6 1163
别那么骄傲
别那么骄傲 2020-12-09 15:37

I try to set up this LESS mixin for CSS animation keyframes:

.keyframes(@name, @from, @to) {;
  @-webkit-keyframes \"@name\" {
    from {
      @from;  
             


        
6条回答
  •  無奈伤痛
    2020-12-09 16:24

    How about this:

    @-webkit-keyframes some-animation {.mixi-frames;}
    @-moz-keyframes some-animation {.mixi-frames;}
    @-ms-keyframes some-animation {.mixi-frames;}
    @-o-keyframes some-animation {.mixi-frames;}
    @keyframes some-animation {.mixi-frames;}
    
    .mixi-frames () {
        from {width: 254px;}
        to {width: 512px;}
    }
    

    You need to do it for each animation. Taken from: http://radiatingstar.com/css-keyframes-animations-with-less

提交回复
热议问题