Hacker News new | ask | show | jobs
by alnorth 3538 days ago
I half agree with you, but one of the real benefits that SASS gives you here is making dependencies more obvious. A named variable like `$slider-height` is much clearer than a random number like `50px`. Yeah, you could put a comment next to every constant in the CSS, but I don't think that's clearer than the SASS alternative.
3 comments

I'd hope CSS variables [1] will make that argument obsolete soon, but then again I've been hoping that for a while...

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_v...

SCSS variables also make things FAR more maintainable. To change a color, you shouldn't have to change every single line where that color is used.

You update the value where your color variable is defined, and then each style declaration that uses the color variable receives the new value automatically.

I think you've hit the nail on the head here.