257 points · by nicc · 9y ago · 122 comments
It's only 12K minified and it includes everything you've come to expect from Bootstrap (that's now 120K minified). As a bonus, you get full _IE7_ support for all your friendly third world enterprise customers -- and no worries about responsive design because that's not supported at all!
I think things like this (Shoelace) are a great learning experience for the developer(s) in question or for fun throwaway stuff. You could make an argument for them for a team project where there's wide agreement, but for anything I will need to maintain or share with someone or hand off I pretty much only use Bootstrap as a starting point. Saves a lot of headaches down the line.
Don't know how big it is but it's very small and it's based on LESS so you can pick and match what you really need.
Used it with pretty good success since I like to roll my own (sorry!) and Bootstrap and others was a little to much Batteries Included.
Don't really agree with that as Bootstrap is also modular, especially if you use it from Sass or LESS source, which IMO is the 'right way' to use it.
(You can also make a customised build at http://getbootstrap.com/customize/ if you want to pick and choose modules but don't use a preprocessor like Sass/LESS).
TL;DR – most people just use the bundle because they don't want to setup a preprocessor.
I think this is a great illustration of the fact that, although some people intend to be derisive in their speech, we shouldn't assume that any designation whatsoever is intended as derision. That is, everybody needs to chill and assume the other person is making a good-faith attempt to be reasonably polite until proven otherwise.
[0] For example https://lancebachmeier.com/computing/j-b-test.html
img {
display: block;
max-height: 98vh;
max-width: 100%;
width:auto;
height:auto;
margin: 0.6rem auto;
padding: 0;
outline: 1px solid #333;
}I wouldn't really believe that 60kb vs 90 makes a huge difference. Website get bloated at a different place.
That makes no sense. IPoAC doesn't really care if you add a few megs of scripts and images. Hell, it doesn't care if you add a few gigs. It will load at more or less the same speed as a single text document.
> css variables
> 32KB (unzipped)
That said, I do love it though -- I have yet to dig into the CSS variables spec but I like that it offers near-bootstrap level functionality for a lot less size.
Compared to my usual go-to, https://purecss.io/ though, it's super duper heavy, a factor of 10. Then again, pure doesn't have as many nice-to-haves.
Also, I really like the height utilities... I find myself writing these two utility classes ALL the time:
.full-height { height: 100%; }
.full-min-height { min-height: 100%; }https://purecss.io/grids/#using-grids-with-custom-fonts
Am I really the only one who want to use another font than sans-serif with Pure? I had to hard-override the font on so many places just because sans-serif had such high specificity already.
Also I believe that Pure doesn't do the whole configure-with-sass thing -- though it can be customized, it's CSS only (https://github.com/yahoo/pure).
I wasn't aware of this shortcoming of Pure (maybe because I haven't used so many custom fonts), but I'm going to be keeping it in mind for the future.
My gut tells me you'll end up not using half the components that are included, and bend over backwards to make the config do what you want it to.
I much rather subscribe to the thinking in http://tachyons.io/ - just enough helper classes to create any layout you desire, and doesn't mess with defaults which means you can extend it to cover all edge cases.
It's not redundant, an element selector has a different specificity than a class selector. Much easier to maintain when Everything Is A Class (especially when paired with BEM, for very flat selectors). It's the reason Bootstrap stopped doing this.
Who cares if it's redundant? Classes are cheap and repeated strings cost you almost nothing after Gzip.
For that reason, I'll generally choose a <table>...</table> with a default style over having to do <table class="shoelaces-table">...</table> every time.
If you really do want to completely override the table style, it looks like it's just a matter of removing the respective line in https://github.com/claviska/shoelace-css/blob/master/dist/sh... and rebuilding.
Also, most modern browsers have a "developer" mode that shows exactly what CSS rules come from where. If the provided style really is getting in the way, it should be (relatively) easy to figure out what specifically is getting in the way (and then addressing it in your own CSS) instead of just blowing away the whole table style and starting from scratch. Looking at https://github.com/claviska/shoelace-css/blob/master/source/..., it doesn't look like it's doing all that much that'd be likely to conflict with anything in a way that would absolutely necessitate starting from scratch.
That's what we used to think when Semantic CSS was the big buzzword, lots of articles from '08-'11 preached it as the gospel. Turns out when a language is based on customizing presentation, presentation is semantic.
> I had a number of locations that I highlighted with a blue background and rounded corners. I called it `location` since it highlighted each of the locations
> When I opened the online store, I had a list of products and wanted to highlight each product using the same design pattern. Problem was, they weren’t locations. They were products. Being the lazy developer I was, though, I just reused the `location` class and applied it to my products. Clearly not ideal (but hey, it worked)!
> The design function was, of course, to highlight something. That was what I should’ve called it!
The new problem, though, is that in this case, if the developer wants to eventually use a different style for locations v. products, he'll now have to do the thing he was trying to avoid in the first place and have to create the new style.
If he stuck to letting HTML describe the content and CSS describe the presentation of that content, then when his tastes inevitably change, he'd just need to change one or the other class' styles in his CSS and call it a day.
This is even more relevant if you're using some kind of CSS preprocessor language (or whatever the term would be) like SASS/SCSS or LESS, since you can define that style as a mixin and apply it to each of the styles for specific content classes as you see fit.
Of course, what he did can still be compatible with HTML being content-declarative if you use a class like "important" or "special" or something; that way, you're still describing what the thing is without polluting HTML with presentation details. You can likely even mix that together ("important product" or "important location"), which would then pave the way for having unimportant products/locations.
> Turns out when a language is based on customizing presentation
Except HTML (especially HTML5) is not based on "customizing presentation". HTML is based on describing documents and the contents thereof. There were a few violations of that principle once upon a time (<b>, <i>, <u>, <blink>, <marquee>, etc.), but these are vestigial at worst (and outright eradicated at best), leaving a language that really is meant to declaratively describe content.
CSS is the language that is based on customizing presentation, and always has been (and hopefully always will be, though I can't wait for the day when CSS becomes Turing-complete).
I'd encourage users to generate their own CSS bundle, so you only pull in whatever styles you need. Myth looks to be unmaintained. You can achieve the same thing with postcss and cssnext [0].
Also, related to CSSnext — isn't the @apply spec idea dead? Does that make CSSnext “yesterday's vision of tomorrow's CSS” but not what we think the future of CSS will look like now?
https://discourse.wicg.io/t/needed-new-champion-for-css-appl...
and the linked http://www.xanthir.com/b4o00 ("Why I Abandoned @apply")
This definitely applies more to some things than others, but I think it's worth questioning, too. Does the thing still work? Was it great 3 years ago? Is there a reason it's less great now (other than that it was created 3 years ago)?
FWIW I based my blog theme on Skeleton. I must admit that the 3 year age gave me pause (irrationally, probably) and that it's worked out nicely.
How are you supposed to look and see what you need or what's available?
I think it really depends on personal preference. I have stayed away from using the larger CSS frameworks. I won't mention them because I don't think it's right to "call out" CSS frameworks when its just my own personal usage of some frameworks over others.
I will mention ones that I have used:
Bootstrap ( http://getbootstrap.com/ )
Semantic UI ( https://semantic-ui.com/ )
Skeleton ( http://getskeleton.com/ )
GetFlakes ( http://getflakes.com )
Milligram ( http://milligram.github.io/ )
HackCSS ( http://hackcss.com/ )
Furtive ( http://furtive.co/ )
BassCSS ( http://basscss.com/ )
w3.css ( https://www.w3schools.com/w3css/ )
Spectre ( https://picturepan2.github.io/spectre/ )
CaiuSS ( http://ionicabizau.github.io/CaiuSS/ )
I really like the stuff and fluff Spectre offers: cards, navigation bar, etc.
Pure's grid is what I use exclusively. Simple, easy, and targets the screen sizes I want,
I know this bills itself as a "reset" but when you look at the buttons, text utilities, spacing utilities etc it's far beyond that. In many cases it's just re-using Bootstrap's naming conventions and code. As far as I can tell there's nothing like Bootstrap's theme customization tool for it, so I'd have to do it all by hand.
In the near future, grid systems will be more and more obsolete (https://rachelandrew.co.uk/archives/2017/07/01/you-do-not-ne...), and Shoelace is prepared for that. Why add the weight if you don't need it?
If your target browser can't support CSS Grid it's probably too old to support CSS Variables (CSSS custom properties) anyway.
Not ideal, sure (especially if you're JavaScript-averse, like I am), but it's a start.
This PR will reduce the size down to 18KB.
It has styling for a navbar, panels, and empty states, which is quite neat.
Spectre has a flexbox-based grid, which I ditched in favour of Pure's grid simply because it targets the screen sizes I want: https://purecss.io/grids/
Shoelace,css is interesting. Perhaps I'll choose it for my next project.
It'll automatically handle github or npm packages or any custom setup if you need it.
For example: https://cdn.jsdelivr.net/gh/claviska/shoelace-css@1.0.0-beta...
jsDelivr has a lot more sponsors and a bigger network.
[0]: https://github.com/facebook/react/issues/10294#issuecomment-...
....what? Is this even valid CSS?
https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_v...
https://developer.mozilla.org/en-US/docs/Web/CSS/:root
Unfortunately since IE doesn't use it, most of us won't be able to either, as much as we want to :(
If you like Shoelace.css, would you vote it up on Product Hunt? https://www.producthunt.com/posts/shoelace-css
Thanks :)