Nesting rules allow you to turn
.foo p { } .foo p a { } .foo p div { }
.foo { p { a { } div { } } }
'&' context reference allows you to turn this.
.widget a.button { ... } .widget a.button:hover { ... } .widget a.button:active, .widget a.button:focus { ... }
.widget a.button { ... &:hover { ... } &:focus, &:active { ... } }
@includes is like writing function. Which is very useful when you have to write browser-specific style. You can define `round-border` mixin once.
@mixin round-border($radius) { border-radius: $radius; -moz-border-radius: $radius; -webkit-border-radius: $radius; } .dialog { @include round-border(10px); } .color-picker { @include round-border(5px); } .button { @include round-border(3px); ... }
Nesting rules allow you to turn
into Less duplicate code and more obvious hierarchy.'&' context reference allows you to turn this.
Into Again, less duplication, less code to read/change. More obvious hierarchy.@includes is like writing function. Which is very useful when you have to write browser-specific style. You can define `round-border` mixin once.
Is that less clear or harder to maintain than CSS version?