Skip to content

Instantly share code, notes, and snippets.

@iamnewton
Last active August 29, 2015 14:16
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 iamnewton/4dbe153b2272a73b9744 to your computer and use it in GitHub Desktop.
Save iamnewton/4dbe153b2272a73b9744 to your computer and use it in GitHub Desktop.
.button {
border: none;
}
button.button {
-webkit-appearance: none;
}
a.button {
text-decoration: none;
}
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
/// Since the current way to qualify a class from within its ruleset is quite
/// ugly, here is a mixin providing a friendly API to do so.
/// @author Hugo Giraudel
/// @param {String} $element-selector - Element selector
@mixin qualify($element-selector) {
@at-root #{$element-selector + &} {
@content;
}
}
/// @alias qualify
@mixin when-is($args...) {
@include qualify($args...) { @content; }
}
.button {
border: none;
// Qualify `.button` with `button`
@include qualify(button) {
-webkit-appearance: none;
}
// Qualify `.button` with `a`
@include when-is(a) {
text-decoration: none;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment