image created by Margaux Peltat for the Chilled Cow YouTube channel
Time for #DEVDiscuss — right here on DEV 😎
Inspired by @mapleleaf's Top 7 post, tonight’s topic is...CSS libraries, frameworks, and engines! 🏗️
There are so many different ways to implement CSS, thanks to frameworks such as Tailwind, Sass, Bootstrap, MaterialUI, and more. From the above post, I learned that UnoCSS is unique to these in that it's an engine, not a framework—there are no core utilities. 💡
Questions:
- Do you prefer a CSS framework or a CSS engine?
- What are the advantages (and disadvantages) of your preferred approach?
- Which are your favorite CSS libraries, frameworks, and engines? Why?
- Which are your least favorite, and why?
- And if you prefer vanilla CSS...why? 🍦
- Any triumphs, fails, or other stories you'd like to share on this topic?
I keep having discussions about CSS frameworks (or whatever category Tailwind falls into) and recently decided to stop using SCSS at least in my personal projects, now that we even have native nesting.
It depends on the use case how to use CSS best.
Developers and webmasters with little knowledge and practice can benefit a lot from functional class likes like Tailwind provides, but only if they can control the HTML markup. WordPress, its block editor, and its plugins often produce markup lacking class names, but adding inline styles, and lacking the option to change their markup without hackish PHP hooks, making it hard to apply styles in any way. WordPress setups are also notorious for using jQuery in 2023.
There are many other reasons to functional CSS, but I won't go into details, as I still tend to the opposite view, as I like to write minimal, elegant, vanilla CSS to apply to semantic markup.
Without any concept, this can lead to a unmaintainable chaotic legacy code soon, so I try to adhere to ABEM and apply a more modular ("atomic") approach to web development, but everything with a pragmatic "grain of salt".