Skip to content

Instantly share code, notes, and snippets.

@jbutko
Created April 10, 2014 17:35
Show Gist options
  • Save jbutko/10405095 to your computer and use it in GitHub Desktop.
Save jbutko/10405095 to your computer and use it in GitHub Desktop.
SASS, SCSS, CSS: Select all elements on the same node level
.second {
.first ~ & {
/* styles to be applied to .second if a .first exists at the same node level */
}
}
// From http://stackoverflow.com/questions/15246387/css-and-or-sass-sibling-selector-upwards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment