Created
July 15, 2014 18:11
-
-
Save micahgodbolt/91bb8af1918a4bba87de 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.4.0.rc.1) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
@mixin insert-context($target, $context, $order: before) { | |
$new-context: ""; | |
@if $order == before { | |
$new-context: selector-nest($context, $target); | |
} | |
@else { | |
$new-context: selector-nest($target, $context); | |
} | |
foo: $new-context; /* testing selector-nest */ | |
$new-selector: selector-replace(&, $target, $new-context); | |
@at-root #{$new-selector} { | |
@content; | |
} | |
} | |
.tabs { | |
.tab { | |
background: red; | |
&:hover { | |
background: white; | |
} | |
} | |
.tab-link { | |
color: white; | |
@include insert-context('.tab-link', '.tab:hover') { | |
color: red; | |
} | |
} | |
} |
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
.tabs .tab { | |
background: red; | |
} | |
.tabs .tab:hover { | |
background: white; | |
} | |
.tabs .tab-link { | |
color: white; | |
foo: .tab:hover .tab-link; | |
/* testing selector-nest */ | |
} | |
.tabs .tab:hover .tab-link, .tab:hover .tabs .tab-link { | |
color: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment