berfarah / LESS-build-sublime

Less build sytem for Sublime Text 2
Apache License 2.0
91 stars 14 forks source link

variable in mixin is not set properly in certain conditions #48

Open DavidKindler opened 10 years ago

DavidKindler commented 10 years ago

Create the following mixin and various classes:

.msopacity(@opacity:100 ) { -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=@{opacity})"; filter: alpha(opacity=@opacity); opacity:@opacity/100; }

.class1 { .msopacity; }

.class2 { .msopacity(65); }

.class3 { .msopacity(100); }

.class4 { .msopacity(0); }

This is the output:

.class1 { -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter: alpha(opacity=100); opacity: 1; } .class2 { -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=65)"; filter: alpha(opacity=100); opacity: 0.65; } .class3 { -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter: alpha(opacity=100); opacity: 1; } .class4 { -ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=100); opacity: 0; }

Notice that the opacity for the alpha filter is set to same value as the first class. It is never updated for the following classes. But the value is used for other attributes.

I tried this using the regular less compiler and this did not occur so it seems like something in this plugin.