3

Is scss backwards compatible with less? I didn't think it was. For example, less prefixes variables with '@' whereas scss prefixes variables with '$'. But even if I replaced the variable prefix, I think there are certain functions/handling specific to each respective preprocessor.

A coworker was insisting that scss is backwards compatible with less. I'm thinking that he may have been confused. Less/scss is backwards compatible with css but I don't think that scss is backwards compatible with less. Can you please confirm?

4castle
  • 32,613
  • 11
  • 69
  • 106
details1
  • 335
  • 1
  • 2
  • 8

1 Answers1

1

For basic nested styling, LESS and Sass are generally compatible:

a {
    // A styles

    B {
        // B styles
    }

}

will compile to the same thing in both, and some built-in functions will give the same result.

But after that things are quite different. & behaves differently; Sass uses explicit @mixin mixins while in LESS all class definitions are mixins; the built-in functions are different; Sass has if, for, each and while directives, while LESS relies on when guards and mixins that recall themselves; etc.


For your reference

henry
  • 4,244
  • 2
  • 26
  • 37