Skip to content

Instantly share code, notes, and snippets.

@davidicus
Last active August 29, 2015 14:16
Show Gist options
  • Save davidicus/5bce2c3de1f5f1fe40ba to your computer and use it in GitHub Desktop.
Save davidicus/5bce2c3de1f5f1fe40ba to your computer and use it in GitHub Desktop.
Use of @at-root to append an element to the front of a class
.btn {
height: 18px;
background: green;
line-height: 12px;
}
a.btn {
line-height: 18px;
}
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
.btn {
height:18px;
background:green;
line-height:12px;
//If it's attached to a link, make the line height bigger
@at-root a#{&} {
line-height:18px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment