Last active
August 29, 2015 14:16
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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