Skip to content

Instantly share code, notes, and snippets.

@cahnory
Created September 11, 2015 09:19
Show Gist options
  • Save cahnory/8fdaa01f08422a693f4e to your computer and use it in GitHub Desktop.
Save cahnory/8fdaa01f08422a693f4e to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@mixin hold-once($name) {
// if placeholder not in declared ones
@if not index($PLACEHOLDER__DECLARED, $name) {
// set placeholder as declared
$PLACEHOLDER__DECLARED: append($PLACEHOLDER__DECLARED, $name)!global;
// declare placeholder
%#{$name} {
@content;
}
}
}
$PLACEHOLDER__DECLARED: ()!default;
%foo {
foo: 1;
}
%foo {
foo: 2;
}
@include hold-once('bar') {
bar: 1;
}
@include hold-once('bar') {
bar: 2;
}
@include hold-once('bar') {
bar: 3;
}
.foo { @extend %foo }
.bar { @extend %bar }
.foo {
foo: 1;
}
.foo {
foo: 2;
}
.bar {
bar: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment