0

I set up my project as Less in Angular to use the benefits of variables and such in my CSS. But the problem is that I have to define those variables in each component which doesn't make it as efficient. Is there a way to set the variables globaly?

So I want to get rid of this:

In my component less:

@pink-color: #FC9DB5; // I want to get this from a single
                      // file which I import on each component
header {
  background-color: @pink-color;
  height: 100px;
}
2
  • 4
    You should @import them. Commented Jun 7, 2018 at 18:22
  • Ah thanks that actually worked.. Commented Jun 7, 2018 at 18:25

1 Answer 1

8

This is what @import is for; it lets you import files of variables.

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.