Skip to content

Instantly share code, notes, and snippets.

@pfulton
Created July 19, 2013 21:17
Show Gist options
  • Save pfulton/6042418 to your computer and use it in GitHub Desktop.
Save pfulton/6042418 to your computer and use it in GitHub Desktop.
Compass Selector Helpers: Nest
ul li ul li.parent ul {
display: none;
}
ul li ul li.parent.active ul {
display: block;
}
#{nest("ul","li","ul","li.parent","ul")} {
display: none;
}
#{nest("ul","li","ul","li.parent.active","ul")} {
display: block;
}
@pfulton
Copy link
Author

pfulton commented Jul 19, 2013

Compass has a built-in selector helper for nesting things. This is sometimes useful for things like deeply nested lists, but you might have an easier time using child and/or sibling selectors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment