Thoughts on LESS or SASS

  • Started
  • Last post
  • 17 Responses
  • crillix

    Was wondering if any of you guys where using either of these, and your thoughts on them. Have you found it made a huge difference in your work flow, gripes about them etc etc.

    My boss seems to really want us to give it a go, and ironically he doesn't write a lick of css. Myself and the other guy that do the heavy CSS lifting don't see a need for the switch necessarily based on the type of projects, but I figured it was worth seeing how other people found them.

  • hereswhatidid0

    Take a look at both, they're nearly interchangeable if you are comparing LESS to SCSS (variant of SASS). Also, check the frameworks that you use (Bootstrap, Foundation, etc..) as they may have one specific language they primarily support.

    Either way, making the switch to a preprocessor will be a massive boost to your development. Being able to use mixins, variables, imports is amazing.

  • ideaist0
  • Nathan_Adams0

    I use LESS on every project now.

    Whilst I don't go crazy with the deeper features, just the addition of variables is enough to make the switch. I tend to set up variables for all the site colours, type styles and some common widths/heights, so that they can easily be re-used. Also makes it much much easier if one of those needs to change, as you just change the original variable and done.

    • i can see how that would be a welcome featureprophetone
    • Because Find and Replace in a CSS file is so hard to do?mg33
    • that's what i do now, find/replace. also group things together nicely. worked so far.prophetone
    • Who said it was specifically for designers? It's for people that create stylesheets.hereswhatidid
    • <-- wrong threadhereswhatidid
  • albums0

    I've always been a LESS man but a fellow more technical developer has been trying to get me to SASS for the past year.

    I'm a simple user similar to what N_A stated.

  • d_rek0

    Full disclosure: I'm sort of a half-assed web developer. But I do plenty of web design and I find myself building smaller sites (mostly static with some wordpress) a couple times a year.

    As a designer the benefit isn't really apparent to me for small sites, and it really confuses the shit out of me to have master css files and also LESS/SASS files with their own set of variables, etc.

    TL;DR. It's really confusing to me.

    • A few of the WP projects I did used LESS. I felt like I was basically doign twice the work to update the CSS and also the LESS markupd_rek
    • LESS markupd_rek
    • you may like this
    • You should never be updating the CSS files directly. They should be handled by a preprocessor (CodeKit, Mixture)hereswhatidid
    • Can't help but think css preprocessors feel like a developers solution to a developers problemd_rek
    • It IS a developers solution to a developers problem. Build more than a couple sites a year and you'll need it.hereswhatidid
    • So then how does it help a designer?d_rek
    • i can see how that would be a welcome feature
      – prophetone1/4
      Because Find and Replace in a CSS file is so hard to do?
      – mg332/4
      that's what i do now, find/replace. also group things together nicely. worked so far.
      – prophetone3/4
      Who said it was specifically for designers? It's for people that create stylesheets.
    • Who said it was specifically for designers? It's for people that create stylesheets.hereswhatidid
  • d_rek0

    This guy sort of sums of my feelings on using CSS preprocessors.…

    " are just adding another layer of abstraction between you and the interpreted stylesheet..."

    Hitting the nail on the head right here.

    • no, it makes writing CSS the way it should befourth
    • interesting articleprophetone
    • "The way it should be" is totally subjective?d_rek
  • fourth0

    I love using less. I'm a dumbass (don't have a programming background) so I found it to be confusing at first. Just started using variables, mixins for vendor prefixes. I love it simply for those two features. Saves a TON of time. I love being able to do 1col + 5col + gutter instead of constantly adding up pixels. I also like doing calculations for color– setting up monochromatic schemes, picking a color wheel, etc. I've been using gaurded expressions as well.

  • meffid0
  • mg330

    I know enough CSS to get done what I need to do on sites. If I get stuck I'll find tips online and eventually figure it out. Anyhow, I read some general stuff on LESS and SASS, and walked away with one main thought: someone made them up to solve a problem that didn't exist, and succeeded in convincing some people they had that problem, and that doing what looked like twice the work would solve that nonexistent problem.

    Seriously though, maybe there's a great reason for it, but the need for them to me implies that there's something awful or lacking about a CSS file, and what it's intended to do.

    When I saw CSS examples that had this stuff tied into them, the CSS selectors when using less or sass were just about the same length as CSS not using them. So what's the payoff?

    • this article does a good job of explaining LESS benefits http://www.sitepoint…albums
    • @mg33 That was my initial thought as well. There are some nice little things like vars but overall...crillix
  • Juddly0

    We use SCSS here at work. I love it:
    - Variables to reuse (eg. colours, column widths)
    - Mixins (common chunks of styling, with variables.)
    - Nested styles are amazing if used properly. Fuck writing the id selector before every child you want to style...
    - Simple maths / colour hue/sat etc.

    Takes a little getting used to but has sped up our workload a shitton.
    Never ever open the CSS file, all handled by preprocessor.

  • Stugoo0

    For a long long time I was adverse to pre-processors, simply because I think that it breeds bad habits. With that being said, now, whenever I go back to an old project I set aside a couple of hours to rework the stylesheet into SASS.

    My first experience with it was a terrible set of over-nested declarations with overused mix-ins and confusing variables, unthoughtful class structures etc. However at the start of the year I used stylus for the first time in a project, and now I use SASS because as a freelancer it tends to be the pre-processor of choice for any agency I work for and now I really see the benefits:

    1. it's good for modular development you can split out files into modular blocks and worry about having to concatenate and minify later. The files become production ready quicker.
    2. It makes maintaining colours, fonts, and media-queries much much easier.
    3. It makes maintianing breakpoints in CSS easier
    4. Writing vendor prefixed code becomes easier

    However I have found that pre-processors can really breed bad habits. I have also spent a long time understanding how to write clean, efficient and object orientated CSS and making sure that this translated into my stylesheets from SASS took a little bit of time.

    Furthermore I tend not to use mixins and functions, with the exception of vendor prefixing. I only nest one or two levels and keep declarations clean and concise.

    Despite what I am saying above and listen to people re-regurgitate the 'omg it's CSS like it was intended' I do not want to depend on it. I feel the same way about jQuery, and have subsequently learned (learning) JavaScript.

    What makes CSS and HTML so good is that you really need nothing to get started pre-processors may increase your workflow but goddammit, make sure the output is efficient.

  • crillix0

    Thanks for the feedback on this guys, sorry meant to come back this sooner but was tied up all day.

    The use of variables to maintain colours, fonts, and other things is definitely appealing. Just can't help thinking that as CSS3 solidifies and becomes more broadly supported these CSS pre-processor solutions could have a bit of a shelf-life. At least for some things.

    Also curious on any problems debugging your css with level of abstraction, or is it only tricky if you get crazy with mixins and functions?

    Again appreciate the feedback!

    • Inspect Element in FireFox or Chrome is your friend. Also, most preprocessor apps will warn you of actual errors.hereswhatidid
  • boobs0

    It seems like every time someone makes a software tool to make writing other software easier, it causes two problems:

    1) It takes time to learn the new tool. Which could be better spent just increasing skills on the original software.

    2) The new tool writes overstuffed voluminous code.

    So, I have a lot of skepticism about using software to work on other software. Especially when the original software (CSS) is so simple and straightforward.

    • 2 doesn't apply to less/sass, it actually improves your workflowernexbcn
    • LESS / SASS are not dreamweaveralbums
  • hereswhatidid0
  • Hombre_Lobo0

    Drek and boobs echo my thoughts.

    For me using CSS is fine at the moment (although I would love variables). Having to learn sass or some other CSS tool seems like more unnecessary effort, which for the type of work I do, wont produce much gains.

    It's not the same thing but a bit like responsive frameworks, why learn them when making your own framework isn't that hard.

    I should probably try it out and stop guessing without first hand experience. I'd love to hear more peoples experiences with it though as I keep reading more and more about it.

    • block out a couple of hours to understand the semantics and move onalbums
    • Ywh man I might do.Hombre_Lobo
  • Noggin0

    We just switched to SASS at work, the advantages are great, structuring your code like the DOM tree takes some rethinking though.

  • Weyland0

    Switched to SASS half a year ago, using Scout to compile css and some other stuff to compress it further for production

    the use of imports and variables really makes it worthwhile for us

    • recommended if command line building puts you off like me ;)Weyland
    • Yeh man, command line makes me feel stupid!Hombre_Lobo