Re:TailwindCSS v2.0
by bigbassroller on Wednesday November 18, 2020 @02:51PM
(#25141582)
I second this! I have gone full circle myself. From Dreamweaver (have to start somewhere), hand coding, Bootstrap classes and modifying them, then naturally started using utility classes. Finally made the switch to Tailwind (felt like cheating on a lover, because I loved Bootstrap so much). I then went full on utility classes and low and behold, discovered @apply with nested @screen media queries and went right back to writing clean HTML with named CSS classes that use utility classes in a SCSS file. Its so cool to me, I want to tell everyone about it.
[ Parent
| on HN ]
Re:TailwindCSS v2.0
by bigbassroller on Wednesday November 18, 2020 @02:54PM
(#25141615)
PS: Plus postcss purge. CSS ecosystem is complete!
Re:TailwindCSS v2.0
by irrational on Wednesday November 18, 2020 @02:56PM
(#25141652)
> Plus postcss purge
What does this mean?
I believe they're referring to https://github.com/FullHuman/purgecss.
Please, tell me more :)
Re:TailwindCSS v2.0
by bigbassroller on Wednesday November 18, 2020 @06:33PM
(#25144143)
Here is an example off the top of my head, while on iphone:
.card { @apply flex flex-row shadow rounded-md p-4; @screen md { @apply flex-col p-6; } yada... yada... }
then in tailwind config, point the purge path to your html file(s) to purge.
End result is css file with no more and no less than what you need, and in the web inspector you see clean HTML markup and clean CSS declarations.
edit: typo