Skip to content

Instantly share code, notes, and snippets.

@adamsir
Created October 23, 2014 14:37
Show Gist options
  • Save adamsir/8b81ea034b360e889831 to your computer and use it in GitHub Desktop.
Save adamsir/8b81ea034b360e889831 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.0)
// ----
// Mixins
@mixin extend($class:'&') {
@if ($class != '&') {
.#{$class} {
@content
}
} @else {
& {
@content
}
}
}
// Demo
.link {
text-decoration: underline;
@include extend() {
color: white;
background :red;
}
}
.pivo {
background: black;
&:first-child {
color: pink;
}
}
@include extend('pivo') {
display: block;
&:last-child {
display: none;
}
}
.link {
text-decoration: underline; }
.link {
color: white;
background: red; }
.pivo {
background: black; }
.pivo:first-child {
color: pink; }
.pivo {
display: block; }
.pivo:last-child {
display: none; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment