Chaki
Chaki

Reputation: 73

Angular2+ UI library expose SCSS variables

I am building own UI lib for internal use in my projects. I already have some modules ready and started using it and it make me think how can I 'expose' scss variables to be overwritten in application consuming that library. Something like what ionic is doing for its components (on each component there is list of scss variables it is using which can be overriden in apps scss.

Upvotes: 0

Views: 434

Answers (2)

Muhammed Albarmavi
Muhammed Albarmavi

Reputation: 24406

Usualy you will start with _variables.scss , theme.scss (where you import all prtial files ) , but as advice you have to create a prtial scss file for each component like dropdown , card , button ....etc for example primeng has something like this and you may give a look to bootstrap repo.

Upvotes: 1

user4676340
user4676340

Reputation:

Make two files : one for configuration, one for styling.

The user will import the configuration, edit the variables, then import the styling. This would give

@import 'myLib/variables';

$color: green,
$background: yellow;

@import 'myLib/styling';

Upvotes: 2

Related Questions