less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17.03k stars 3.4k forks source link

Inline variables in curly braces @{} get cached and don't update #836

Closed MikeBagos closed 12 years ago

MikeBagos commented 12 years ago

Consider the code:

@border-color: #B2B;

.testme(@culprit: @border-color)
{
   filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@{culprit}', endColorstr='@{culprit}'); // IE
}

.la {
    .testme();
}

.la2 {
    .testme(#FF0000);
}

.la3 {
    .testme(#FF0110);
}

This will wield:

.la {
  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#bb22bb', endColorstr='#bb22bb');
}
.la2 {
  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#bb22bb', endColorstr='#bb22bb');
}
.la3 {
  filter: progid:dximagetransform.microsoft.gradient(startColorstr='#bb22bb', endColorstr='#bb22bb');
}

Which is incorrect, because the color does not update!

lukeapage commented 12 years ago

duplicate of #534

Its actualy not string interpolation but use of the filter function... wrap the whole value in ~"" and I guess it will go away