I have been using Material UI with Angular, however as flexlayout is deprecated now, and Tailwind is recommended, so is it sustainable to use bot Material UI and Tailwind together? In order to use Tailwind classes , how do I apply it? Add to a new or to the <mat- … > tags ?
2
Answers
In order to use tailwind CSS with Angular, you can check the official documentation. Here is the link
https://tailwindcss.com/docs/guides/angular
Your question suggests some confusion so I’ll clarify:
Material UI
This is an opinionated design and angular material ui is a component library that adheres to this design. It’s very hard to override styles. You configure the styles via a scss stylesheet.
Tailwind
Despite what some people may say this is a un-opinionated css utility library. It’s another way of writing css like sass or less. Whilst it does have default styles these are overide-able so that class names can effectively become design tokens.
By whom? Whilst I’m a big Tailwind fan I doubt anyone official from Angular are giving such recommendations.
It’s possible providing you’re using tailwind for things like placing of components. In other words, how you’d normally use css.
There’s some configuration I recommend like matching your tailwind config to match the angular colors, typography etc you’re using.
angular-styles.scss
tailwind.config.js
Just add classes. e.g.
This is where my concern about the question you’re asking comes in. If you’re trying to use tailwind css to edit the material components styles I don’t recomend this.