Click here to Skip to main content
15,891,942 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have the following less definition

CSS
.gradient(@from, @to) {
    background-color: @from;
    filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr='@{from}',endColorstr='@{to}')";
    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(@from), to(@to));
    background-image: -webkit-linear-gradient(top, @from, @to);
    background-image: -moz-linear-gradient(top, @from, @to);
    background-image: -ms-linear-gradient(top, @from, @to);
    background-image: -o-linear-gradient(top, @from, @to);
}


I'm including it in the following style:

CSS
div.contentContainerForm {
    position: absolute;
    top: 80px;
    bottom: 15px;
    width: 100%;
    overflow: hidden;
    .gradient(#f0f0f0, #e0e0e0);
}


But I'm getting the following output when the css is generated:

CSS
div.contentContainerForm {
  position: absolute;
  top: 80px;
  bottom: 15px;
  width: 100%;
  overflow: hidden;
  background-color: #f0f0f0;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@from', endColorstr='@to');
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f0f0f0), to(#e0e0e0));
  background-image: -webkit-linear-gradient(top, #f0f0f0, #e0e0e0);
  background-image: -moz-linear-gradient(top, #f0f0f0, #e0e0e0);
  background-image: -ms-linear-gradient(top, #f0f0f0, #e0e0e0);
  background-image: -o-linear-gradient(top, #f0f0f0, #e0e0e0);
}


The problem is the failure to output the @from and @to variables for the filter property.

Any thoughts?
Posted
Updated 31-Oct-13 2:58am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900