Created
July 7, 2012 02:30
-
-
Save minusfive/3063944 to your computer and use it in GitHub Desktop.
Sass Buttons 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
// CSS Transitions | |
=transition( $transition ) | |
$transition: unquote( $transition ) | |
-webkit-transition: $transition | |
-moz-transition: $transition | |
-ms-transition: $transition | |
-o-transition: $transition | |
transition: $transition | |
=transition-property( $property ) | |
$property: unquote( $property ) | |
-webkit-transition-property: $property | |
-moz-transition-property: $property | |
-ms-transition-property: $property | |
-o-transition-property: $property | |
transition-property: $property | |
=transition-duration( $duration ) | |
$duration: unquote( $duration ) | |
-webkit-transition-duration: $duration | |
-moz-transition-duration: $duration | |
-ms-transition-duration: $duration | |
-o-transition-duration: $duration | |
transition-duration: $duration | |
=transition-easing( $easing ) | |
$easing: unquote( $easing ) | |
-webkit-transition-timing-function: $easing | |
-moz-transition-timing-function: $easing | |
-ms-transition-timing-function: $easing | |
-o-transition-timing-function: $easing | |
transition-timing-function: $easing | |
// Decoration | |
=box-shadow( $shadow ) | |
$shadow: unquote( $shadow ) | |
-webkit-box-shadow: $shadow | |
-moz-box-shadow: $shadow | |
-ms-box-shadow: $shadow | |
-o-box-shadow: $shadow | |
box-shadow: $shadow | |
=border-radius( $radius ) | |
-webkit-border-radius: $radius | |
-moz-border-radius: $radius | |
-ms-border-radius: $radius | |
-o-border-radius: $radius | |
border-radius: $radius | |
=background-vertical-gradient( $startcolor, $endcolor ) | |
background: | |
color: $startcolor | |
image: -webkit-linear-gradient(top, $startcolor, $endcolor) | |
image: -moz-linear-gradient(top, $startcolor, $endcolor) | |
image: -ms-linear-gradient(top, $startcolor, $endcolor) // IE 10+ | |
image: -o-linear-gradient(top, $startcolor, $endcolor) | |
image: linear-gradient(top, $startcolor, $endcolor) | |
position: top left | |
repeat: no-repeat | |
=background-horizontal-gradient( $startcolor, $endcolor ) | |
background: | |
color: $startcolor | |
image: -webkit-linear-gradient(left, $startcolor, $endcolor) | |
image: -moz-linear-gradient(left, $startcolor, $endcolor) | |
image: -ms-linear-gradient(left, $startcolor, $endcolor) // IE 10+ | |
image: -o-linear-gradient(left, $startcolor, $endcolor) | |
image: linear-gradient(left, $startcolor, $endcolor) | |
position: top left | |
repeat: no-repeat | |
=background-size($size) | |
-webkit-background-size: $size | |
-moz-background-size: $size | |
-ms-background-size: $size | |
-o-background-size: $size | |
background-size: $size | |
=rotate( $deg ) | |
-webkit-transform: rotate($deg) | |
-moz-transform: rotate($deg) | |
-ms-transform: rotate($deg) | |
-o-transform: rotate($deg) | |
transform: rotate($deg) | |
=appearance( $appearance ) | |
-webkit-appearance: $appearance | |
-moz-appearance: $appearance | |
-ms-appearance: $appearance | |
-o-appearance: $appearance | |
appearance: $appearance |
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
// Usage example | |
a.button, input[type=submit], button | |
font-size: 16px // Button is automatically resized proportionally to font size. | |
+button( #06c ) // Button base color as parameter. No parameter = grey button. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment