I must admit, when I first got introduced to CSS, I hated the idea of using CSS frameworks. I saw it as a lazy way to go around a challenge.
But along the way, as I played around with a few frameworks, I realized they save you the headache that is CSS coding.
In this article, we look at five of the best CSS frameworks that you can start learning or using today. But first, why use frameworks anyway?
Let’s find out!
Why use CSS frameworks?
- Help you learn CSS
If you are new to CS, centering elements or creating a responsive navbar can be a daunting task – it used to be for me.
Luckily with CSS frameworks such as Bootstrap, this is a walk in the park.
These tools introduce you to complex CSS concepts in a beginner-friendly manner allowing you to accelerate your learning process.
- Rich documentation
They come with well-detailed documentation so you can refer to them should you get stuck.
Also, this helps you to smoothly communicate with a client should they request changes or support.
- Ready to use
With a CSS framework, you don’t need to build blocks from scratch. They come pre-designed all you have to do is tweak them to your desired outcome.
Besides, most frameworks will come with pre-built components such as navbars and menus.
- Cross-browser compatibility
Imagine the sting you get when you create a website only to realize it does not render in several browsers, awful! Right? This is where frameworks come in.
They ensure that your websites can render in different browsers with little input on your side.
- Clean code
They make your CSS code clean, readable, and scalable. No longer do you need to use weird class names since they come with pre-determined classes.
As such, you’ll have an easy time debugging or explaining code to your teammate or client.
Types of CSS frameworks
- Preprocessors
These frameworks provide you with features that are lacking in vanilla CSS.
While they do not output the CSS code, they help you write the code faster.
The most popular are Less, SASS, and PostCSS.
Most CSS preprocessors come with plugins and frameworks for easier coding.
- CSS UI frameworks
They are the most popular CSS frameworks as little coding is needed.
They feature pre-designed components such as tables. The downside, they might make your website look generic since the HTML structure is pre-determined.
The most used include Bootstrap, Materialize, and Bulma.
- Utility-first CSS frameworks
If you want to use these frameworks, I recommend having basic CSS skills under your belt.
Why? Because you’ll have to write vanilla CSS and HTML code. The best part, they are flexible allowing you to create unique HTML structures.
Frameworks to consider include Tailwind CSS, Tachyons, and Shed.CSS.
Top 5 CSS frameworks
Tailwind CSS
If you want a CSS framework that allows you to do more, consider Tailwind CSS.
In fact, it is becoming a favorite for me. It is lightweight, flexible, and does not come with pre-designed components.
However, thanks to their classes, you can create components faster.
Whether you want to use Flexbox or Grid for your layouts, Tailwind CSS got you sorted.
Why use Tailwind
- Improved productivity
It allows you to bolster your productivity thanks to the reusable components.
And since you don’t have to input your classes, it makes creating components from scratcher easier.
In fact, most experienced front-end developers use it for large projects.
- Customizable
Tailwind does not come with pre-made designs. It gives you classes to create the designs.
As such, you won’t override designs that can crash the website
- Reusable
Do you find yourself copy-pasting classes? Well, with Tailwind, this is a thing of the past.
Thanks to the Components feature, you can reuse your designs throughout your project.
Bootstrap
This is arguably the most popular framework. Since its introduction in 2011, the framework has gained a reputation among novice and avid front—end developers.
It makes creating appealing and responsive websites easy eliminating the need for using media queries.
Fast forward, the framework supports modern CSS allowing you to create better-looking and functioning websites.
It is the framework that introduced the “mobile-first” concept through the grid concept.
The concept utilizes 12 columns so you can easily create components that take a third or half of the screen.
Why use Bootstrap
- Pre-made components
It comes with pre-made components eliminating the need to code them.
This means you only need to code the HTML structure and apply the provided CSS classes.
- Most popular
Being the most popular, the framework attracts a large support community.
Besides, you can get just about any answer to a Bootstrap question on platforms such as StackOverFlow.
In fact, its GitHub page consists of more than 2000 contributors.
- Detailed documentation
It has robust documentation that allows you to easily get started with CSS.
- Customizable
You can customize Bootstrap using SASS.
With SASS installed, you can import the Bootstrap project and use the SASS variables to give it a personal touch.
In fact, this is what most front-end developers do to save their coding time.
- Reputable support base
Think of React, Angular, or WordPress. What do they have in common? Backing from an established entity.
The same case applies to Bootstrap. It is backed by Twitter significantly bolstering the faith among developers.
Foundation
Closely following Bootstrap is Foundation. It is built in HTML, CSS, SASS, and JavaScript.
It is yet another framework that is popular among avid front-end developers.
This is because it offers flexibility while coming with stellar designs.
Not only does it allow you to create stunning websites but also animations and emails.
For this, you’ll need to use Motion UI for animations and Foundation for Emails to create converting emails.
Why use Foundation
- Ideal for large projects
Foundation is the most ideal CSS framework for large projects.
- Full control
The framework allows the developer freedom to create components, unlike Bootstrap.
As such the framework is well-suited for established developers since you’ll have to incorporate vanilla CSS.
- Support
The company behind Foundation offers support to large clients. It also offers training to teams which is uncommon with other frameworks on the list.
Besides, ZURB – the company behind it – does not treat Foundation as a side project, rather, it pours its resources to advance the framework.
Bulma
While a new entrant in the market, Bulma has attracted a large user base thanks to its elegance and beginner-friendliness.
What’s more, it is entirely created in CSS, unlike other frameworks that have JavaScript components.
The framework is a favorite among many front-end devs since it allows you to create visually appealing designs.
With SASS, you can seamlessly customize components to your liking with little input.
Not only is it compatible with Font Awesome 4 and 5 but also with Laravel (a PHP framework).
Why use Bulma?
- Elegant
If it’s daunting to come up with elegant designs, I’d recommend you use Bulma.
It eliminates the fluffy CSS codes allowing you to use easy-to-read CSS classes.
- Easy to learn
Bulma has a rather flat learning curve. However, this is dependent on your CSS foundation skills.
- Large and growing community
As of writing, the framework has more than 40K starts on its Github page.
This means that developers buy into the idea of using Bulma.
Materialize CSS
Finally, we have Materialize CSS from Google. The main aim of the framework is to achieve uniformity to Google UI using Google Material Design.
It is written in JavaScript, CSS, and HTML. It is hailed for enabling one to create responsive, elegant, and browser-compatible websites.
And if you are into animations, I bet you’ll love working with Materialize CSS.
Why use Materialize CSS?
- Elegance
It has an elegant design that allows for the creation of appealing web components.
Besides, you can use their exquisite templates.
- Smooth learning
Curve it comes with easy-to-understand documentation that makes learning a walk in the park.
Final verdict
While this is not an exhaustive list, these are some of the popular CSS frameworks that have a large community.
There are supported by at least all browsers and make learning and using CSS seamless.
Other frameworks that you can consider include Skeleton, Sematic UI, Pure CSS, and Susy.
So, which CSS framework do you use for your projects? Let me know in the comment section.
Top comments (7)
I don't use CSS frameworks because they are so... ignorant. Ignorant of why HTML and CSS are separate, ignorant of the entire purpose of HTML, ignorant of everything HTML 4 Strict was trying to drag us back to after the horror-show that was HTML 3.
As I've said many the time if you don't realize that this:
And this:
... are in fact the exact same broken mid-'90's code building mentality, then you don't know the first thing about HTML or CSS. You are putting what things look like for screen media in the markup, ignoring all the other types of media that exist where your screen layout means but two things, Jack and ****, and Jack left town.
But I suspect that's why most of the people MAKING these frameworks and their examples don't even seem to know what the media attribute for the LINK and STYLE tags do, thus why they omit it. Just like how they all set X-UA to "edge" as if any relevant browser uses the old M$ blacklist, how their examples are have broken heading orders, a lack of logical document structure, and all the other telltales that the people who CREATED these frameworks lack the knowledge to be using web technologies in the first place, much less have the gall to tell others how to do so.
NONE of their wild unfounded claims about how "great", or "easier", or "better for collaboration" is in any way, shape, or form based in fact. All they do is prey on people who need to spend more time learning HTML and CSS, instead of wasting twice as much time and code on these stupid frameworks!
In the 23 years I've been working with HTML and CSS, I've NEVER seen a website built with any of these frameworks that was easy to maintain, met accessibility minimums, properly leveraged or exploited caching models, or even used the most basic of proper semantic markup.
Thus my endless chain of articles on Medium ripping them to shreds.
EXPLICIT LYRICS WARNING if you can't take a little harsh language, please don't even bother with this first article. I was venting because from where I sit, the claims of how "great" frameworks are sounds like the type of delusional nonsense I expect from cultists.
medium.com/codex/stop-fighting-the...
medium.com/codex/more-tailwind-to-...
medium.com/codex/pure-css-more-lik...
medium.com/codex/semantic-ui-doesn...
medium.com/codex/material-ui-frame...
I'll never understand how dragging practices back to "screen only plow everyone else" mid '90's style coding using classes, resulting in two to ten times the markup needed, to requires a library of CSS two to three times larger than the CSS of an entire site should ever be, flipping the bird at semantics, leveraging the advantages of caching and pre-caching, ignoring the separation of concerns, and basically shoving one's cranium up 1997's rectum makes anything 'easier" or "better". Again, the praises people sing of frameworks is painfully outright DELUSIONAL!
Which is why as an accessibility and efficiency consultant, the first thing I have to tell EVERY client in legal trouble for this nonsense is that the frameworks need to be ripped out by the groin!
I love your irreverence toward these frameworks honestly haha. I mainly agree but also think some things are worth saying.
I believe SemanticUI is no longer maintained (but appears to live on in popularity with something like 50k stars on GH).
PureCSS if I recall was like a small project years ago that somehow continues on. It's very simple to just audit this script and use what you want...no need to religiously just import it. Same for resets or normalize. Folks need to actually go in there and see if they agree with the damn CSS rules. Oh, but they do need to learn CSS to be able to do so 💪
I don't probably even need to read your articles to agree (I will when I get a spare cycle though!); but I noticed Bootstrap wasn't in there.
I think that BS as frameworks go is fairly well written considering the number of cases it has to adapt to. I've looked at the code and it appears fairly solid. You as the user may need to add that
aria-busy="true"
based on the dynamic thing that is happening in say a spinner, but otherwise, they appear to mostly use correct aria roles and semantic tags. If you hate class chaining, OOCSS, SMACSS approaches, and prefer positional markup/structure based CSS in the name of removing "classitis" you'll disagree. But this takes us to an apples vs. oranges thing and we have to admit that classless approaches have their limitations (e.g. the number of cases you can support) as well; also positional approaches are generally riskier on large projects where larger teams start to "fight the cascade". I believe it really depends on the use case.I feel that many folks are simply using Bootstrap (or any framework) in an unsophisticated and needlessly inefficient way. I've said this myself many times elsewhere, but you could simply do the following (with disclaimer you'd need to be in an SCSS env):
I did this at work because they were using it before I even showed up. It worked fine. This is for Bootstrap, but most frameworks would have such hooks to utilize if you go looking.
I'm the author of a framework myself called AgnosticUI and I'd enjoy getting your feedback on my GitHub issues or discussions board if you find something egregious especially in terms of a11y violations (I have to balance what I can actually fix as it IS a side project at the moment; but you seem to have some valid and interesting findings and I'm trying to make my components inclusive and a11y compliant as much as my abilities allow me to do so! So I'm happy to learn of mistakes and correct them). I try to use semantic tags, add
aria
roles where and when appropriate, and use lighthouse or storybook accessibility tooling to check my code. I honestly don't always have time to do VO audits, but try to drop down to a screenreader when I do sanity checks.I would also point out to folks, that you can leverage these open source projects and simply remove extra code you don't need. Or just fork the project and leverage some of the boilerplate! I know folks like to bag on framework bloat, but, I would argue that more often the usage is crudely done with an "import all the things at once" approach; and although framework authors have a responsibility — so do its users. Simply import things in a modular way and stop dropping in
href="path/to/all/of/bootstrap.css"
💥 🍰 💪 in fact I've seen they have instructions on modular imports in their docs as do I.I added a discussion on GIT outlining how -- to be brutally frank -- I don't see anything of merit in your "framework" just as I fail to see any merit in frameworks in general. The markup and CSS of the dotcom homepage of your project ALONE should send any same developer recoiling in HORROR!
No offense, but you need to take a few steps back and LEARN HTML. And CSS. Which seems to remain the biggest problem with people who CREATE frameworks. They dive for it before they have grasped even the most basic of concepts.
Thanks for taking the time to write that up and have a look. I certainly did ask for it haha. I used Vitepress for the dot com docs and I have github.com/AgnosticUI/agnosticui/i... for the accessibility issues that causes. Many areas you seemed displeased with so I'll have to go through those over time and see if I agree and/or if I can fix. Sorry to have upset you with all this, but I do appreciate that you took the time to have a look!
Ok, I read your stop fighting frameworks (I had to fight medium incognito so I can't comment because I'm apparently over my reading limit lol).
Love your points about parallelism and performance screenshots. I can tell from your cleanly coded
accountCard
that you are very sensitive to classitis; so you may not like my approach which is more a SMACSS approach. But, I work on teams where I'm literally the only one who knowns how to work with the cascade and I'm outnumbered, and the number of CSS cascade related regressions is outstanding on these larger projects. I argue that something like SMACSS is a much needed compromise. I do think we probably share a lot of common ground and I see you especially dislike Tailwind / Tachyons et al. I have to acknowledge their success in terms of devux but generally agree and just cannot see myself adding that many classes nilly willy everywhere. Your points on the performance and caching impacts were very good!In both agree and disagree. Sure you can do everything using pure html and finely crafted css. It is a wonderful separation of concerns between content and style... But it is very time consuming too, tricky to get right and repetitive to do over and over. On the other hand, you could copy paste a couple of links and code blocks and you achieve something looking good and behaving well in a fraction of the time. So it ain't so bad either.
How about trying a new CSS language instead of a
framework? 😎 Master CSS🙁 This is your current/traditional code:
🤩 Now, writing CSS in a whole new language makes UI development easier. ↓ 86% code
or some groundbreaking features: