3

How can I access typescript variable in scss. I attached the code. I will appreciate any help.

#someselector {
  @include somemixin($someargument: $valuefromtypescript);
  background:blue;
}

1 Answer 1

3

This is not possible. TypeScript variables are evaluated during runtime. SCSS compiles to CSS during compile time.

The only thing that you can do is use your TypeScript variables and append classes to your DOM depending on the variable value. But that is a completely different approach.

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.