Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • G Adams 2 posts 22 karma points
    Jul 22, 2015 @ 07:20
    G Adams
    0

    .less mixins transforms to empty file

    Hello thank you for this amazing piece of software, i have a slight problem with transforming specific .less files to Css


    here is the source file:

    /*---------------------------------------------------
        LESS Elements 0.9
      ---------------------------------------------------
        A set of useful LESS mixins
        More info at: http://lesselements.com
      ---------------------------------------------------*/
    
    .gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
      background: @color;
      background: -webkit-gradient(linear,
                                   left bottom,
                                   left top,
                                   color-stop(0, @start),
                                   color-stop(1, @stop));
      background: -ms-linear-gradient(bottom,
                                      @start,
                                      @stop);
      background: -moz-linear-gradient(center bottom,
                                       @start 0%,
                                       @stop 100%);
      background: -o-linear-gradient(@stop,
                                     @start);
      filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@stop,@start));
    }
    

    the result file includes only comments from source file:

     /*---------------------------------------------------
        LESS Elements 0.9
      ---------------------------------------------------
        A set of useful LESS mixins
        More info at: http://lesselements.com
      ---------------------------------------------------*/
    

    i have installed v8 addon without any luck, the system is installed on local server.

  • G Adams 2 posts 22 karma points
    Jul 22, 2015 @ 07:24
    G Adams
    0

    also it seeems that the problem is the local scope variable if i take @color , @start and @stop to global level it works.

  • Bijesh Tank 187 posts 414 karma points
    Jul 22, 2015 @ 08:39
    Bijesh Tank
    0

    Have you tried calling your mixin within another class?

    For example, my less file I have the following..

    .border-radius-custom (@topleft: 0px, @topright: 0px, @bottomleft: 0px, @bottomright: 0px) {
        -webkit-border-radius: @topleft @topright @bottomright @bottomleft !important;
        -moz-border-radius: @topleft @topright @bottomright @bottomleft !important;
        border-radius: @topleft @topright @bottomright @bottomleft !important;
    }
    
    .wrapperMain {
        position: relative;
        height:360px;
        .border-radius-custom;
    }
    

    I declare my mixin and then in my class .wrapperMain I call the mixin border-radius-custom.

    When the transform happens you will see something like this:

    .wrapperMain {
      position: relative;
      height: 218px;
      -webkit-border-radius: 0px !important;
      -moz-border-radius: 0px !important;
      border-radius: 0px !important;
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft