1

Basically I want to use a string that may contain keywords like 'red','green' or 'blue'. However LESS converts it to hex values like #ff0000 instead of red.


Example

.foo(@className) {
    .bar_@{className} { color: white; }
}

Using the mixin

.foo(red);

should output

.bar_red { color: white; }

but instead it shows

.bar_#ff0000 { color: white; }

How do I escape or cast the parameter as a string? Thanks.

4

1 回答 1

5

试试.foo(~"red");可能有用...

于 2013-11-01T03:30:22.823 回答