Created
February 23, 2016 13:09
-
-
Save lunelson/02ec94b8f1fcf5e6cf1c to your computer and use it in GitHub Desktop.
Parsing selectors out of strings...
This file contains 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 (v4.0.0.alpha.1) | |
// ---- | |
/* | |
SKETCHES FOR SELECTOR MANIPULATION | |
mixins | |
@mixin adjacent-to() | |
@mixin sibling-of/to() | |
@mixin child-of() | |
*/ | |
.parent1, .parent2 { | |
.child { | |
// last: last-parents(); | |
// init: init-parents(); | |
// @include adjacent-to('p') { color: blue; } | |
// @include sibling-of('input[checked]') {} | |
// // HANDLE: SSV, CSV, STRING SELECTOR | |
// @include child-of('.parent2.active, .parent1.active') { | |
// } | |
/* how to parse selectors out of strings a la jQuery */ | |
$arg: '.parent3, .parent1 .parent2.hype'; | |
// $__parent: & !global; | |
@at-root #{$arg} { $__parent: & !global; } | |
debug: inspect($__parent); | |
} | |
} |
This file contains 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
/* | |
SKETCHES FOR SELECTOR MANIPULATION | |
mixins | |
@mixin adjacent-to() | |
@mixin sibling-of/to() | |
@mixin child-of() | |
*/ | |
.parent1 .child, .parent2 .child { | |
/* how to parse selectors out of strings a la jQuery */ | |
debug: .parent3, .parent1 .parent2.hype; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment