Live data from Hacker News

Stepping Away from Sass

cathydutton.co.uk

11–20 of 157 posts

Re: Stepping Away from Sass

#11
post #6

Hi, undergrad here. That is to say, I’m not anything close to an expert in web design, but just in the course of making a simple static website to show recruiters I realized a lot of lessons like these about how modern HTML/CSS/JS can really handle anything you throw at it without having to worry about frameworks or precompilers. Sure, Bootstrap and SASS helped get a prototype up fast, but I feel like that gain in pr…

JS, no. A hand rolled framework is going to be a hindrance the more feature-ful your site becomes.

OTOH, css frameworks go the other way. The more you have to do, the more apparent that bootstrap etc. get in your way, largely because css isn't a "complete" language.

I know some few who swear by them, but the majority of people I know who did html/css exclusively for years feel they can write by hand anything they would want from bootstrap in less time than they would waste in fighting things like selector specificity and other inflexible choices.

YMMV of course, and you can pry postcss + preset-env + mixins from my cold, dead hands.

Re: Stepping Away from Sass

#12
post #7

I honestly have never seen the value in pre-processors when writing CSS. I think they abstract a lot of low-level understanding of your UI and make your stylesheets overly complex. They definitely keep things sane when doing CSS at very large scale (for example dealing with color palettes, fonts, etc) but are not that useful when you're writing different components with different rendering needs. Nowadays I just do f…

> I honestly have never seen the value in pre-processors when writing CSS. As mentioned, theming and consistent ux requires far less writing and copy paste with a preprocessor than in pure CSS. I think React's approaches make CSS feel simpler but often just sweep the inefficiencies under the rug. A lot of this is being fixed with CSS4, so these will go the way of jQuery. And while you don't need jQuery today, it serv…

> A lot of this is being fixed with CSS4

CSS4 won't have nesting. SCSS isn't going away as long as nesting isn't a thing in native css.

(Also css variables are awful to use. Honestly, CSS-WG should have just copied most of scss's syntax)

Re: Stepping Away from Sass

#13
post #6

Hi, undergrad here. That is to say, I’m not anything close to an expert in web design, but just in the course of making a simple static website to show recruiters I realized a lot of lessons like these about how modern HTML/CSS/JS can really handle anything you throw at it without having to worry about frameworks or precompilers. Sure, Bootstrap and SASS helped get a prototype up fast, but I feel like that gain in pr…

It is a bit of catch-22 IMHO, for some. If you're very experienced it is just as easy to roll your own (although others may not onboard as quickly compared to well known libraries). If you're not very experienced then if you try to roll your own it may wind up being a mess. I'm in the middle and once I understand a library well I know its limitations and use its components as they were intended where I won't have to customize them too much, and roll my own components for the rest. This largely sidesteps the issues I used to have of wrestling with UI frameworks. I hope that helps.

Re: Stepping Away from Sass

#14
post #6

Hi, undergrad here. That is to say, I’m not anything close to an expert in web design, but just in the course of making a simple static website to show recruiters I realized a lot of lessons like these about how modern HTML/CSS/JS can really handle anything you throw at it without having to worry about frameworks or precompilers. Sure, Bootstrap and SASS helped get a prototype up fast, but I feel like that gain in pr…

> Is this a common pattern in industry as well?

It is on the server-side (php, python). Sophisticated apps can easily outgrow a particular framework. Though, I think php frameworks are pretty mature these days and this is less of an issue there than it once was.

Re: Stepping Away from Sass

#15
Everyone forgets that SASS is meant to be programmable CSS.

It has loops, functions, namespacing, arrays, maps, and tons of utility functions (especially around color).

If you treat it as CSS+ then you're not really benefitting from it's true potential.

Re: Stepping Away from Sass

#16
post #4

Does a preprocessor really complicate the workflow? Variables are still new and not fully supported. Being able to nest css selectors is major win for me. Reusable mixins is another. I just don’t see a compelling enough use case today to switch to pure css for non trivial applications.

I still use less & sass on most projects, but it's occurred to me that: * Duplicating the effect of mixins by just... having another css class for the mixed-in stuff works well enough for many cases (though this hurts most where you're trying for semantic selector naming conventions, with mixins adding in rulesets behind the scenes). * Nesting selectors save thinking and some typing regarding where styles cascade out…

Writing pure CSS and copy-pasting things here and there is easy when you start.

Where SASS shines is when you need to do a coordinated change, e.g. these things become gray instead of black. You have a ton of black things so no search and replace. And once you've painstakingly determined and edited the classes, the hard part is to be sure that you only changed what you had to, and nothing unrelated.

SASS preserves semantics which plain CSS is unable to express. It's like C vs assembly.

Re: Stepping Away from Sass

#17
The only thing I still couldn't live without is nested selectors. Writing maintainable CSS at scale is impossible without them. I really wonder why they haven't been made native yet.

Re: Stepping Away from Sass

#19

Everyone forgets that SASS is meant to be programmable CSS. It has loops, functions, namespacing, arrays, maps, and tons of utility functions (especially around color). If you treat it as CSS+ then you're not really benefitting from it's true potential.

> Everyone forgets that SASS is meant to be programmable CSS

That sounds like a solution looking for a problem... The vast majority of real SASS I've seen has been much like the stuff this article mentions.

> If you treat it as CSS+ then you're not really benefitting from it's true potential

People aren't looking for "potential", they're looking for a way to accomplish their design goals whilst keeping their stylesheets maintainable. The real use cases where SASS is actually worth the complexity overheads are getting fewer and fewer.

Re: Stepping Away from Sass

#20
post #17

The only thing I still couldn't live without is nested selectors. Writing maintainable CSS at scale is impossible without them. I really wonder why they haven't been made native yet.

PostCSS [0] can do this and is far easier to install.

https://github.com/postcss/postcss-nested

Post reply on HN