Created
November 8, 2012 16:43
-
-
Save brianmcallister/4039971 to your computer and use it in GitHub Desktop.
Debugging mode in Sass
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
| /* | |
| Debugging. | |
| */ | |
| @mixin o($color: red) { | |
| @include if-debug { | |
| outline: 1px solid $color; | |
| } | |
| } | |
| @mixin b($color: blue) { | |
| @include if-debug { | |
| background: rgba($color, .1); | |
| } | |
| } | |
| /* | |
| Missing elements are things that are not finished in some way. | |
| @param {String} $message Debugging message. | |
| */ | |
| @mixin missing($message: 'NOT IN STYLEGUIDE') { | |
| @include if-debug { | |
| @include position(relative); | |
| background: rgba(red, .1); | |
| &:after { | |
| @include position(absolute, 0px 0px); | |
| content: $message; | |
| display: block; | |
| padding: 5px; | |
| color: white; | |
| font-size: 11px; | |
| font-weight: 400; | |
| line-height: normal; | |
| background: rgba(black, .5); | |
| } | |
| } | |
| } | |
| /* | |
| Run a @content block if debugging is on. | |
| */ | |
| @mixin if-debug() { | |
| @if $debugging-messages { | |
| @content; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment