So I have the following code in several places across the app:
<label className="input text-neutral-content">
Name
<input type="text" className="grow text-base-content"/>
</label>
I know that the idea behind tailwind is inline styling but is there a way to define the text color of label and input globally so I don’t have to repeat the text-neutral-content and text-base-content in each and every input field?
2
Answers
Yes Sure.
in your global.css file you can your default styles like this:
You can read more here:
https://tailwindcss.com/docs/adding-custom-styles#using-css-and-layer
You can use ‘@apply’ to append your class to an existing Tailwind class. You can add it in your CSS file, something like this: