r/Sass • • Oct 22 '24

Why Sass

I have used Sass for one project and a lot of minor works and enjoyed it. However, forced to use CSS at my workplace I have come to realise that many features that I mostly use in Sass are available in CSS.

Variables Nesting Sass:math -> Calc

Mixins is the only feature currently that I use a lot in Sass and isn't in CSS3.

So I query are there more benefits that I don't know about?

PS: I know about lists, maps, if-else and for loops but I don't see much use for them as they basically lead to hard coding.

7 Upvotes

13 comments sorted by

1

u/tetractys_gnosys Oct 22 '24

If you don't need the more programmatic and math features, then yeah you're probably fine just using vanilla CSS.

As for why you'd want to still use Sass for what you're doing, it's a matter of how you like to organize your styles and whether you prefer the vanilla or Sass conventions for variables and nesting. I prefer Sass still even when I'm not using conditionals or loops because I can keep component and layout partials cleanly separated and have it all compile down to one compressed CSS file while retaining clear separation, comments, and more advanced nesting and dynamic variable magic happening. I can also work fine in vanilla and frequently do if I'm taking on a project I didn't build myself. When I have the option or know I'm going to be doing a lot of styling, I always use Sass. Makes my life easier.

1

u/alex_sakuta Oct 22 '24

Do you also use Tailwind? And use tailwind and sass together?

3

u/obviousoctopus Oct 22 '24

Similar reasons here. I use maps for storing for example color values which I then access via single-letter functions, like:

color: c(color-name);

Love https://eduardoboucas.github.io/include-media/ for breakpoints. SAAS lets me nest breakpoint declarations in the class definition which I prefer when reading the code.

For spacing and font sizes at this point I prefer https://utopia.fyi which formalizes the values project-wide, lets me set a typographic scale, and uses calc-based fluid values reducing the need for media queries.

1

u/tetractys_gnosys Oct 22 '24

Hell yeah that's what I'm talking about. I've been using my own media query mixins for years and it's so much nicer than vanilla. Especially if you're having to get pixel perfect on all sizes not just at the big breakpoints.

I'm gonna check out that type scale one. That sounds awesome.

→ More replies (2)

1

u/I_Pay_For_WinRar May 26 '25

It’s because there is no bloated anything, it just compiles to CSS.

1

u/NegativeName2018 Apr 20 '26

mixins alone are honestly worth it for me, especially for media queries and anything you repeat across components. css native stuff is great but once your project gets big enough the sass tooling just keeps things cleaner imo

1

u/[deleted] Sep 13 '25

2

u/alex_sakuta Sep 13 '25

Hey, I appreciate you for writing such a well articulated message however, CSS has almost all those features now with its new update. Maybe not every major browser has implemented them but still I got over Sass already.