Re:Tailwind UI
by mike1o1 on Wednesday February 26, 2020 @12:56PM
(#22425431)
If I wanted to change all links from gray to blue/underlined, the best practice there would probably be to use a different utility class (text-blue-500 and underline) and update my templates/partials/whatever.
I think for your specific example, I would use the `@apply` directive to apply certain utilities to all links.
I've used Tailwind on large, complex apps with around 50 screens (so far), and using extracted components or partials hasn't been a problem at all with keeping things in sync.
```
a {
@apply text-gray-700;
}
// now becomes
a {
@apply text-blue-500 underline;
}
```
The documentation goes over this pretty well, I think.
Re:Tailwind UI
by saagarjha on Thursday February 27, 2020 @06:02AM
(#22432269)
What if I had two types of links, both of which were currently "text-blue-500 and underline" but I wanted to make one italics at some time in the future?
I think for your specific example, I would use the `@apply` directive to apply certain utilities to all links.
I've used Tailwind on large, complex apps with around 50 screens (so far), and using extracted components or partials hasn't been a problem at all with keeping things in sync.
``` a { @apply text-gray-700; }
// now becomes a { @apply text-blue-500 underline; } ```
The documentation goes over this pretty well, I think.
https://tailwindcss.com/docs/extracting-components#extractin...