DEV Community

Cover image for Why you should Stop using CSS Frameworks
Uriel Bitton
Uriel Bitton

Posted on • Updated on

Why you should Stop using CSS Frameworks

Yes CSS frameworks can be useful and speed up web design time which is the main purpose of why they were created.

But the issue with using CSS frameworks is that:

  1. You will eventually forget css and not be able to use it when css frameworks are not an option
  2. Having custom styles is complicated (overriding issues) and will require multiple css files to be loaded.
  3. Designing custom styled apps and websites is awesome and very creative as well as challenging, why avoid this? (My main reason)
  4. Your designs will look generic, many people use bootstrap, material ui, etc. They all look the same.
  5. Create your own css framework to use as your own personal style, this is much more rewarding and can be reused for future projects.

There are many more reasons i dislike css frameworks. These are just the main ones.

Do you agree? Let me know your thoughts below!

Edit
To clarify, as some people got a little excited, this article is an opinion piece and not meant to change people's way of doings things. I am simply dicussing why i don't like CSS frameworks, if you like to use them then by all means please do. This article only suggests, it does not force you to stop using frameworks - the title is just provocative on purpose.

Oldest comments (73)

Collapse
 
chrisdemars profile image
Chris DeMars

Forget a framework and utility library. Roll your own!

Collapse
 
urielbitton profile image
Uriel Bitton

exactly my point, thank you!

Collapse
 
bholmesdev profile image
Ben Holmes • Edited

Hm, I feel there's a lot of nuance here that's worth considering.

First, I'd want to draw a distinction between a) pre-styled, prescriptive frameworks like Material UI and Bootstrap and b) utility frameworks like Reach UI and Tailwind CSS.

The former definitely comes in handy for anyone trying to build full stack applications without a design team on standby. For such an audience, the training wheels provided by, say, Material UI components are critical for moving fast.

These training wheels also ensure accessibility guidelines are met without as much research on the developer's part. You may not think about it, but hacking together dropdowns and tab sliders that look good won't always work well for all people. I recently wrote a longform post on building an accessible navbar for this very reason; there's so many little things to consider that Material UI et al. will consider ahead-of-time!

Now let's consider those utility frameworks. If you're unfamiliar, frameworks like Reach UI provide a "skeleton" of CSS and React components to build your own visual identity on top of. This framework merely exists to help you hit accessibility guidelines for modals, tabs, custom select boxes, etc, while also giving you powerful CSS selectors to build from. I'm a CSS warrior myself, so I lean on this type of CSS framework super hard to get things done.

I also threw in the Tailwind utility framework, which also empowers you to build your CSS from a set of building blocks. However, this takes an entirely different approach to the problem that's worth its own evaluation. Check out this post by @swyx to understand that one a bit better.

My personal stance

Overall, I think writing off CSS frameworks is a bit of a hand-wavy statement to make given the huge landscape of tools out there right now. There will always be a place for prebuilt solutions like Material UI; if anything, I see them as one step removed from powerhouses like SquareSpace or Wordpress (closer to the code, but with a lot of details abstracted away). Also, for the sake of accessibility and developer speed, anything from Reach UI to Tailwind should fit the bill for some.

Still, keep hacking away my friend! I'm right there with ya 😁

Collapse
 
nomade55 profile image
Lucas G. Terracino

This should be a post itself. Very good insight.

Collapse
 
bholmesdev profile image
Ben Holmes

Well, I took your suggestion. Decided to turn this comment into a longer-form post 😁

Collapse
 
coopercodes profile image
🧸 🏳️‍🌈 cooper-codes 💻 🎮

Hell yes!

Let's delete the original post and replace it with this.

Collapse
 
lamambasan profile image
San Lamamba

Very good of breaking down the problem 👌🏾

Collapse
 
urielbitton profile image
Uriel Bitton

Good point, i general agree with most of the things you say. However, many beginners use css frameworks and that is simply self-damaging. CSS frameworks are best used by experienced developers working on large business projects alone without a team to help the developer. This i can understand. What i can't understand is when the framework is being used to build simple websites for clients and small passion projects.

Collapse
 
bholmesdev profile image
Ben Holmes

I totally agree; frameworks aren't the best fit for every use case. I've built quite a few projects recently without any frameworks at all since I'm a CSS warrior at heart.

Still, there's something to be said for utility frameworks like Reach UI on this front. These are perfect for nailing accessibility guidelines out of the box, but still leaving the door open for custom CSS on top. Very little is left to the imagination! It just gives you a baseline to work from, and guides you on custom styling (with documentation!) using simple CSS classes.

I really like the direction of these frameworks in particular over powerhouses like Material UI (which you probably had in mind when writing this post). Still, to each their own.

Collapse
 
athomsfere profile image
Austin French

But many new developers also get thrown into the deep-end of a full stack.

When it comes to data integrity, solid business logic, a good view (HTML, Js) and CSS, writing custom CSS when something like bootstrap does most of it OoB... Choosing to write your own is potentially the least important and impactful to the product owner and technical leads. I'd agree with them most of the time too. Far too often the CSS is the worst written 'code' of an application. Where I go from "This site looks pretty good" to "Holy hell, how is this maintained?"

Collapse
 
laurasofia profile image
Laura Sofia Heimann

I actually never got 100% into CSS frameworks. I of course know how to work with bootstrap, but I know that I am personally faster writing it my own. Plus there is a lot less boilerplate-code and/or css overhead, which is also quite nice.

Collapse
 
andrewbaisden profile image
Andrew Baisden

Freedom of choice is good let people use and learn what they want.

Collapse
 
urielbitton profile image
Uriel Bitton

100%, i don't force anyone to use or not use something. The title i agree was a little agressive but was only meant to instigate. I modified it slightly to be less aggressive.

Collapse
 
altinmullaidrizi profile image
altinmullaidrizi

I only prefer using Bootstraps Grid system, as that helps when making the site responsive.

Collapse
 
urielbitton profile image
Uriel Bitton

fair enough!

Collapse
 
vaibhavfuke profile image
Vaibhav

Yes correct. If we have infinite time then don't use css frameworks. The main aim of the framework and utility is to reduce development/designing time. End user don't care what you have or haven't use. Beginners should use css. But professional should use utility frameworks cause they need to get work done. Big fan of tailwind🥳

Collapse
 
mzaini30 profile image
Zen

I usually use Bootstrap for finish my projects fast. Then, no complain from clients. No problem.

Collapse
 
pmejna profile image
Przemyslaw Mejna

I hate all CSS frameworks but in real life all is about efficiency. Projects need to be done, there are deadlines. If you can do what is on the mockup with framework and that will make your task faster - why not? Of course if you will get a website mockup which will need custom solution - you will have to use CSS and make it this way. I think we need to work the way is best for us. That's why I don't tell anybody to not use a frameworks or work only with vanilla CSS because this is not my business

Thread Thread
 
mzaini30 profile image
Zen

I usually use all framework for finish projects fast. Like Bootstrap, Svelte, etc

Collapse
 
mzaini30 profile image
Zen

M- is cool

Collapse
 
hrefel profile image
Muhammad Refel Hidayatullah

agree. but there is no harm in using the css framework, you will get new things from css framework. the most important thing is don't just use it but learn from it

Collapse
 
leob profile image
leob • Edited

But, isn't there a large amount of mundane "basics" (e.g. CSS resets, just to name one) which you then have to take care of every time? I don't necessarily have to have a complete framework, but unless I can start with some of those basics having taken care of for me (CSS reset, grid system, typography) I'd be afraid that this would slow me down (well at least the first time, when I have to sort it all out).

Apart from that, the arguments against CSS frameworks are much less valid against utility style frameworks like Tailwind. And no, even when using Bootstrap I'm in no way afraid of forgetting CSS :-)

Last but not least, I agree that this line of reasoning (don't use JS frameworks but use Vanilla JS, don't use CSS frameworks, etc) does become more compelling and realistic as browsers become more capable and the minimum browser support that you can build on is getting way better. Back in the days of IE8 I think people were relieved that frameworks took care of all of IE's quirks and bugs.

Collapse
 
urielbitton profile image
Uriel Bitton

I definitely agree with you man, which is why i encourage to build your own frameworks or at least build your own reset styles framework. I use my own reset styes and a light framework that i designed from scratch for all my web projects. Trust me its so much more rewarding then using css frameworks. Now don't get me wrng if you're building a large business project website or app that requires a huge amount of styling then sure a framework may be a good decision. But my article refers mainly to people who use it for normal websites, and small passion projects. That's what i don't vouch for. Again this is just my opinion, i respect everyone's opinion in the matter!
Thanks for sharing :)

Collapse
 
leob profile image
leob

Totally agree, when I have got some time on my hands (generally I don't, haha) then I definitely would like to do that - build a small "foundation" (excuse the pun, haha) because I'm convinced you can learn a LOT from that!

Collapse
 
cchana profile image
Charanjit Chana

I personally prefer to steer away from resets and frameworks but the minute someone else gets involved in the project then a well documented framework is something I would seriously consider.

I’ve seen the advantages of using Bootstrap first hand. I may not have been in love with how it looked, but it enabled multiple teams to build rich interfaces while concentrating on functionality. We could deliver functionality quickly and there was still the ability to theme it if we wanted to.

Collapse
 
nieuwepixels profile image
Nieuwe Pixels

I read pros and cons in the replies, still I think the point didn't cross over (I am assuming)

As for me I also stopped using frameworks and went more modular.

In short, i have a SCSS for building the grids and rows and then I build on top of that. Yes, I have some common files in place allready also for generic stuff like buttons, forms and such.

If this was the intention of this post I get it and I think there's a valid point to be made to at least evaluate the need for a framework.

Collapse
 
gsarig profile image
Giorgos Sarigiannidis • Edited

While personally I clearly prefer writing my own CSS (here is my reasoning), I agree with those who say that it depends on the specific use-case.

As others pointed out, if you are a developer with no design skills and no specific design at hand, then using a framework like material UI or Bootstrap is not only helpful, but I would dare say, essential.

If for whatever reason you want to write the less CSS possible, either because you hate it and/or because you are not good at it, then a utility framework like Tailwind might be your thing.

If you work on a big project along with other people, again, a framework might be helpful to keep the code consistent.

If, on the other hand, you have to convert a design from a PSD, XD or whatever to HTML, then, depending on the design's complexity, a framework might even turn out to be an obstacle rather than a help.

Also, I am a fan of avoiding frameworks when I have to build a plugin or a theme meant to be used by anyone and not for a specific client. On those cases, I believe that the less dependencies, the better (that applies to the use of vanilla JS instead of jQuery as well).

Some comments may only be visible to logged-in visitors. Sign in to view all comments.