Your inquiry appears to be muddled, so I will provide some clarification:
Material UI
Material UI is a design-centric framework, and Angular Material UI is a component library that aligns with this design philosophy. Overriding styles can be challenging as the configuration is done through a scss stylesheet.
Tailwind
Contrary to popular belief, Tailwind is a versatile css utility library that allows for customization. It is an alternative way of writing css similar to sass or less. While it does come with default styles, they can be easily overridden, turning class names into design tokens.
I have been using Material UI with Angular, however as flexlayout is deprecated now, and Tailwind is recommended
Who exactly is recommending Tailwind over FlexLayout? While I am a fan of Tailwind, it is unlikely that official sources from Angular are suggesting such a switch.
, so is it sustainable to use both Material UI and Tailwind together?
It is feasible to use both frameworks simultaneously, especially if you utilize Tailwind for positioning components, essentially treating it as you would traditional css.
I recommend configuring your Tailwind setup to match the angular colors and typography you are utilizing for consistency.
angular-styles.scss
$indigo-palette: (
900: #19216c,
800: #2d3a8c,
etc.
);
$my-theme: mat.define-light-theme(
(
color: (
primary: mat.define-palette($indigo-palette, 600),
accent: mat.define-palette($orange-palette, 600),
warn: mat.define-palette($red-palette, 500),
),
typography: mat.define-typography-config(),
density: 0
)
);
@include mat.all-component-themes($my-theme);
tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [],
theme: {
colors: {
white: colors.white,
indigo: {
900: '#19216c',
800: '#2d3a8c',
etc.
In order to use Tailwind classes , how do I apply it?
To apply Tailwind classes, simply add them to your elements like so:
<mat-card class="max-w-xl flex-1">
...
Add to a new or to the <mat- ... > tags ?
If you intend to use Tailwind classes to modify the style of material components, I advise against this approach.