Skip to content

Instantly share code, notes, and snippets.

@mistergraphx
Last active January 27, 2018 16:09
Show Gist options
  • Save mistergraphx/f0d20a5408907d908dcba4c29418d0d2 to your computer and use it in GitHub Desktop.
Save mistergraphx/f0d20a5408907d908dcba4c29418d0d2 to your computer and use it in GitHub Desktop.
Nested selectors test : selector_nest()
> 1%
last 2 versions
// ----
// libsass (v3.5.0.beta.2)
// ----
// Nested selectors test
$modifiers: '.footer','.header', '.main-heading' ;
$modified: '.logo','.title','.sub-title';
$selectors: ();
@each $modifier in $modifiers {
$selectors: append($selectors, selector_nest($modifier, $modified), 'comma') ;
}
#{$selectors} {
value: length($modifiers);
color: red;
}
.footer,.header {
.title, .logo {
color: blue;
}
}
.footer .logo, .footer .title, .footer .sub-title, .header .logo, .header .title, .header .sub-title, .main-heading .logo, .main-heading .title, .main-heading .sub-title {
value: 3;
color: red;
}
.footer .title, .footer .logo, .header .title, .header .logo {
color: blue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment