2

I'm sure this is an easy one, but I can't get this to work. Essentially I am building a style guide to make work with designer/developer a bit easier. What I am trying to accomplish is this,

I have a pallet full of blocks, whose background color is generated on the fly by LESS using mixins. I'd like to be able to output the value which was generated by the mixin, and append it to the objects using the CSS pseudo element before.

Here is my code:

@defaultPrimaryColor : #f00;
#block1{ background-color: darken( @defaultPrimaryColor, 20%);  } //should output #990000;
#block1:before{ 
    @color : darken(@defaultPrimaryColor, 20%);
    content: e(%("%s"),@color);  // doesn't work
        content: @color; // doesn't work
}

Any suggestions would be greatly appreciated. I looked on the website, but was unable to find a solution.

Thanks!

1 Answer 1

2

Try this:

content: "@{color}";
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.