Created
October 18, 2012 13:05
-
-
Save matt-bailey/3911666 to your computer and use it in GitHub Desktop.
Sass vs Less - Placeholders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: http://ianstormtaylor.com/oocss-plus-sass-is-the-best-way-to-css/ | |
// Sass | |
%separator | |
border-top: 1px solid black | |
hr | |
@extend %separator | |
.separator | |
@extend %separator | |
// Compiled Sass to CSS | |
hr, | |
.separator { | |
border-top: 1px solid black | |
} | |
// Less equivalent | |
.sep { | |
border-top: 1px solid black; | |
} | |
hr, | |
.separator { | |
.sep; | |
} | |
// Compiled Less to CSS | |
.sep { | |
border-top: 1px solid black; | |
} | |
hr, | |
.separator { | |
border-top: 1px solid black; | |
} |
Agreed, placeholders in Sass are super powerful and really lets you separate style definitions from style declarations without mixins.
@rkb81 your code does not work. less/less.js#1177
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Still ugly on LESS.