Skip to content

Instantly share code, notes, and snippets.

@mcky
Last active August 29, 2015 14:16
Show Gist options
  • Save mcky/1b01f1fded6335d4b5f0 to your computer and use it in GitHub Desktop.
Save mcky/1b01f1fded6335d4b5f0 to your computer and use it in GitHub Desktop.
Hope this makes sense? Even if it's possible doubt it'd work with compound selectors though
$aList: (
one
, two
, three
, four
);
// So $elem is the name of the selector it was called from (.one, #two etc)
@mixin myMixin($elem) {
$value: index(&aList, $elem);
}
// Allowing something like this (more abstracted)
.one {
@include myMixin()
@include myMixin($elem)
}
// Instead of typing it again
.one {
@include myMixin(one)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment