Skip to content

Instantly share code, notes, and snippets.

@ruedap
Created March 9, 2013 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruedap/5123448 to your computer and use it in GitHub Desktop.
Save ruedap/5123448 to your computer and use it in GitHub Desktop.
Sass: mixin or extend
/* 6 selectors */
.a, .a .b, .a .b .c {
color: red;
}
.a, .a .b, .a .b .c {
font-size: 10px;
}
%hoge
color: red
%fuga
font-size: 10px
@extend %hoge
.a
@extend %fuga
.b
@extend %fuga
.c
@extend %fuga
/* 3 selectors */
.a {
font-size: 10px;
color: red;
}
.a .b {
font-size: 10px;
color: red;
}
.a .b .c {
font-size: 10px;
color: red;
}
=hoge
color: red
=fuga
font-size: 10px
+hoge
.a
+fuga
.b
+fuga
.c
+fuga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment