Skip to content

Instantly share code, notes, and snippets.

@lunelson
Created February 23, 2016 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lunelson/02ec94b8f1fcf5e6cf1c to your computer and use it in GitHub Desktop.
Save lunelson/02ec94b8f1fcf5e6cf1c to your computer and use it in GitHub Desktop.
Parsing selectors out of strings...
// ----
// 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);
}
}
/*
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