+ 5

css & sass

Despite the vast advances that have occurred in css, is there any need to use sass?

4th May 2019, 2:16 PM
Zoughi-Javad
Zoughi-Javad - avatar
8 odpowiedzi
4th May 2019, 3:53 PM
Calviղ
Calviղ - avatar
+ 4
Zoughi-Javad check out thses 2 codes, to see how does Sass/scss help in writing all the css selectors in logical and organise way, More importantly it helps create complicated css faster with much lesser codes. This first one were written in scss (less than 60 lines of codes) and the latter one were written in css (over 6k lines of codes). https://code.sololearn.com/Wv1mCxILb1cr/?ref=app https://code.sololearn.com/W25dnn7h8mcf/?ref=app
13th May 2019, 2:22 AM
Calviղ
Calviղ - avatar
+ 2
We need sass is due to css is not advance enough, css itself is lacking of variable assignment, code nesting, partial code support, code import, code grouping like maxins and other advanced features like code extend and math operators functions. Using sass would write a better codes, DRY (don't repeat yourself) method, maintenanable with code import, code reuse of maxins, inheritance by code extend, making accurate calculation of dimensions width/height by using math operators.
4th May 2019, 2:55 PM
Calviղ
Calviղ - avatar
+ 2
wow, it's so good 🤤
4th May 2019, 3:45 PM
Gordon
Gordon - avatar
+ 1
Though I like postCSS more (preCSS) … Calviղ how is your experience with it?
4th May 2019, 4:38 PM
Emoji FanBoy
Emoji FanBoy - avatar
+ 1
Emoji FanBoy IMHO, postCSS is a great tool, I would consider postCSS as a tool to complement Sass/scss, rather than replace it. postCSS has autoprefixer and cross vendor that would be set from js, so it saves more works from writing common mixin on sass. Using sass with postCSS would create more enjoyable experience of code writing.
13th May 2019, 2:19 AM
Calviղ
Calviղ - avatar
0
Calviղ Yeah, that's general opinion I've mostly seen across web and that's fine. But… I was referring to preCSS, postCSS pluging which is substitute for Sass. https://github.com/jonathantneal/precss It's very close Sass syntax (and some call it new Sass 😀), still have some benefits using it over Sass. (Sorry that didn't clearly said it in previous reply)
13th May 2019, 10:45 AM
Emoji FanBoy
Emoji FanBoy - avatar
0
I lost marks on mock exam that sass is a CSS preprocessor. I have no clue about this. LESS, SASS and RubySASS there is so many extra library's you need to know. This idea that html and CSS is an easy way to start learning coding is a bit misguided or misleading.
1st Mar 2020, 12:40 PM
PjCode
PjCode - avatar