What's the difference between SCSS and Sass?

前端 未结 13 2076
忘掉有多难
忘掉有多难 2020-11-22 14:51

From what I\'ve been reading, Sass is a language that makes CSS more powerful with variable and math support.

What\'s the difference with SCSS? Is it supposed to be

13条回答
  •  爱一瞬间的悲伤
    2020-11-22 15:13

    Original sass is ruby syntax-like, similar to ruby, jade etc...

    In those syntaxes, we don't use {}, instead we go with white spaces, also no usage of ;...

    In scss syntaxes are more like CSS, but with getting more options like: nesting, declaring, etc, similar to less and other pre-processing CSS ...

    They basically do the same thing, but I put couple of lines of each to see the syntax difference, look at the {}, ;, and spaces:

    SASS:

    $width: 100px
    $color: green
    
    div
      width: $width
      background-color: $color
    

    SCSS:

    $width: 100px;
    $color: green;
    
    div {
      width: $width;
      background-color: $color;
    }
    

提交回复
热议问题