Created
September 26, 2014 10:20
-
-
Save bleuebuzz/686fe4d92ab389095c86 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.1) | |
// ---- | |
$fucking-crazy-selectors: ()!default; | |
@mixin selector-set ($name, $selector) { | |
$fucking-crazy-selectors: map-merge($fucking-crazy-selectors, ($name: $selector))!global; | |
} | |
@function selector-get ($name, $placeholder: null) { | |
@each $key, $selector in $fucking-crazy-selectors { | |
@if $name == $key { | |
@return $selector; | |
} | |
} | |
@return $placeholder; | |
} | |
@mixin selector ($name, $placeholder: null) { | |
$_selector: selector-get($name, $placeholder); | |
@if $_selector { | |
/* selector for: `#{$name}` */ | |
#{$_selector} { | |
@content; | |
} | |
} | |
} | |
@include selector-set('foo', '#foo test'); | |
@include selector-set('bar', '#bar test2 li'); | |
@include selector(foo) { | |
foo: selector-get('foo'); | |
get: selector-get('get'); // null | |
bar: selector-get('bar'); | |
} |
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
/* selector for: `foo` */ | |
#foo test { | |
foo: "#foo test"; | |
bar: "#bar test2 li"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment