Created
April 1, 2015 13:29
-
-
Save bookwyrm/bd62a14812fba177497c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
%div.container | |
%span.with-js JS is available | |
%span.without-js JS is not available |
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) | |
// ---- | |
@mixin js--enabled() { | |
@at-root html.js #{&} { | |
@content; | |
} | |
} | |
@mixin js--disabled() { | |
@at-root html.no-js #{&} { | |
@content | |
} | |
} | |
.container { | |
.with-js, .without-js { | |
display: none; | |
} | |
@include js--enabled() { | |
.with-js { | |
display: block; | |
} | |
} | |
@include js--disabled() { | |
.without-js { | |
display: block; | |
} | |
} | |
} |
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
.container .with-js, .container .without-js { | |
display: none; | |
} | |
html.js .container .with-js { | |
display: block; | |
} | |
html.no-js .container .without-js { | |
display: block; | |
} |
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
<div class='container'> | |
<span class='with-js'>JS is available</span> | |
<span class='without-js'>JS is not available</span> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment