Created
May 13, 2011 17:07
-
-
Save hagenburger/970906 to your computer and use it in GitHub Desktop.
Some idea how compass could use @extend instead of mixins with backward compatibility
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
$exend-compass-mixins: true; | |
.my-box { | |
background: red; | |
@include box-shadow(black, 0, 1px, 5px); | |
@include clearfix; | |
} | |
.my-other-box { | |
background: green; | |
@include box-shadow(red, 2px, 0, 10px); | |
@include clearfix; | |
} | |
@include extended-compass-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
// this is just to clarify what happens between step 1 and 3; this file would not exist | |
.my-box { | |
background: red; | |
@extend .c1; | |
@extend .c2; | |
} | |
.my-other-box { | |
background: green; | |
@extend .c2; | |
@extend .c3; | |
} | |
.c1 { | |
@include box-shadow(black, 0, 1px, 5px); | |
} | |
.c2 { | |
@include clearfix; | |
} | |
.c3 { | |
@include box-shadow(red, 2px, 0, 10px); | |
} |
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
.my-box { | |
background: red; | |
} | |
.my-other-box { | |
background: green; | |
} | |
.c1, .my-box { | |
-moz-box-shadow: black 0 1px 5px 0; | |
-webkit-box-shadow: black 0 1px 5px 0; | |
-o-box-shadow: black 0 1px 5px 0; | |
box-shadow: black 0 1px 5px 0; | |
} | |
.c2, .my-box, .my-other-box { | |
overflow: hidden; | |
*zoom: 1; | |
} | |
.c3, .my-other-box { | |
-moz-box-shadow: red 2px 0 10px 0; | |
-webkit-box-shadow: red 2px 0 10px 0; | |
-o-box-shadow: red 2px 0 10px 0; | |
box-shadow: red 2px 0 10px 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment