I started looking at the basics of sass a couple of years, but I've never gotten far into learning it apart from some very basic syntax. With the introduction of the likes of CSS variables and browser support increasing fairly quickly is this worth learning?
I'd be interested in peoples thoughts either way. Anyone use it regularly?
Top comments (7)
If you're interested in CSS I would spend a couple of weekends playing with it.
In order to play with it well, I would suggest using SASS to style the css zen garden before trying to incorporate SASS into a project.
I think it's important to learn it (if you're interested in CSS) because SASS has and will continue to be very influential on css.
I remember css zen garden from a few years ago thanks for the remainder.
If you write a lot of CSS, I definitely think SASS is still worth learning, even with the rise of CSS variables. SASS has a lot of functionality like nesting, mixins, and for/each loops that CSS variables don't replace. There's also an argument for both CSS and SASS variables having their place - I'm using SASS variables for most things (for backward compatibility), and CSS variables for progressive enhancements.
IMO once you get used to it, SASS takes a lot of the tedium out of writing CSS - even just setting up some simple mixins for combinations of properties you write over and over makes the process a lot faster and more fun.
Thanks for the reply I've dabbled with it but never really gotten into the full power of it and with the likes of postcss emerging wondered it's worth me going more in depth and given a lot of work we do needs to support the joys of IE... 😐
You can actually use SASS and PostCSS together - I do a lot of Wordpress builds with Sage which uses SASS for the style files and PostCSS to handle autoprefixing and minifying.
If you want to get into SASS, I'd suggest starting with basic variables, nesting with the parent selector, and making some basic mixins for groups of properties you use often.
That much was plenty for me to never want to code vanilla CSS again, and there's a lot of wackier stuff you can do beyond that (like this crazy mixin that basically generates Bootstrap's entire grid system).
There are a lot of projects out there that use it, so I think it's worth having a basic understanding of how it compiles and what it offers, but unless you need it for a particular project, don't learn more than that.
Hey Chloe! Chiming in a bit late here but I defo think Sass is still relevant going into 2020.
Especially if you look at the data from the State of CSS survey around pre processors.
I just published a post pretty much answering your question!
Let me know what you think :)