madskristensen / CssAutoPrefixer

A Visual Studio extension
Other
4 stars 1 forks source link

Syntax error using LESS mixins #4

Open jonascarlbaum opened 7 years ago

jonascarlbaum commented 7 years ago

Installed product versions

Description

Using Autoprefix-option in a LESS file with internal mixins won't work, since there will be a syntax error.

2017-08-22 16:42:08: × Processing stdin

× Syntax Error: stdin

 [105:13] Unknown word

   103 |     a.gl-hand {
  104 |         span {
> 105 |             .halloween-button();
      |             ^
  106 |         }
  107 |  

Steps to recreate

  1. Create a less file with the following content
@halloween-orange: #FF9E16;
@halloween-black: #1D1D1B;
@halloween-lightgray: #C6C5BA;
@white: #fff;

.halloween-button(@show-pointer: false) when (@show-pointer = false) {
    background-color: @halloween-orange;
    color: @halloween-black;
    border-radius: 4px;
    color: @halloween-black !important;
    transition: all 0.5s ease-in-out;

    &:hover {
        background-color: lighten(@halloween-orange, 10%);
    }

    .pointer {
        display: none;
    }
}

.halloween-button(@show-pointer: false) when (@show-pointer = true) {
    background: url('/Content/Images/themes/halloween/halloween-theme-hand.png') no-repeat;
    width: 239px;
    max-width: none;
    min-width: initial;
    padding: 5px 86px 33px 12px !important;
    color: @white !important;

    .arrow-text {
        height: 1em !important;
        overflow: hidden;
        display: block;
        color: inherit;
        text-align: center !important;
    }
}
/*#endregion */

body.halloween-theme {
    a.gl-hand {
        span {
            .halloween-button();
        }
    }
}
  1. Right-click in the editor, and left-click on "Autoprefix"

Current behavior

It won't create autoprefixes, since there will be a syntax error.

Expected behavior

It would create autoprefixes where appropriate.