Live data from Hacker News

Stepping Away from Sass

cathydutton.co.uk

141–150 of 157 posts

Re: Stepping Away from Sass

#141
post #54

Earlier quoted context omitted.

PostCSS [0] can do this and is far easier to install. https://github.com/postcss/postcss-nested

Not sure how the install could be easier than "get a single command line tool and run it against your root source file". If you're talking about the Ruby version, node-sass doesn't require any of those extra steps

Have you ever tried to get libsass installed on a CI server? Painful.

Re: Stepping Away from Sass

#142

Earlier quoted context omitted.

> 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?

useful, I didn't know about this. Thanks. How does the reporting of vulnerabilities work for npm? No, Golang doesn't, but then it doesn't have a registry like npm in the first place. Gophers tend not to use third-party libraries if at all possible.

The process is explained here: https://docs.npmjs.com/reporting-a-vulnerability-in-an-npm-p...

Re: Stepping Away from Sass

#143
post #125

Earlier quoted context omitted.

Hi, you seem to be the leading critic of nesting on this page, so I have a question for you. Assuming you're using a component framework like React, Vue, or Angular (and not a shadow dom based system like Polymer), how do you isolate your component CSS? When I make a component 'MyComponent', I give it the className 'MyComponent'. Then I can create a SCSS file and scope its entire contents: .MyComponent { // all the c…

Thank you, I'll wear the title of: leading critic of nesting proudly! disclaimer I'm not a hugely experienced programmer, but have done a few open source projects in Vue, React and am currently working on a series of Angular applications with a team at work. In Vue and Angular component styles are automatically encapsulated at the component level by scoping (I think) so nesting isn't really necessary to target specif…

without discipline things can get very complex and fragile

In what way(s) is SASS different than anything else in this regard?

Re: Stepping Away from Sass

#144
post #136
post #68

Earlier quoted context omitted.

Almost as annoying as being told the tech stack you've been using for decades is unreasonably difficult to use despite the almost literal millions of maintainable and successful projects deployed with it. If you want to talk about strangely pervasive attitudes in tech, surely point of call #1 is "I just learnt and can't possibly comprehend how people write software without it", no?

The problem is that "doing it the hard way" isn't just a matter of the original programmer having to put in "more effort". It's not just a matter of sucking it up. Needlessly esoteric code is less expressive, and therefore harder to maintain, and therefore will statistically have more bugs and have to be replaced sooner. That's the real cost. Masochistic programmers who insist on doing everything the hardest way poss…

I wasn't attacking sass either, I've got large projects in production with both approaches. I was countering the point that it's 'impossible' or 'unreasonably hard' as someone else put it to write maintainable CSS code, which is absolutely ludicrous. Like I mentioned, CSS is included in more easy to maintain apps in production than almost any other language in existence. Sure, it's in a lot of code salads too, but that's beside the point, because OP's point was that Sass is somehow mandatory because software engineers can't be trusted to write clean code without it.

Re: Stepping Away from Sass

#145
post #125

Earlier quoted context omitted.

Thank you, I'll wear the title of: leading critic of nesting proudly! disclaimer I'm not a hugely experienced programmer, but have done a few open source projects in Vue, React and am currently working on a series of Angular applications with a team at work. In Vue and Angular component styles are automatically encapsulated at the component level by scoping (I think) so nesting isn't really necessary to target specif…

without discipline things can get very complex and fragile In what way(s) is SASS different than anything else in this regard?

True, this could be said for any system, but in this case SASS makes it easy to create nested relationships, whereas CSS makes it hard.

Re: Stepping Away from Sass

#146
post #136

Earlier quoted context omitted.

The problem is that "doing it the hard way" isn't just a matter of the original programmer having to put in "more effort". It's not just a matter of sucking it up. Needlessly esoteric code is less expressive, and therefore harder to maintain, and therefore will statistically have more bugs and have to be replaced sooner. That's the real cost. Masochistic programmers who insist on doing everything the hardest way poss…

I wasn't attacking sass either, I've got large projects in production with both approaches. I was countering the point that it's 'impossible' or 'unreasonably hard' as someone else put it to write maintainable CSS code, which is absolutely ludicrous. Like I mentioned, CSS is included in more easy to maintain apps in production than almost any other language in existence. Sure, it's in a lot of code salads too, but th…

The original phrasing was "at scale". I'm only talking about sites with more than a dozen components and/or pages. At my job we have hundreds of components, some of which are used in hundreds of contexts, and we would have an insane time avoiding style leakage without nested selectors.

Re: Stepping Away from Sass

#147
post #54

Earlier quoted context omitted.

Not sure how the install could be easier than "get a single command line tool and run it against your root source file". If you're talking about the Ruby version, node-sass doesn't require any of those extra steps

Have you ever tried to get libsass installed on a CI server? Painful.

Nope, though you're generally supposed to use a project that uses libsass (of which there are many), not use it directly. If the issue is the binary itself, then maybe the Ruby version is what you want after all.

Re: Stepping Away from Sass

#148
post #107

The case for CSS variables is interesting. I'm still trying to figure out the best way to integrate them with a CSS framework I created, called Bulma: https://bulma.io/ There's a few ways to combine Sass variables and CSS variables: - make all Sass variables available as CSS variables as well, so $primary will also exist as --primary - assign a CSS variable to a Sass one: $primary: var(--red) - assign a Sass variable…

>why offload the variable resolution to the client side when it can be done at compilation time?

So I can use Stylus to override one CSS variable and change the appearance, instead of having to save the website's entire css file, find all rules set to the "variable value" (aka a particular font stack), and redefine every rule to use my personal font stack.

Re: Stepping Away from Sass

#149

Earlier quoted context omitted.

> vanilla CSS Is there another kind of CSS?

You know what I mean, Sheldon.

My point is, one need not apply an adjective to something that does not need qualifying. Just like "vanilla" JavaScript. You are either using JavaScript or you're not but people have been doing that for years and now I see posts asking for definitions or differences between "vanilla" and other flavors of js.

Terminology is important but I see it's not important among some people and other hobbyists online.

Re: Stepping Away from Sass

#150

Earlier quoted context omitted.

You know what I mean, Sheldon.

My point is, one need not apply an adjective to something that does not need qualifying. Just like "vanilla" JavaScript. You are either using JavaScript or you're not but people have been doing that for years and now I see posts asking for definitions or differences between "vanilla" and other flavors of js. Terminology is important but I see it's not important among some people and other hobbyists online.

I can't speak for the others, but when I use the terms 'vanilla JavaScript' and 'vanilla CSS', the distinction I'm trying to make is that I'm not using any libraries or frameworks.

There is a meme within the community about 'vanilla JavaScript' called VanillaJS:

http://vanilla-js.com/

https://stackoverflow.com/questions/20435653/what-is-vanilla...

Post reply on HN