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.

1 Answer 1

5

Try .foo(~"red"); might work...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.