Created
September 14, 2011 04:27
-
-
Save chriseppstein/1215856 to your computer and use it in GitHub Desktop.
This gist demonstrates some uses of the new sass feature: Passing content blocks to mixins.
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
@mixin ie6 { * html & { @content } } | |
#logo { | |
background-image: url("/images/logo.png"); | |
@include ie6 { background-image: url("/images/logo.gif"); } | |
} |
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
=ie6 | |
* html & | |
@content | |
#logo | |
background-image: url("/images/logo.png") | |
+ie6 | |
background-image: url("/images/logo.gif") |
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
#logo { background-image: url("/images/logo.png"); } | |
* html #logo { background-image: url("/images/logo.gif"); } |
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
@mixin keyframes { | |
@-moz-keyframes { @content; } | |
@-webkit-keyframes { @content; } | |
} | |
@include keyframes { | |
0% { opacity: 0; } | |
100% { opacity: 1; } | |
} |
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
=keyframes | |
@-moz-keyframes | |
@content | |
@-webkit-keyframes | |
@content | |
+keyframes | |
0% | |
opacity: 0 | |
100% | |
opacity: 1 |
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
@-moz-keyframes { | |
0% { opacity: 0; } | |
100% { opacity: 1; } | |
} | |
@-webkit-keyframes { | |
0% { opacity: 0; } | |
100% { opacity: 1; } | |
} |
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
@mixin respond-to($media) { | |
@if $media == handhelds { | |
@media only screen and (max-width: 479px) { @content; } | |
} | |
@else if $media == wide-handhelds { | |
@media only screen and (min-width: 480px) and (max-width: 767px) { @content; } | |
} | |
@else if $media == tablets { | |
@media only screen and (min-width: 768px) and (max-width: 959px) { @content; } | |
} | |
} | |
#sidebar { | |
float: left; | |
width: 300px; | |
@include respond-to(handhelds) { float: none; } | |
@include respond-to(wide-handhelds) { float: none; } | |
@include respond-to(tablets) { width: 240px; } | |
} |
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
=respond-to($media) | |
@if $media == handhelds | |
@media only screen and (max-width: 479px) | |
@content | |
@else if $media == wide-handhelds | |
@media only screen and (min-width: 480px) and (max-width: 767px) | |
@content | |
@else if $media == tablets | |
@media only screen and (min-width: 768px) and (max-width: 959px) | |
@content | |
#sidebar | |
float: left | |
width: 300px | |
+respond-to(handhelds) | |
float: none | |
+respond-to(wide-handhelds) | |
float: none | |
+respond-to(tablets) | |
width: 240px |
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
#sidebar { float: left; width: 300px; } | |
@media only screen and (max-width: 479px) { #sidebar { float: none; } } | |
@media only screen and (min-width: 480px) and (max-width: 767px) { #sidebar { float: none; } } | |
@media only screen and (min-width: 768px) and (max-width: 959px) { #sidebar { width: 240px; } } |
brndto
commented
Jul 12, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment