3 ms·
Does anyone know why LESS was picked over SASS for Bootstrap?
by mrchess 15y ago
Does anyone know why LESS was picked over SASS for Bootstrap?
- joshfinnie 15y agoI don't know why, but if you are looking for SASS there is a fork: https://github.com/jlong/sass-twitter-bootstrap https://github.com/jlong/sass-twitter-bootstrap
- evilduck 15y agoI've been using https://github.com/thomas-mcdonald/bootstrap-sass/tree/2.0 https://github.com/thomas-mcdonald/bootstrap-sass/tree/2.0 for the last few days. I haven't encountered any problems. A big thanks to Thomas if you read this, a gem is way nicer than converting it myself.
- tmcdonald 15y agoMuch appreciated - it's nice to hear and see others using it. There's a few commits to catch up with on the 2.0-wip branch, hopefully I'll get some updates done and pushed today.
- latchkey 15y agoWhile Less and Sass are really similar products that do pretty much the same thing; I switched my site from initially using Sass (scss) to now using Less for three reasons: a) Bootstrap uses less and I'm using bootstrap. b) It was trivial to go from sass to less. Mostly just renaming files to have the right suffix. c) I'm sure someone can argue differently, but I really think that the mixin syntax for Less is significantly better than Sass. I don't use mixins all the time, but this is really important if you want re-usable code. With Less, you don't have to declare @mixin and then @include it. Instead, any less block becomes a potential mixin. That said, Sass has a compressor/minimizer and Less doesn't really have one. I had to integrate clean-css into my builds. It would be nice if Less had this by default.
- jmoiron 15y agohttp://markdotto.com/bs2/docs/less.html http://markdotto.com/bs2/docs/less.html Odd, it says that lessc can take --compress, but using the most recent version of less in npm says that there's no such flag. Maybe it's on the way, or the bootstrap authors know something we don't.
- latchkey 15y agoAh, that got me looking more closely. There is an option to use yui-compress and it seems with the 1.2.1 version. I use the shortened -x argument. https://github.com/cloudhead/less.js/pull/504/files https://github.com/cloudhead/less.js/pull/504/files
- mark_up 15y agoIf you're on a Mac, use CodeKit or its predecessor LessApp... it has a Minify feature. http://incident57.com/codekit/ http://incident57.com/codekit/ http://incident57.com/less/ http://incident57.com/less/
- roryokane 15y agorelevant documentation links on your point “c)”: http://lesscss.org/#-mixins http://lesscss.org/#-mixins http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#im... Sass, too, supports Less’s mixin model. Sass can include any block as a mixin with the @extend directive (http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#extend http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#ex...). Basically, if a block is going to be used in the HTML as well as elsewhere, you write it normally and then include it with @extend. If a block is only going to be included in other styles, you write it with @mixin and then include it with @include. I think Sass’s approach is better because it’s more flexible – if a style isn’t going to be referenced in the HTML, it doesn’t clutter up the CSS because it is hidden with @mixin. And if you like Less’s approach better you can just use @extend everywhere. The main reason I prefer Sass is the indent-based and semicolon-less Sass syntax (as opposed to the SCSS syntax). I find that that syntax’s advantages greatly outweigh its few weaknesses.