306 points · by jdorfman · 9y ago · 149 comments
Things that I like about bootstrap are : stability, performance, easy custom builds, community support (almost every problem has been addressed on Stackoverflow), ecosystem (themes, extensions, tools). The design out of the box might look cookie cutter, but if you know basic CSS, it is very easy to customize it with minimal effort. Just lookup examples on codepen/stackoverflow.
Some people complain about bloat but this is amazing : https://getbootstrap.com/docs/3.3/customize/ . I have public facing websites with thousands of visitors per day. The performance rating is better than 90% of the websites.
Truly want to thank @mdo @fat @cvrebert and the rest of the team for this amazing project.
Thanks to Bootstrap, I've managed to build some very professional looking websites, coded entirely from scratch, all with my existing HTML/CSS knowledge.
Just a phenomenally useful framework for non-coders like myself.
But it's got a consistent look and feel to all components, and that look is a mile above anything I could design from scratch.
So in the same way you use it to build professional looking websites with limited HTML/CSS knowledge, I use it to build sites with very limited design knowledge and no sense of aesthetics.
Some engineers like to complain about 'yet another bootstrap template' a lot, and I can understand that it gets a bit dull and boring, but that's much better than the alternatives.
Still bootstrap has been amazing over the years.
After having used bootstrap for so long, I understand it's strengths & shortcomings quite well. I feel there's little to complain with bootstrap, and little to gain by ditching it. Would love to be proved wrong.
Basically bootstrap is not composeable. It provides not just a set of styles - but also a severely restricted visual design. People quickly run into elements that bootstrap was just not designed to be placed into. That's why there are so many forks/extensions of bootstrap, like bootstrap-admin and so on.
So its good to start with and follow the official style guide. But doing anything more, and the restrictions immediately bubble up. And then you quickly run into an entirely different set of problems on organizing your own CSS, like using SASS, BEM, etc.
Its not a question of OOCSS vs BEM, but more of how tolerant/accomodative the framework is in using it in different elements and contexts. Bootstrap's tolerance is relatively low compared to most other frameworks.
For creating a quick and dirty project it's great. But after a while you find you end up using less and less of bootstrap because moulding it to your requirements becomes a burden. That's prob why you rarely see big complex sites using it.
There's nothing worse than using react or angular and then someone pulls in a library to have a bootstrap control that breaks stuff and doesn't work and is hard to style. Spend hours trying to get it working properly beyond the most basic implementation of the control.
I prefer bulma because it focuses more on the basics and doesn't get in the way. Even after you create stuff you can shape and mould t easily.
I can take the BS source, comment out half of it and end up with Bulma. If I started with Bulma, I'd have to write lots of code to end up with a framework that rivals BS.
All these issues go away with bulma.
No tool to customise theme is great. I don't want a bootstrap looking theme. It gets in the way... bootstrap is structure and styling throwing in the kitchen sink and half the house but not adding any doors or windows and you can't hide a builder to add more without it costing a kidney.
I find full frameworks like bootstrap or quasar to be nicer to deal with.
I think people really au fait with CSS prefer to add only what they need rather than serve Bootstrap entirely.
Edit: And can be easily customized.
https://github.com/kbariotis/kostasbariotis.com/blob/master/...
I can just include what I need and override what I want.
https://github.com/twbs/bootstrap/issues/20184#issuecomment-...
That still doesn't address the overall point, which is that Bootstrap 3 is no longer maintained, according to its project Owner, and this or any future vulnerabilities may or may not be patched. That seems like a significant risk to me.
1) Every class name is prefixed with "uk-": a wise decision to avoid conflicts and make it easy recognise the framework classes.
2) Useful generic classes: UIKit has many helper classes to avoid adding another rule—for removing padding, introducing a small margin, rounding the borders, adding a box shadow.
3) Clean theme: The default UIKit theme looks an order of magnitude better than Bootstrap's.
4) Additional helpful components: Loading spinner, Cards, Notifications, Sortable list. Shipping them by default saves a lot of time in searching and integrating them in your application.
5) Default Icons Support: The icons look clean and beautiful and because they are SVG, they don't require a font file. (Although, requiring Javascript can be turning off for some)
6) Much better components: Try creating an input box with an icon in bootstrap; with UIKit it only takes a little markup.
Whenever I develop with Bootstrap, I have to spend half the time muting the existing styles and introducing new ones. With UIKit, it never felt like a problem.
2) Bootstrap 4 includes dozens of utilities like these and more. Still have some to add, but there are tons.
3) Our theme state is busted in the beta it will be there for final. Open to feedback!
4) v4 has cards. Spinners are slated for v4.1. Toasts are slated for v4.2 I think. Peep the project pulls page :).
5) Everyone else does amazing icons. We pulled our icon font out long ago in v4. Use any SVG library.
6) That’s a solid idea. Care to open an issue for it!? :D
Take a look at the new v4 beta docs and let me know what else is missing or cumbersome for you, please. <3
UIKit has many CSS classes with hover states but not focus states and it's not easy to add them to classes like .uk-hidden because it's not a direct declaration but relies on a parent class. It lacks an equivalent to Bootstrap's .sr-only (visually hide but expose content to screen readers); you can always add such a class yourself but it makes the UIKit framework incomplete. UIKit makes it harder to make a site accessible than if UIKit was not used.
CSS Frameworks are supposed to make the job easier by taking care of problems you're not even aware of; UIKit fails to do that in this respect.
And nope just text. Grey low contrast text.
Once you change the stylesheet the components look ok. Still lot of let's-replace-icky-tables-with-divs.
2) BS 4 added a ton of helper classes, to the point where I find myself using these rather than writing custom CSS.
3) Ultra light font weight, light gray font color, capitalized text might look great, but I prefer better usability. The point with BS (as of my observations that is) has always been to provide a no-bullshit™ style. It doesn't follow trends, it does what's sane.
4) I half-agree. Not sure how useful it is to have "notifications". I personally never needed that and doubt their usability on mostly document oriented websites.
5) BS used to come with icons, but now there are tons of icon sets to choose from. BS is a CSS framework after all.
6) Besides that, what components does UIKit have that BS can't do? Maybe sticky behavior with a delay would be helpful.
BS is 125 KB vs UIKit 256 KB minified though (that's only for CSS), besides all the accessibility issues.
Though IIRC, Apple's UIKit came out a year after the web UIkit.
.uk-list>li::before, .uk-list>li::after {
content: "";
display: table;
}
Yikes, it's this mixing class/element/combinator-style styling that BS4 did away with. Granted, some of it was still in 3.Personally I agree with the complaint about BS that all sites built with it look similar and honestly, bland.
A framework really can't offer semantic classes, since it doesn't know the semantics of your app/page.
Huge thanks to the contributors and our team for pushing so hard recently. Feels amazing to have a beta out finally.
1. Do you still use a global, class-based, cascading CSS framework like Bootstrap, Semantic UI, etc, to provide baseline styling/theming for your pages and components? And if not, do you just essentially roll your own custom CSS framework in JS? Or are there styling frameworks out there that don't cascade and can compose more naturally with component-oriented approaches to styling?
2. If you do use cascading CSS frameworks in addition to something like styled-components, what are your approaches to limiting the unpredictable side-effects of cascading styles, dealing with specificity and load order issues, and ensuring proper style isolation inside your components?
It seems like using a cascading styling framework could defeat much of the purpose of using a well-isolated component-oriented styling library.
Although on the other hand, the alternative of writing all styling on my own seems like a futile exercise in reinventing a vastly inferior wheel, since so much designer talent has been poured into projects like Bootstrap to the point where an amateur designer like myself could never even approach the same level of polish, flexibility and consistency in their designs.
I'm hoping someone here could enlighten me on a better approach that takes the best of both worlds, or at least share a middle ground they're happy with?
2. This hasn't been a problem. Most of the global styles are based on tags, and classes are already more specific. The legacy class-based stuff is all hash-based too, so there's been no conflicts.
So far I'm enjoying the component-based approach. Render functions look much cleaner and you abstract logic that might have previously looked like
classnames(styles.btn, {
[styles.active]: isActive
})
to ({ isActive }) => `background: red`
Which lives in a totally different file.On one hand I don't think I've done enough to reuse styles across components but on the other hand I know I'm never loading styles that aren't used specifically for the current render.
1. This is one such component based styling framework built on top of styled-components. http://jxnblk.com/rebass/
2. In many of the solutions that exist I have found that they aim to work very well with existing CSS as much as possible. I haven't had to deal with many issues. Hopefully by the time I start switching entire projects over to it, everything will be completely stabilized.
https://www.webreflection.co.uk/blog/2016/04/22/about-jquery
Lots of folks like to shit on jQuery these days, but it changed JS forever. We're still using it while focusing on other things, and you can easily swap it out for something else or use a ported version of our JS for React, Angular, etc.
In short, yes, and we'll get there in time <3.
I don't particularly aim to shit on it, but I've been on the vanilla train for awhile now. So when I see something I'd like to try out to solve a specific problem, having it pull in jQuery for a dependency is kind of frustrating.
Especially when (and I'm sure Bootstrap does more with it) the only reason it's pulled in is to replace document.querySelectorAll and fetch/xhr.
Very exciting! I have been slowly removing jQuery from many web apps over the last several years and its good too hear that Bootstrap wants to get there too :)
Now obviously removing jQuery would be a major revision and break the current API. But are there any particular pain points in removing jQuery as far as features go?
A cursory look at the source code (/js/src/*.js) shows that most jQuery usage is simple $(el).hasClass('foo') or $(el).on(evt, handler) so those ones are easily replaced by the native APIs.
Maybe the harder parts to replace are $.data or $.event?
If by some miracle you were able to find a website visitor that didn't already have jQuery in their cache, loading it from a CDN is pretty light.
The article answers your question:
>the most plausible answer is that jQuery is very good at plugins integration, and Bootstrap has few of them
Their solution? A 50-line JS snippet paired with a polyfill (the the user is less-likely to have cached than jQ). Er, ok, but I'm using a framework so I don't have to write this stuff.
Another example:
>OK, OK … I got it, you also want the chained $(element).on(type, handler) one
And then another snippet. Sure, I could rewrite more verbose, less-tested versions of all the things jQuery gets me OOTB, but why? To save downloading one file from a CDN once?
Sorry, that's my bad for forgetting my audience. My day to day job is to keep things running in IE8 in Quirks Mode. (With a really bad WYSIWYG editor to boot, inside of one of over 30 frames loaded on the page)
So in my eyes, IE10 is pretty modern. Not so to the average HN reader. My bad.
Still, IE10 is definitely close enough to standards that most of jQuery is wasted on it. Not all, and the parts that are helpful are indeed better tested than writing something yourself.
But I find once you start targeting IE10+, most of the time jQuery is a thing to hang pseudo globals off of, and a way to type `$` instead of `document.querySelectorAll`. And in that role, it's not worth the cycles it burns.
EDIT: In particular, the thing that gets me is when I go to look up a library and it is only available as a jQuery plugin. But looking inside the code the only uses of jQuery are for selectors, events, and http requests, all three of which are standardized and easy to use without jQuery.
It's in your cache because it's useful; at least your concede that it is likely to be in a user's cache, in which case the added page weight is 0.
Seeing as my argument was so terrible, I'd think you'd have an easier time forming a substantive reply, vs the struggle we see here.
I don't really understand the value added in your personal attacks.
Building Bootstrap 4 from source (which is what you want to do for your own themes and customizing) requires a somewhat hefty npm install due to babel, autoprefixer/postcss and clean-css, and in particular due to node-sass which is using libsass/node bindings, thus requiring gyp and Python. I'd imagine a leaner setup based on a precompiled sassc binary for SCSS processing could be useful.
Considering Bootstrap does not support the same browsers that CSS Grid does not work in, this argument doesn't stand.
http://caniuse.com/#search=grid
If you look through the stats of every unsupported browser in the list above, almost all of them are %0.x. Adding them all up still gives you single digits. And with Flexbox as a fallback, you're covering virtually all modern browsers.
I really hope you consider adding this last feature to Bootstrap 4 as I truly believe it will be worth the effort.
If I was going to offer a contribution myself, it might be to work on removing the jQuery dependency.
Additionally, semantic UI deserves the scorn of a thousand linguists for the most misleading (unsemantic? or even antisemtitic?) product name ever: there is nothing semantic about class="col-xs-12 col-m-3 col-x-1"
I mean I can write CSS from scratch and make it responsive, but it generally looks awful without having a designer.
But using bootstrap I can use a default layout, and the default components and it looks respectable.
I rarely use semantic for its grid though. Those are now easy problems to solve. I use it because it gets me a clean and pretty UI I can theme later to adjust the specifics (or get someone who is better at design than me to do it).
I've never heard of bulma until this post so I will give it a look.
I worked with Foundation 5 + 6, Semantic UI, Spectre, Bulma and Bootstrap 2 + 3 (and some more lesser known Frameworks) and I must say that the Bootstrap 4 team really nailed it. All the other frameworks are good, but this is just great to work with.
Took a look at Foundation, and the new XY Grid is really really nice and much better than the current Semantic grid.
https://www.youtube.com/watch?v=Xl5DjEzKn1g
I especially love
1. It also works for Y 2. how you specify responsive, "small-4 medium-6 large-2" means on small devices 4 wide, on medium 6 and on large 2 wide. This makes layouting responsive much easier.
https://getbootstrap.com/docs/4.0/extend/icons/
Then again I am equally shocked that there are so many competing icon sets that look promising.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
The css given in their docs has an invalid integrity hashThis is the correct hash:
sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M
Edit: someone has already filled an issue, beating me by 3 minutes: https://github.com/twbs/bootstrap/issues/23284Functional CSS helps us maintaining large scale component-based project fairly easily. You have to know CSS though.
Useful for marketers or authors without coding experience to build pages within a restricted CMS (they can't edit all the code, but they can add classes to components).
Most of it is not components, though; most classes are just a single CSS property and value. This easily bloats into a maintenance nightmare:
<footer class="bg-white black-70 ph3 ph5-ns pv5 pv6-ns bt b--black-10">
...it's the reason we moved to modular CSS instead of having a style attr on every element.It has its place, but something like Foundation is more appropriately considered an alternative to Bootstrap.
It has Flexbox!!! Although our team has added additional classes to get some of the UI done, I am sure, we could have done it using only Bootstrap. We get lazy :P.
The primary reason I like Bootstrap is because of the semantics. Columns are col, Tables are table, Cards are etc. Primary is main action, Danger is error etc. etc. As they say in UX, "Don't make me think!"
Congrats and a massive thanks to anyone who has been working on this fantastic project.
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">Tooltip with HTML</button>
https://getbootstrap.com/docs/4.0/components/tooltips/in bs3, there was no easy way, you had to basically use javascript to achieve it.
<button class="btn btn-default btn-spin">Click Me</button>
I been waiting for something like this to be achievable for some time now.
Bulma has this perfected and it really is handy.
Implementing that .btn-spin yourself wouldn't be too hard either, couple lines of CSS...
I personally don't work on any sites small enough to ignore all the browsers without Grid support yet.
I eventually moved over to bourbon.io with the help of one of the core contributors.
I'm getting a "Bootstrap dropdown require Popper.js" error
The thing I'm most excited about is the flexbox grid.
What's next, ads in the source code?