Last active
November 12, 2015 21:29
-
-
Save csswizardry/66cc5e6dbceef5de3e4c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
<p class="foo--bar">Lorem ipsum dolor sit amet.</p> |
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
// ---- | |
// Sass (v3.4.14) | |
// Compass (v1.0.3) | |
// ---- | |
// Make sure we have a way to turn debugging on/off. | |
$debug: true; | |
@if ($debug == true) { | |
/** | |
* If an element has a class attribute containing two hyphens but no space | |
* (i.e. only one class is being used, and it’s a Modifier), provide visual | |
* feedback in the DOM. | |
* | |
* N.B. This isn’t bulletproof: `class="foo--bar baz"` would pass, as would | |
* `class=" foo--bar"`. Use with a pinch of salt. | |
*/ | |
[class*="--"]:not([class*=" "]) { | |
position: relative; | |
outline: 1px solid red; | |
&:after { | |
content: "ERROR: Cannot have a Modifier (i.e. `." attr(class) "`) without a Block."; | |
position: absolute; | |
bottom: 100%; | |
left: 0; | |
font-family: monospace; | |
white-space: nowrap; | |
background-color: white; | |
color: red; | |
} | |
} | |
} |
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
@charset "UTF-8"; | |
/** | |
* If an element has a class attribute containing two hyphens but no space | |
* (i.e. only one class is being used, and it’s a Modifier), provide visual | |
* feedback in the DOM. | |
* | |
* N.B. This isn’t bulletproof: `class="foo--bar baz"` would pass, as would | |
* `class=" foo--bar"`. Use with a pinch of salt. | |
*/ | |
[class*="--"]:not([class*=" "]) { | |
position: relative; | |
outline: 1px solid red; | |
} | |
[class*="--"]:not([class*=" "]):after { | |
content: "ERROR: Cannot have a Modifier (i.e. `." attr(class) "`) without a Block."; | |
position: absolute; | |
bottom: 100%; | |
left: 0; | |
font-family: monospace; | |
white-space: nowrap; | |
background-color: white; | |
color: red; | |
} |
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
<p class="foo--bar">Lorem ipsum dolor sit amet.</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment