ciantrius
ciantrius

Reputation: 693

Shared styles (scss) between nrwl nx applications (Angular7 / Typescript)

I'm looking to setup my first monorepo with nx and am struggling conceptually with sharing of styles.

The problem domain is as follows. The repo will contain multiple applications for the same client that must all follow a standard look and feel. i.e. font names, sizes, colours, margin and paddings, etc...

According to nx best practices, what would be the correct way of setting this up in an nx workspace

Upvotes: 2

Views: 1927

Answers (1)

electrichead
electrichead

Reputation: 1160

You should be able to do this out of the box if you build your UI out of small, self-contained components. Each of these (or groups of them) would be in different libs; and the apps would compose these libs into bundles that are deployed.

What this won't allow for though is for say one application to style something very differently from the others; this is actually undesirable in most cases.

The component libs would contain the styles needed for all the components contained within.

Upvotes: 2

Related Questions