Monday, 20 July 2015

Avoid using comma and extra classes - using Sass compiler for CSS

Just seen this little nugget of code on TreeHouse and thought it quite useful for writing tidier code.

Rather than writing

.block, .foo {

  color: orange ;


you can use

.block {

color: orange;


.foo {

@extend .block;

//  the rest of my CSS for foo is already here


No comments: