Sign in
Log inSign up

Angular 2 - Style reusability with LESS and Webpack?

VignesH KumaR's photo
VignesH KumaR
·Jul 17, 2016

Hi,

How to reuse styles written in LESS files In Angular 2 app with Webpack?

Scenario:

I want to have a common.less file that contains the styles/style variables common for all the components. (example: some theme related variables)

Then, I want to import this common.less file in each of the component style's file, so that I don't have to rewrite these common styles/style variables there.

I am a Webpack user. When I tried this, I get the contents from common.less file getting copied in all component style files, which is bad.

Need help in doing this properly. Appreciate your help on advance.