Less.js has an interesting feature where you can reference javascript and evaluate CSS based on this, eg:
@color: ~`window.main_color`;
.test {
background-color: @color;
}
Is there something similar for Sass?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No as Sass is evaluated before sending to client. Less can be send as is and evaluate on client side, and then you can evaluate JS like
window.main_color. But IMHO it’s bad idee because it can provide some WTF when someone display it.