Last active
September 10, 2018 18:29
-
-
Save ian-pvd/3a7de0f68d41a60d76dce89dbb38cdd5 to your computer and use it in GitHub Desktop.
SCSS Developer Mixin To Highlight Box Layouts
This file contains 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
@import 'utilities'; | |
/* Example Dev Boxes */ | |
// Basic Example | |
.dev-box { | |
@include dev-box; | |
} | |
// Change Box Colors | |
.parent-box { | |
@include dev-box(orange, green); | |
// Highlight All Child Elements | |
* { | |
@include dev-box(#FF00FF, purple); | |
} | |
} | |
// Customize All Options | |
.custom-box { | |
@include dev-box(blue, green, dashed); | |
} |
This file contains 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
/* Dev Box Inspector | |
* | |
* Adds a high contrast outline to the specified element to highlight | |
* the box edge and layout. | |
* | |
* @param {string} $color (red) - outline color | |
* @param {string} $background (yellow) - background highlight | |
* @param {string} $outline (dotted) - outline style | |
*/ | |
@mixin dev-box($color: red, $background: yellow, $style: dotted) { | |
background: fade-out($background, 0.95); | |
outline: 1px $style $color; | |
&:hover { | |
background: fade-out($background, 0.75); | |
outline: 2px $style $color; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment