Created
September 3, 2011 02:19
-
-
Save courtsimas/1190428 to your computer and use it in GitHub Desktop.
sass mixins
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
@mixin gradient($first, $second, $colorstop:0) { | |
background: $first; | |
background: -webkit-gradient(linear, left top, left bottom, from($first), color-stop($colorstop, $first), to($second)); | |
background: -moz-linear-gradient(top, $first $colorstop, $second); | |
} | |
@mixin border-gradient($first, $second, $colorstop:0) { | |
border-color:$first; | |
border-style:double; | |
-webkit-border-image: -webkit-gradient(linear, 0 100%, 0 0, from($first), to($second)) 1 100%; | |
} | |
@mixin box-shadow($first, $second:0){ | |
@if( $second == 0 ) { | |
-moz-box-shadow: $first; | |
-webkit-box-shadow: $first; | |
box-shadow: $first; | |
}@else{ | |
-moz-box-shadow: $first, $second; | |
-webkit-box-shadow: $first, $second; | |
box-shadow: $first, $second; | |
} | |
} | |
@mixin border-radius($radius) { | |
-webkit-border-radius: $radius; | |
-moz-border-radius: $radius; | |
border-radius: $radius; | |
} | |
@mixin oswald { | |
font-weight:normal; | |
font-family:'Oswald', Helvetica, Arial, Sans-serif; | |
} | |
@mixin helvetica { | |
font-weight:normal; | |
font-family:Helvetica, Arial, Sans-serif; | |
} | |
@mixin georgia { | |
font-style:italic; | |
font-family: Georgia, Arial Serif; | |
} | |
@mixin box-sizing { | |
-moz-box-sizing:border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing:border-box; | |
} | |
@mixin radius-circle { | |
@include border-radius(150px); | |
} | |
@mixin media_query($type, $filename, $background-size) { | |
@if $type == max { | |
@media only screen and (-webkit-max-device-pixel-ratio: 1.5), | |
only screen and (max--moz-device-pixel-ratio: 1.5), | |
only screen and (-o-max-device-pixel-ratio: 3/2), | |
only screen and (max-device-pixel-ratio: 1.5) { | |
background:image_url($filename) no-repeat; | |
-webkit-background-size:$background-size; | |
background-size:$background-size; | |
} | |
} | |
@if $type == min { | |
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), | |
only screen and (min--moz-device-pixel-ratio: 1.5), | |
only screen and (-o-min-device-pixel-ratio: 3/2), | |
only screen and (min-device-pixel-ratio: 1.5) { | |
background:image_url($filename) no-repeat; | |
-webkit-background-size:$background-size; | |
background-size:$background-size; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or
@include border-gradient(rgba(54, 63, 58, .5), rgba(54, 63, 58, .1));
@include box-shadow(rgba(0, 0, 0, 0.45) 0 4px 16px 0 inset, rgba(255,255,255, 0.25) 0 1px 1px 0);
@include border-gradient(rgba(54, 63, 58, .1), rgba(54, 63, 58, 1));