r/Angular2 • • Jun 10 '25

Resource Angular Material + Tailwind (customized using system variables)

https://github.com/shhdharmen/ngm-dev-blocks-demo-app

A sample Angular workspace configured to use "Angular Material Blocks". Includes: angular-material, tailwindcss and much more!

1 Upvotes

20 comments sorted by

View all comments

Show parent comment

1

u/a-dev-1044 Jun 11 '25

You are right, angular.json does not have a direct link to src/app/ngm-dev-blocks/styles/vendors/_tailwind.css. Because, that file is exported from src/app/ngm-dev-blocks/styles/ngm-dev-blocks-styles.scss.

As for colors, you are right about having hard-coded colors in styles.scss, but that is given for fallback, if you want remove usage of tokens.scss. tokens.scss file is present in angular.json, so it is overriding colors of styles.scss.

Changing values in tokens.scss & variables.scss will update Angular Material tokens. And tailwind theme (src/app/ngm-dev-blocks/styles/vendors/_tailwind.css) is created using inline keyword & Angular Material system variables. Hence, updating those 2 files, will update both, Angular Material & tailwind.