Last active
August 29, 2015 13:56
-
-
Save jamesslock/9125094 to your computer and use it in GitHub Desktop.
Diamond mixin
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
// Fluid Squares | |
// ------------------------------------------------------- | |
@mixin box($box-size: 80px, $fluid: false) { | |
display: block; | |
position: relative; | |
height: 0; | |
width: $box-size; | |
padding-bottom: $box-size; | |
@if($fluid) { | |
height: 0; | |
padding-bottom: $box-size; | |
} | |
@else { | |
height: $box-size; | |
} | |
} | |
// Diamonds | |
// ------------------------------------------------------- | |
@mixin diamond($degrees: 45deg) { | |
display: block; | |
position: relative; | |
-webkit-transform: rotate($degrees); | |
-moz-transform: rotate($degrees); | |
-ms-transform: rotate($degrees); | |
-o-transform: rotate($degrees); | |
transform: rotate($degrees); | |
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos($degrees)}, M12=#{-1*sin($degrees)}, M21=#{sin($degrees)}, M22=#{cos($degrees)})"; | |
filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos($degrees)}, M12=#{-1*sin($degrees)}, M21=#{sin($degrees)}, M22=#{cos($degrees)}); | |
> * { | |
display: block; | |
position: relative; | |
-webkit-transform: rotate(-$degrees); | |
-moz-transform: rotate(-$degrees); | |
-ms-transform: rotate(-$degrees); | |
-o-transform: rotate(-$degrees); | |
transform: rotate(-$degrees); | |
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos(-$degrees)}, M12=#{-1*sin(-$degrees)}, M21=#{sin(-$degrees)}, M22=#{cos(-$degrees)})"; | |
filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos(-$degrees)}, M12=#{-1*sin(-$degrees)}, M21=#{sin(-$degrees)}, M22=#{cos(-$degrees)}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment