DEV Community

Cover image for Why I don't use Bootstrap anymore.
codedgar
codedgar

Posted on

Why I don't use Bootstrap anymore.

For many web developers, Bootstrap is the way to go when you have to create a Website or App. But in the five years I have making websites, I have found things that made me change my decision of using Bootstrap at all, and I've changed the way I create websites almost completely.

Hi! My name is Codedgar and today I wanted to talk of why I don't use Bootstrap anymore. Since it's a question that students, coworkers, and people, in general, have been asking me a lot recently: Why I don't use Bootstrap?

Let's start with my history (I'm gonna be short, promise C: ) When I started working on frontend web development, the first thing I crossed upon was Bootstrap. And with that, I thought I had frontend developing mastered, it was easy, fast to use and it has a lot of components! Nice!

But as my work progressed and the websites became more and more custom, I started to find Bootstrap a little bit unuseful, and that's when I came to a conclusion as to why I would not be using Bootstrap in my new works.

For easier understanding, I have divided this post in the reasons of why I don't use it, enjoy:

1- Weight
2- Components and Utilities
3- Styling

1- Weight:

"Weight? But Bootstrap is less than 500KB". Yes, I'm aware of that. But let's take on consideration how much of Bootstrap we actually use. And using Bootstrap means that you have to use also jQuery, so if you were to create a landing page with Bootstrap, you would have to use jQuery, Bootstrap CSS, and Bootstrap JS. All of these resources will not be used even in half if you use Bootstrap. And that brings me to my next problem.

2- Components:

"Lack of?" Nope, not at all, is actually the opposite. Bootstrap has so many components and utilities, that you are almost certain to never use even half of them. And you may argue that with NodeJS you can compile and use only the CSS that the website uses, but with plain HTML for a server with Cpanel, this is not possible (At least that I know). So there's this vast quantity of components that you will maybe not use and they will be there anyway.

This is not a problem just of Bootstrap, but of many frameworks I've seen, like Materialize or UiKit, where there are components that most people wouldn't use and there are classes that can be broken down into only one style, like:

.modal-top-left{top:5%;left:5%}

And so on for modal-top-right, modal-bottom-left, modal-bottom-right. If you wanted to change the position of the modal you could totally do it with only one class, adding these classes is just dumb.

3- Styling:

While Bootstrap is easy to use, it's not so easy to customize as you might think. Some components will require you to use !important several times, which is not ideal when creating CSS. And having to override the default styles of Bootstrap is just like having to create your own CSS from start.

What do I use then?

Most people at this point just say " So what? You make CSS from start and don't use any framework?" And well, I don't create my CSS from scratch, and I do use a framework, but only for managing the columns of the website. The framework I use is called Flexbox Grid and it justs comes with columns and rows, nothing more. And it only weights 1.9KB! So, on a website with 1 homepage and 4 subpages, the total CSS (including Flexbox Grid) is only 5KB. For me, that's amazingly fast!

And should I use Bootstrap?

Well, there's something I can't deny and it's that if you need to develop something incredibly fast you can use Bootstrap. And if you are thinking if you should, or should not use Bootstrap, ask yourself:

1- Will I use several components of Bootstrap?
2- Am I in a rush to develop this frontend?
3- Is the design important for this?

If your answers are: Yes, yes, and no; Go ahead and use Bootstrap without shame.

Extra: Do I hate Bootstrap?

Of course not. I think that is amazing to develop websites quicker and easier, but I just would not be using it anymore because I prefer to make my own components and craft almost everything by hand. I know that Bootstrap will live along a still be used by a lot of people, and that's totally fine :)

What do you think? Do you use Bootstrap?

Top comments (143)

Collapse
 
rolibkk profile image
Roland Heller

It always depends what you want to do. I agree that for a simple web-page there's no need for bootstrap. But there's life after, for those who don't get stuck in developing basic stuff. E.g. we're developing enterprise apps for airlines - revenue management, pricing, inventory management, etc. Your're not going to do that with a simple table but require some solid templates and components. And that's what bootstrap is for.

Collapse
 
brettsschmidt profile image
Brett Schmidt

A contract value of those prices does not normally come with its own customized templates? It seems weird they would shell out that kind of money and immediately accept that performance hit.

I checked out a couple air line home pages to see:
AA: Modernize/jQuery
Delta: Just Bootstrap.js
United: React (without css framework that I could find)

Collapse
 
crongm profile image
Carlos Garcia ★ • Edited

In my experience, big contracts and companies often require documented and standardized solutions so the project can be maintained, improved, and fixed easily at any point in its lifetime. No one knows how long a software project will be around, and they know you won't be around forever (they don't want you to, as that would mean spending more money). There is of course a considerable amount of customized work to be done, but using public or private/paid solutions that are easily available and that anyone can pick up is a common practice.

Collapse
 
thefeorluwarh profile image
Thefeorluwarh Babs

Is it possible to use bootstrap to develop Project management application?

Collapse
 
rockykev profile image
Rocky Kev

I've built dashboards with bootstrap framework. Overall - it's just a framework. It'll help you lay out your components, and using the utility classes are helpful for a lot of the visual elements in common Project Management software.

If the bottleneck was CSS file size (which it rarely is on the projects I've built), It would be difficult to refactor the project out of bootstrap because of how dependent a lot of the code is on bootstrap. But that's not a con -- it was a fast deployment VS many many more work hours to find all the right visual libraries to display data.

Collapse
 
expdev07 profile image
ExpDev

I don’t see how not?

Collapse
 
tayambamwanza profile image
Tayamba Mwanza

One positive about bootstrap is that if another developer needs to modify your code they can understand bootstrap faster than working on custom components since it's got well established rules and docs

Collapse
 
voughtdq profile image
Douglas Vought

Bootstrap is best used as a framework from which you derive styles. It has a ton of utility features, but something that is big for me is that it is one of the few frameworks that has full-featured accessibility. I just don't have enough expertise to do all the work to make accessible styles on my own. It's easy to focus on the visual aspect of the design while forgetting accessibility. Bootstrap has some guard rails up to remind us.

So I usually end up customizing bootstrap by using the bootstrap SCSS library and preprocessing that with sassc. You can get it down to a few kb by excluding unused styles or by creating your own scss stylesheet.

And these are preprocessing steps that you do on your workstation while you're creating the design, so it works just fine with static HTML.

Collapse
 
tungdt90 profile image
Tung Do

I totally agree.
With my personal experience, i always try to customize bootstrap as much as possible, for example: I use my own bootstrap.scss file, exclude all unnecessary components, and customize variable.scss to match with the design.
In doing so, i hardly need to use !important, which is the most should-avoid thing imo.

Collapse
 
codedgar profile image
codedgar

I'm totally gonna test Sass! Can you link a beginner tutorial so I can check it out?

Collapse
 
leopinzon profile image
Leopinzon

You gotta be kidding, so you’ve never seen sass prior to writing this article?

Thread Thread
 
codedgar profile image
codedgar

I knew what it was, but I haven't used it since most of my work is pure HTML, CSS and JS without anything like NodeJS, React or VueJS so I haven't catch up with CSS preprocessors 🤷🏻‍♂️

Thread Thread
 
leopinzon profile image
Leopinzon

I’d kindly suggest you to start using it, it is certainly a one way road.

Don’t think of it as something related to node frameworks. If you build front end, it is simply your right hand for writing, organizing and maintaining your CSS at the same time you speed up the development . You can even reuse your own partial definitions within your CSS project as many times as you want, make global variables.... etc. Also you will be able to split your files into components or pages (your choice) without using the CSS @import statement that, as you sure know, triggers new requests to the server, something that is not a very good practice from a page load optimization point of view. The fewer requests, the better.

Customizing bootstrap is something you’ll learn later, but building everything on pure CSS is not efficient for you, and you’ll end up crazy trying to maintain big projects.

Hope it helps :)

Thread Thread
 
codedgar profile image
codedgar

Thanks for the kind answer, I really appreciate it!

I will totally check it out and see how much I can improve my work with it, thanks again! 😄

Collapse
 
voughtdq profile image
Douglas Vought

First you'll want to install it. There are various implementations. I prefer the one written in C but only because it's the easiest for my environment. Then this guide will walk you through most of what you need to know.

The way I learned how to use SCSS was to reference that guide and then look at Bootstrap's variables and observe how they affected included styles in bootstrap.scss. You'll notice in bootstrap.scss you can comment out the imports you don't need.

Thread Thread
 
ferdelvalle profile image
Fernando Del Valle

There's an extension for visual studio code called Live SASS compiler that does the trick and it's awfully simple to install.

As for a tutorial, the official site has great documentation and it's, I believe, the best place to start.

Collapse
 
expdev07 profile image
ExpDev • Edited

Learn about how to use SASS to extend bootstrap instead of just dropping it due to size. It’s become a really infamous framework due to being abused by beginners, but it’s great if you learn how to use it properly.

Collapse
 
jhulten profile image
Jeffrey Hulten

I think the point Codedgar was making is that Bootstrap has become a golden hammer. Sometime we allow a tool to become more than it needs to be. Tool developers do this by adding more and more features. User developers do this by using a given tool as an article of faith instead of a intentional decision. 500k overhead for a landing page is a lot!

Thread Thread
 
expdev07 profile image
ExpDev

That is true. And it has become very infamous among some developers for that reason. However, as I mentioned in another post, you can use sass (which Bootstrap 4 was made with), to manually include components/features that you want (e.g bootstrap-grid). It's extremely easy to customize to your likings through variable or class overrides.

Also, Bootstrap isn't just a tool-- it's a framework, so naturally it will have a lot of features (but again, you can opt-out if you'd like less KBs).

Absolutely, you should understand what CSS is before using Bootstrap. But the points brought up in this article are misleading:

  1. Weight - Solve this with SASS (which is really meant to be used with Bootstrap 4) by importing only features/components that you need. You also don't have to use jQuery. It's completely optional at the expense that you won't be able to use JavaScript based features such as modals, dropdowns, scrollspys, etc.
  2. Components and utilities - See 1.
  3. Styling - Using SASS will allow you to specify overrides without using "!important".
Thread Thread
 
steventew profile image
Steven Tew

This is exactly what I thought when reading the article, misleading and ill-advised. Bootstrap has been designed and built to address all of the points raised, allowing users to pick and choose, customize and override, flexibility at heart. I could possible argue that it can feel a bit dated at times, and there can be classes that you do not use, but the only way to avoid this, as with any Framework, is to build your own to match your specific needs.

But the biggest negative I find in using any prebuilt framework, is that once its in place in its hard to replace it. Investing time at the start of a project to assess whether or not the framework meets your needs (and future needs) is time well spent.

Thread Thread
 
lexiebkm profile image
Alexander B.K.

In my next projects that use React, I will need to consider about using these libraries : React-Bootstrap, Antd or Material UI. Maybe a combination of them, depending on certain features that will fit to my needs. In my current app, Bootstrap dominates, although there are already some parts I write using Antd or Material UI.

Thread Thread
 
johnnywalker2k1 profile image
JohnnyWalker2K1

This is nonsense. Why are you including styles you are going to override? If you're using Bootstrap for its Grid Layout then just use a framework that only does that.

People think if the payload is small then there's no issue, but your browser still has to parse all those unused styles.

Collapse
 
marcusatlocalhost profile image
Marcus

Here are Bootstrap Sass mixins to use gist.github.com/anschaef/d7552885c... and here is a nice article how to use them: medium.com/@erik_flowers/how-youve...

Collapse
 
lexiebkm profile image
Alexander B.K.

"You also don't have to use jQuery. It's completely optional at the expense that you won't be able to use JavaScript based features such as modals, dropdowns, scrollspys, etc."
When I want to control my modal behaviour, I am forced to use jQuery. because using the attribute of data-toggle doesn't work exactly as I expected. I use modal forms massively, because there are a lot of forms in my app.
For my React based project, there are other alternatives for GUI toolkit other than Bootstrap (React-Bootstrap) such as Antd and Material UI. Currently I use Antd for closable dynamically added tab components; I use Material UI for switch components. The remaining parts are built using Bootstrap.
My app is quite large; it is about KPI management system that I develop alone : from front end to back end. So I don't have enough time to do refinement on the GUI.

Collapse
 
angularnodejs profile image
AngularNodeJS 🚀 • Edited

If you're using CPanel to develop a website, using Bootstrap is least of your concerns. Most likely, your on a slow host with tons of resources and network speed issues.

jQuery is going away in Bootstrap 5, most CDN already have bootstrap cached for quick download.

If you enjoy fixing CSS compatibility bugs in multiple browsers than by all means roll your own CSS.

Getting new developers to learn "your css" is a waste of time, when most devs already know Bootstrap. So your team productivity will continue to suffer. If they extend your home-grown CSS, the code will just become a horrible mess.

Unless you're a lone ranger dev, using Bootstrap is not a big deal. In fact not using it, is unwise.

Collapse
 
robertwent profile image
ʇuǝʍ qoɹ

Sounds like you've been loading the full compiled CSS file and then overwriting the styles?
Why don't you use it with sass? It has a huge list of variables you can override to change the output and you can easily remove the parts you don't want to use.
If you use it like that then you hardly have to write any CSS at all and get consistent styling when you decide you want to use another part of it later.

Collapse
 
codedgar profile image
codedgar

From what I know you can not use Sass on a pure HTML project :o

Collapse
 
expdev07 profile image
ExpDev

Please do research on what you’re writing about before misleading a ton of people... If you go to the official bootstrap documentation, you’ll see that it has an “extending bootstrap” section. You can use sass to only bring in features/components that you need. With this, you can also override variables, so you don’t have to use “important!”. You also don’t have to use jquery, only if you want to use the JavaScript features such as modals or dropdowns.

Thread Thread
 
codedgar profile image
codedgar

My opinions come from 4 years doing websites! And while I agree on the sass part, you need to use jQuery and Bootstrap.js if you want to use the navbar or pretty much anything you want to have a functionality implemented in Bootstrap, so not having it would cut a lot of components out

Thread Thread
 
expdev07 profile image
ExpDev

You can choose to not import those components (which by the way, aren't that many) or just don't use them when you haven't added jQuery and bootstrap.js. You can also choose to add custom JavaScript (or use another library) and just use that.

Navbar also works perfectly fine without, you just can't use features such as dropdown for hamburger/profile menu, etc.

4 years is a long time without having looked at SASS, which is taken for granted that you know of if you do front end web development.

Collapse
 
robertwent profile image
ʇuǝʍ qoɹ

I'm not sure what you mean?
SASS is a pre-processor designed to make css easier to write and manage. It compiles sass files to css.
That's why Bootstrap uses it, you can change everything by overriding the variables.

Collapse
 
slryit profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Silvan

Script kiddie go back to your lessons

Collapse
 
idenyigabriel profile image
Gabriel Anthony

I've never really liked bootstrap from the start. Sure, it's quick to use and all, but overall I've never considered it important or needed either.
In that sense, it's quite annoying, how so many people quickly grab bootstrap, and go on believing they've done the part (frontend).

Very nice article, happy to know am not alone anymore.😅😅

Collapse
 
gibbitz profile image
Paul Fox

Same here. I worked for an agency once that was fired because they didn't use bootstrap! The client claimed the site couldn't be responsive without it even though we had build client adaptive mobile styling into the custom front end before this conversation even happened.

The problem with frameworks in the industry is that it's driven by marketing either to get the name of an existing tech company into the OSS space or with the hope that a buyout will happen. This leads to the wrong decisions happening when the people choose the tech stack based on hype -- not experience and requirements.

I've had to fight bootstrap layout styles on too many projects in the past 5 years to recommend it to anyone. It was built on naive best-practices from 10 years ago that lead to overly specific selectors and often require !important overrides. If I were releasing bootstrap today, I'd call it '!important'.

Collapse
 
expdev07 profile image
ExpDev

Then use sass, and bring in only features/components that you need such as the grid??

Thread Thread
 
gibbitz profile image
Paul Fox

And have negative margins? No thanks. Bourbon and neat were better tools for this, but these days I just write it by hand. Flex box and css grid are supported well enough to not need this anymore anyway. I've used bootstrap mixins from sass for media queries in the past, but was unhappy with the lack of flexibility. Building at responsive (instead of adaptive), every design calls for breakpoints at different queries. As widely used as bootstrap is, css is used by nearly all websites and if developers can't support it that's on them ;)

Thread Thread
 
expdev07 profile image
ExpDev

Again, everything is customizable. Even the breakpoints. It’s just a matter of overriding the variables.

Collapse
 
slryit profile image
Silvan

Whena coder criticize Bootstrap to suggest Materialize, I stop to read 🙄

Both are frameworks with opinionated designs.

Collapse
 
lprefontaine profile image
Luc Préfontaine • Edited

Given the CDNs available worldwide and intelligent caching done by web engines plus
the amount of memory available to most browser for cache,
I find your point #1 irrelevant. If JS libraries would comply with the Google compiler,
that size could be reduced, the compiler can identify unused code and remove it from the
compilation target. For now it's cheaper for lib maintainers to not jump on that train.

2) Yes and no. The day you need a component and it's not readily available,
you have to jump in some hack to implement it or import it.
Basing your decision on 'I will never need these' is
a short term decision that may come back and bite you.
The only real 'no' here is that you might have to dig to use a component
you don't use often or never used.
Is this worse than hacking something in your shed ?
I don't think so.

3) See 2)....

Collapse
 
codedgar profile image
codedgar

Amazing answer :o

And I agree on you on the main part. But in point 2 I have to say that yes! I prefer making my own things!

This helps me create a component that can match the look and feel of the website completely instead of having to customize an already existing element. And maybe add little details that are not present on Bootstrap.

Some people may say that creating my own components for websites it's not optimal, but that's why I said "I" on the title 😄

Collapse
 
lprefontaine profile image
Luc Préfontaine

In the context of executing a contract for a customer, you cannot let that happen.
It's already hard to do a decent knowledge transfer, anything out there that is already published
and maintained should be used as much as possible.

I used to like to do my own things in assembler. But it was a different era and because of
limited hardware at the time it was on many occasions a 'logical' choice,
I remember though a customer that refused to buy a C compiler (5k CAD at the time)
for a distributed transactional system.
I ended up coding 40k lines of assembler (and I used macros extensively). 😬
Not a good business decision. This ran for more than 3 years w/o failing before being replaced
by a better business decision.

I and you are not eternal albeit you may have more time left than me (58 here).

Collapse
 
uniibu profile image
uni

For a native Frontend Developer that uses straight-up HTML/JS/CSS or for small projects, you may have some valid points there.
But for a Frontend JS Developer that uses modern Frameworks such as VueJs, React and Angular those points given are no longer a "caveat".

  • Size no longer matters because of the term "Tree shaking". It removes dead/unused codes making the size very small.
  • Js Frameworks allows you to choose only the components that you actually need.
  • And for the CSS, it is pretty much the same, you could pick only the ones you need.
  • Bundlers such as Webpack or Rollup or even Gulp also perform optimizations on your vendor assets.
Collapse
 
lexiebkm profile image
Alexander B.K.

Especially for a full stack developer, time constraint is one factor that determine whether to use libraries/frameworks or not.
I use React as well as several libraries for data entry, data visualization (charts, gauges) for dashboard and reporting (currently only PDF format). For backend, I use PHP + Laravel, and mySQL for database.
So I cannot spend much time to create GUI from scratch using only HTML and CSS. There are so many other things that need my attention in order that my app run as expected.

Collapse
 
codedgar profile image
codedgar

Totally right! I'm a native frontend developer 😄

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