Forked from KittyGiraudel/SassMeister-input.scss
Last active
August 29, 2015 14:16
-
-
Save graste/df81deac1eaa768600a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ---- | |
| // 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; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .button { | |
| border: none; | |
| } | |
| button.button { | |
| -webkit-appearance: none; | |
| } | |
| a.button { | |
| text-decoration: none; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment