Created
April 26, 2012 08:03
-
-
Save raecoo/2497354 to your computer and use it in GitHub Desktop.
CSS3 Button Styles
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
// | |
// Generic | |
// | |
=vendor($rule, $value) | |
-webkit-#{$rule}: $value | |
-moz-#{$rule}: $value | |
-o-#{$rule}: $value | |
-ms-#{$rule}: $value | |
#{$rule}: $value | |
// | |
// Rounded Corners | |
// | |
=border-radius($radius) | |
-moz-border-radius: $radius | |
-webkit-border-radius: $radius | |
border-radius: $radius | |
=border-top-left-radius($radius) | |
-moz-border-radius-topleft: $radius | |
-webkit-border-top-left-radius: $radius | |
border-top-left-radius: $radius | |
=border-top-right-radius($radius) | |
-moz-border-radius-topright: $radius | |
-webkit-border-top-right-radius: $radius | |
border-top-right-radius: $radius | |
=border-bottom-left-radius($radius) | |
-moz-border-radius-bottomleft: $radius | |
-webkit-border-bottom-left-radius: $radius | |
border-bottom-left-radius: $radius | |
=border-bottom-right-radius($radius) | |
-moz-border-radius-bottomright: $radius | |
-webkit-border-bottom-right-radius: $radius | |
border-bottom-right-radius: $radius | |
=border-top-radius($radius) | |
+border-top-right-radius($radius) | |
+border-top-left-radius($radius) | |
=border-bottom-radius($radius) | |
+border-bottom-right-radius($radius) | |
+border-bottom-left-radius($radius) | |
=border-left-radius($radius) | |
+border-top-left-radius($radius) | |
+border-bottom-left-radius($radius) | |
=border-right-radius($radius) | |
+border-top-right-radius($radius) | |
+border-bottom-right-radius($radius) | |
// | |
// Box Shadow | |
// | |
=box-shadow($x, $y, $blur, $color : black, $inset : false) | |
@if $inset == "inset" | |
-moz-box-shadow: inset $x $y $blur $color /* FF3.5+ */ | |
-webkit-box-shadow: inset $x $y $blur $color /* Saf3.0+, Chrome */ | |
box-shadow: inset $x $y $blur $color /* Opera 10.5, IE 9.0 */ | |
@else | |
-moz-box-shadow: $x $y $blur $color /* FF3.5+ */ | |
-webkit-box-shadow: $x $y $blur $color /* Saf3.0+, Chrome */ | |
box-shadow: $x $y $blur $color /* Opera 10.5, IE 9.0 */ | |
// IE 6, 7 | |
filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$color}')" | |
// IE 8 | |
-ms-filter: "\"progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$color}')\"" | |
// | |
// Gradients | |
// | |
=vertical-gradient($from, $to, $bgcolor : "", $extra : "") | |
@if $bgcolor != "" | |
background-color: $bgcolor | |
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#{$from}), to(#{$to})) #{$extra} | |
background-image: -moz-linear-gradient(top, #{$from}, #{$to}) #{$extra} | |
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}') | |
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}')" | |
=horizontal-gradient($from, $to, $bgcolor : "") | |
@if $bgcolor != "" | |
background-color: $bgcolor | |
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#{$from}), to(#{$to})) | |
background-image: -moz-linear-gradient(top, #{$from}, #{$to}) | |
// No IE style that I'm aware of does this. | |
// | |
// Rotation | |
// | |
=rotate($degrees) | |
$percent: $degrees / 360.0 | |
-moz-transform: rotate(#{$degrees}deg) | |
-o-transform: rotate(#{$degrees}) | |
-webkit-transform: rotate(#{$degrees}deg) | |
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$percent}) | |
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$percent})" | |
// | |
// Animation | |
// | |
=animate($properties:"all",$durations:"0.5s") | |
+vendor(transition-property, $properties) | |
+vendor(transition-duration, $durations) | |
// | |
// Box Model | |
// | |
=border-box | |
-webkit-box-sizing: border-box | |
-moz-box-sizing: border-box | |
box-sizing: border-box | |
=transform($transformation) | |
+vendor(transform,$transformation) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Screenshot http://cl.ly/1E2x2L0m0g2K0H2t3F3c