Live data from Hacker News

Stepping Away from Sass

cathydutton.co.uk

41–50 of 157 posts

Re: Stepping Away from Sass

#41
post #32

Earlier quoted context omitted.

How come I haven't experienced these downsides?

That's where I am on this. Before nesting I had to take great care to avoid conflicts. I guess this is what BEM set out to solve, but it seems to have limitations.

Why would sass have any effect on whether or not you have conflicts? You can just do things in plain CSS with descendant (' ') selectors, same as if they were nested in sass.

Re: Stepping Away from Sass

#42
post #40

Earlier quoted context omitted.

Use sassc and call it from your makefile.

Not sure what it's like today, but last time I tried to use sassc it was a nightmare. The official repo was just the library with no CLI. I couldn't find a CLI that didn't also require me to compile it myself. Very frustrating.

You might be thinking of libsass. sassc is dead simple and solves all of this users issues.

Re: Stepping Away from Sass

#43

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.

>>Does a preprocessor really complicate the workflow? I've just spent yesterday getting sass to work with my Golang project. I used to have a nice simple makefile task, that compiled the project (in a split second) and launched it on localhost so I could find out where the problems were. My only dependency was the Go compiler. If I changed the css, the next page refresh sorted it. Now I have a "sass watch" task, whic…

> I can assume that it's not injecting malicious code into my application.

You don't need to assume, npm has an audit command that helps figure out if any of your package dependencies have reported vulnerabilities: https://docs.npmjs.com/cli/audit

Does Go?

Re: Stepping Away from Sass

#44
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.

> The only thing I still couldn't live without is nested selectors. Writing maintainable CSS at scale is impossible without them.

Bullshit.

Re: Stepping Away from Sass

#45
I recently built a new website from scratch after about three years working in other software areas. Found to my surprise that I came back with some very different opinions about how CSS should be structured than I had in my web dev days, and I didn't end up using SASS at all. Still think the code ended up cleaner and more modular than what I wrote before using SASS. The only feature I really missed was @extend, but making the code I would have put in the % selector an actual class and using that in addition to a specialization class in the HTML worked well enough.

Re: Stepping Away from Sass

#46
post #40

Earlier quoted context omitted.

Not sure what it's like today, but last time I tried to use sassc it was a nightmare. The official repo was just the library with no CLI. I couldn't find a CLI that didn't also require me to compile it myself. Very frustrating.

You might be thinking of libsass. sassc is dead simple and solves all of this users issues.

Correct me if I'm wrong, but doesn't sassc require the user to compile it?

Re: Stepping Away from Sass

#48
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…

The most common pattern in industry is to slather everything with libraries until you end up doing 10x the amount of work you needed to do.

An actual 'good' approach is to mostly utilise vanilla tooling like you suggest, but there are some exceptions, you can't be absolutist about it.

I think for a decently sized web application, React (and only React, not all the cruft people usually include with it) will save you a lot of effort, and not using it would be a mistake. You could go with something like Vue instead but React does a much better job at abstracting away the huge amount of utility it provides. It has a smaller API surface by an order of magnitude.

I think a good thought exercise is to think about what a 'perfect' implementation of the library you're thinking of using would look like for your exact use case, and compare it to using the actual library. Even if my use case doesn't include any performance requirements, I don't really think my implementation of a React-style solution would have less than 1k-2k LoC, and the implementation wouldn't be very simple. Contrast that to something like Redux which could be roughly implemented in ~20-100 LoC for most use cases and is conceptually very simple.

Re: Stepping Away from Sass

#49
post #44
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.

> The only thing I still couldn't live without is nested selectors. Writing maintainable CSS at scale is impossible without them. Bullshit.

Um, okay. You raise a compelling point.

Re: Stepping Away from Sass

#50
post #49
post #44

Earlier quoted context omitted.

> The only thing I still couldn't live without is nested selectors. Writing maintainable CSS at scale is impossible without them. Bullshit.

Um, okay. You raise a compelling point.

Sorry, I'll elaborate.

These kind of sweeping statements are usually pretty obviously false. You can write anything cleanly at scale. Those MS-DOS sources that were released a while back are pleasant enough to read despite being in assembly.

Post reply on HN