9 ms·
Why Sass?
- bwilliams 13y agoToo bad SASS didn't help out with their indentation problems.
- mokkol 13y agoI love sass but I don't like the scss syntax that much. Im happy to stick with the sass syntax :)
- snide 13y agoI feel the same way. Maybe it's coming from being around so many Python engineers, but the indented format just seems so much more readable to me, outside of not having to worry about all the bracket junk that clutters the syntax normally. I totally understand the reasoning to move towards scss though, and it's easy enough to flip between them.
- woah 13y agoYou should try stylus
- mokkol 13y agoMore or less the same as sass right?
- welly 13y agoYou don't like the SCCS syntax that much? So you're saying you don't like CSS syntax that much then? Because that's what it is.
- mcmillion 13y agoThe biggest issue with SASS is the non-optimized output you get (i.e. combining similar media queries, etc.) That being said, it's still an absolutely amazing tool.
- austinpray 13y agoWell, the similar media queries and repetitive output are eaten for breakfast by Gzip and such. I worried a lot about CSS performance when I started using SASS. I quickly found that CSS is so fast I am better off spending time optimizing my JS and images.
- leokun 13y agoWish it would at least mention why they didn't even consider less, which I prefer to sass, since it still resembles css and is a superset, so you can turn any css easily into less. Great for switching over to less from css with an existing project.
- oe 13y agoAny language where you can avoid curly braces is superior to those where you can't. (Really, it helps with my RSI :) Of course if you have existing CSS it might make sense to use LESS / SCSS.
- zimbatm 13y agoscss (the CSS syntax of SASS used in the article) is also a superset of css. http://css-tricks.com/sass-vs-less/ http://css-tricks.com/sass-vs-less/
- leokun 13y agoThis is true.
- brandonbloom 13y agoI can only assume you grepped the article for Less, then came here to complain. The article explicitly mentions SCSS and points out that it is a superset of CSS. SASS' original (and still available) indented syntax isn't shown.
- Jgrubb 13y agoEver since ALA's redesign, the header has looked like this for me - http://i.imgur.com/CcpjRHV.png http://i.imgur.com/CcpjRHV.png It's in Chrome and FF on a Mac, and it's been this way for months. I assumed it was a bug that they'd catch, but I guess I'm the only one seeing it this way?
- wmeredith 13y agoIt's that way on purpose. Yes, seriously.
- Jgrubb 13y agoWhat an incomprehensible design decision for a site targeting front end devs and designers. Is there any explanation out there? Google doesn't give me one.
- selmnoo 13y agoI remember reading a comment on Reddit a few months ago that talked about how some of the very ridiculous things we see on fashion runways like clothes that almost literally look like garbage bags, things that really make you say "wait, are you serious?" actually legitimately make a lot of sense to fashion pioneers. I suppose it must be like an acquired taste type thing, like fine wine, delicacy foods, fashion choice, etc. I agree though, that insofar as good design is really about communicating information to normal people, A List Apart just dropped the ball there. Maybe the fact of the matter is that the elite designers sometimes get bored that they never get a chance to let their creativity out? I'm not sure, just thinking out loud. :)
- dictum 13y agoI never thought I'd have the opportunity to act like a fashion designer on HN, but here it is: It's that way because they want it—Jeffrey Zeldman and the ALA team. It's their playground. It looks like that because it's striking. Gets the people going. Made you look. Got you mad. It breaks the mold of traditional website design: | Logo | Nav | |----------------------| | Content | | Additional info | | Editorial info | ...and replaces it with the vertical design of book pages, with some clues from magazine design (like the header that's only partially shown). Ever read a magazine that had text on the page margins? There's a place for purely functional design, and there's a place for experimental design.
- csmuk 13y agoI still refuse to use Sass or LESS. 1. Tooling integration is a PITA, especially with Visual Studio. 2. Nothing but trouble merging the stored output from the tooling if you are in a branchy development. Basically, merge the CSS, then run sass/less and check in the change. Too much friction on a large project, especially when it comes to a non-Sass/Less dude doing the merge. 3. Parsers are both shit. Sometimes attributes don't get "understood" properly resulting in compile errors and point blank refusal to work. 4. Hacks used for older browsers aren't parsable by either. 5. It's another layer of abstraction. Less abstraction decreases debugging effort. Sorry but I don't buy it despite the promoted advantages.
- lmm 13y ago> Nothing but trouble merging the stored output from the tooling if you are in a branchy development. Basically, merge the CSS, then run sass/less and check in the change. Too much friction on a large project, especially when it comes to a non-Sass/Less dude doing the merge. Wtf? You don't check generated files into VCS. You check in the source sass/less, and do the generation as part of the build process.
- masklinn 13y agoChecking generated files can be useful for simpler projects so you don't have a remote build. There is no bloody reason to merge it though, just wipe it, merge sources and regenerate.
- csmuk 13y agoActually no it doesn't work like that. It's really a pain in the arse for windows users like myself who are part of more than a one man team. What happens is, you get three options: 1. Deploy Ruby, Sass and associated dependencies to every workstation, build agent, test machine etc. Deploy tooling and build integration to the above so that any changes to .sass files in the IDE and build process get reflected on disk in the VCS. Educate every developer who touches the project on what they are, how to manage them effectively, the rules around merging etc. -or- 2. Do the above but ship the entire Ruby VM and libraries in your VCS. -or- 3. Get random build failures company-wide, old versions of generated CSS files and crap floating around and being checked in by developers, half arsed merges and just pain. I'll pick option (4) which is don't use it. I've been at ALL of the above steps. We have removed it from our product. Life is better now.
- mattberg 13y agoOne of the tricky things for me has been in the handoff from HTML template developers to CMS integration developers. The way we currently have things setup, the developers doing the CMS integration no longer have the ability to make small/quick changes to the main CSS file. It actually has to go back to the HTML developers for the revision, recompile the CSS, then back to the CMS developers.
- joshuacc 13y agoWhy can't your CMS developers edit the Sass file and compile it themselves?
- mattberg 13y agoA lot of it is environmental issues. Currently the codebase for the CMS developers is managed by global TFS repos. While the pure HTML templates are done by each local office in SVN repos. Good times.
- lightblade 13y agoI am a non-believer, even when I have to use it everyday at work (the technology wasn't really my choice). I feel that sass is like an amplifier of css. It doesn't actually solve any of the short comings of css. It enhances the features of css, both good and bad parts. I really want css preprocessor that is non obtrusive. So that the file could still be parsed as valid css. Any feature enhancements used by the preprocessor just get ignored by the engine.
- timme 13y agoAs someone else has mentioned: SASS is an amplifier. If you hate or don't get CSS to begin with, stay the hell away from SASS. If you do serious work with CSS, SASS will probably help you solve things better.
- Mithaldu 13y agoHis elevator pitch doesn't sell for me. The color thing is correct. Having an easy way to handle that is neat. Right now i use templating, which serves fairly fine. However the reusable block makes no sense. That's what multiple classes on an element and selector lists are there for. I can't tell if SASS will still help me, since this is merely a bad example. So it could mean that either he didn't think that through, the book isn't very good because of his lack of understanding, or that SASS is mostly fluff.
- awj 13y agoOther things that SASS does well at: * Wrapping up vendor specific properties. Put all of them into a mixin, use arguments for the value and any edge cases, be sure that all vendors are covered properly at each usage site. * @media directives in SASS can be used inside a style definition.[1] IME this makes heavy use of media sensitive styling significantly easier to read/manage. * Nested rules and nested properties[2] help to make your styling cleaner. If your html already has a very component-like structure nested rules can mimic that, which makes the overall design easier to manage. A lot of the functionality of SASS is geared around reusing bits of styling. Much of what you can do with it could also be done with multiple classes, but that generally comes at the cost of a class explosion as you parcel out the differences. It makes it easier to move more of the declaration of how your styling works into CSS itself, instead of the final styling being almost equal parts html (and classes) and CSS, with you as the developer/designer being responsible for remembering how all of the details fit together. [1] http://sass-lang.com/documentation/file.SASS_REFERENCE.html#media http://sass-lang.com/documentation/file.SASS_REFERENCE.html#... [2] http://sass-lang.com/documentation/file.SASS_REFERENCE.html#nested_properties http://sass-lang.com/documentation/file.SASS_REFERENCE.html#...
- adamb_ 13y agoFor me, the big value-add of CSS pre-processors is nested rules[1]. [1] http://lesscss.org/#-nested-rules http://lesscss.org/#-nested-rules
- axblount 13y ago> Or how about repeated blocks of styles that are used in various locations throughout the stylesheet? p { margin-bottom: 20px; font-size: 14px; line-height: 1.5; } footer { margin-bottom: 20px; font-size: 14px; line-height: 1.5; } I don't know why this situation is a such a common example of the need for SASS & company. It's easily addressable with plain ol' CSS. No mixins required. p, footer { margin-bottom: 20px; font-size: 14px; line-height: 1.5; }
- IceyEC 13y agoSo how would you reduce this version: p { margin-bottom: 20px; font-size: 14px; line-height: 1.5; } footer { position: fixed; margin-bottom: 20px; font-size: 14px; line-height: 1.5; }
- shawabawa3 13y agop, footer { margin-bottom: 20px; font-size: 14px; line-height: 1.5; } footer { position: fixed; } btw I'm totally pro less/sass, but that example sucked :p
- axblount 13y agop, footer { margin-bottom: 20px; font-size: 14px; line-height: 1.5; } footer { position: fixed; }
- toggle 13y agoI think doing it with SASS makes it cleaner when there are some differences between p and footer. So, instead of this CSS: p, footer { margin-bottom: 20px; font-size: 14px; line-height: 1.5; } p { text-align: justify; } footer { border: 1px solid black; } You could do this SASS: @mixin default-type { margin-bottom: 20px; font-size: 14px; line-height: 1.5; } p { @include default-type; text-align: justify; } footer { @include default-type; border: 1px solid black; } I like that last one better. It's like everything that describes what the footer looks like can be contained in the single footer block, rather than having many parts of your stylesheet apply to the footer and saying "this applies to both p and footer."
- nilgradisnik 13y agoI was a non-believer in preprocessors for a while until I actually started using one. Writing HTML and CSS can be a pain, so much repetition and closing tags/brackets for something that's just a markup/stylesheet language. I've been using Jade and Stylus for while and oh my god how much faster you can write stuff and how quickly you get spoiled by it.
- tomcdonnell 13y agoWhy Sass indeed, when all that can be done with Sass, can be done with plain old PHP? Example: style.css.php <?php header('Content-Type: text/css'); $brandColor = "#fc3;\n"; $defaultStyles = <<<STR margin-bottom: 20px; font-size: 14px; line-height: 1.5;\n STR; ?> a { color: <?php echo $brandColor; ?> } nav { background-color: <?php echo $brandColor; ?> } p { <?php echo $defaultStyles; ?> } footer { <?php echo $defaultStyles; ?> }
- krapp 13y agoThis makes it impossible to deal with the CSS without also having to deal with server-side coding, though.