Eweren
Eweren

Reputation: 277

How to correctly import styles from an angular lib

In my current project I want to create a lib container all different styles (scss-files). Therefore I need to import them into different components, so that the style will be set through these lib-scss files.

Importing libs into modules is quite easy by @[projecttitle]/[libtitle]

But how can I import only stylesheets? Something like @import '~@[project]/theme/theme-to-import.scss'; Does not seem to work.

I already tried importing like mentioned above, but that does not work at all.

Workaround right now is taking the relative path, but I think that won't work well in production mode.

Upvotes: 0

Views: 333

Answers (1)

Doflamingo19
Doflamingo19

Reputation: 1639

you need to put in angular.json

"styles":[
[project]/theme/theme-to-import.scss'
]

Put the correct path according to project folder.

Upvotes: 0

Related Questions