// @ border-radius // ================================================================================ @mixin border-radius($top_left: none, $top_right: none, $bot_right: none, $bot_left: none) { @if $top_right != none { @if $bot_right != none { -moz-border-radius: $top_left $top_right $bot_right $bot_left; -webkit-border-radius: $top_left $top_right $bot_right $bot_left; border-radius: $top_left $top_right $bot_right $bot_left; } @else { -moz-border-radius: $top_left $top_right; -webkit-border-radius: $top_left $top_right; border-radius: $top_left $top_right; } } @else { -moz-border-radius: $top_left; -webkit-border-radius: $top_left; border-radius: $top_left; } } // @ box-shadow // ================================================================================ @mixin box-shadow($hor: 0, $ver: 0, $blur: 3px, $spread: 0, $color: rgba(0, 0, 0, 0.5), $inset: false) { @if $hor != none { @if $inset != inset { -moz-box-shadow: $hor $ver $blur $spread $color; -webkit-box-shadow: $hor $ver $blur $spread $color; box-shadow: $hor $ver $blur $spread $color; } @else { -moz-box-shadow: inset $hor $ver $blur $spread $color; -webkit-box-shadow: inset $hor $ver $blur $spread $color; box-shadow: inset $hor $ver $blur $spread $color; } } @else { -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } } // @ flexslider // ================================================================================ @mixin flexslider() { margin: 0; background: none; border: 0; border-radius: 0; box-shadow: none; } // @ font-icons // ================================================================================ @mixin icon($position: before, $icon: false, $styles: true) { @if $position == both { $position: 'before, &:after'; } // Either a :before or :after pseudo-element, or both, defaulting to :before &:#{$position} { @if $icon { // A particular icon has been specified content: "#{map-get($icons, $icon)}"; } @if $styles { // Supportive icon styles required speak: none; font-style: normal; font-weight: normal; font-family: 'FontAwesome'; } // Include any extra rules supplied for the pseudo-element @content; } } // @ linear-gradient // ================================================================================ @mixin linear-gradient($start, $stop) { background-image: -moz-linear-gradient(top, $start, $stop); background-image: -ms-linear-gradient(top, $start, $stop); background-image: -o-linear-gradient(top, $start, $stop); background-image: -webkit-gradient(linear, left top, left bottom, from($start), to($stop)); filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#{$start}', EndColorStr='#{$stop}', GradientType=0); } // @ opacity // ================================================================================ @mixin opacity($opacity) { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + round($opacity * 100) + ")"; filter: alpha(opacity = round($opacity * 100)); -moz-opacity: $opacity; -khtml-opacity: $opacity; opacity: $opacity; } // @ pixels-to-ems // ================================================================================ @function pxtoem($target, $context){ @return ($target/$context)+0em; } // @ retina-images // ================================================================================ @mixin retina($file, $ext, $w, $h) { background-image: url($file + '.' + $ext); // @media all and (-webkit-min-device-pixel-ratio: 1.5) { // background-image: url($file + '@2x.' + $ext); // background-size: $w $h; // } @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (-moz-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) { background-image: url($file + '@2x.' + $ext); background-size: $w $h; } } // @ rgba-background // ================================================================================ @mixin rgba($r, $g, $b, $a) { background: rgb($r, $g, $b); background: rgba($r, $g, $b, $a); } // @ rotate // ================================================================================ @mixin rotate($deg) { -moz-transform: rotate($deg); -ms-transform: rotate($deg); -o-transform: rotate($deg); -webkit-transform: rotate($deg); } // @ text-shadow // ================================================================================ @mixin text-shadow($hor: 1px, $ver: 1px, $blur: 0, $color: none) { text-shadow: ($hor $ver $blur $color); } // @ transition // ================================================================================ @mixin transition($prop: all, $dur: 0.3s, $func: ease, $delay: 0s) { -moz-transition: $prop $dur $func $delay; -o-transition: $prop $dur $func $delay; -webkit-transition: $prop $dur $func $delay; transition: $prop $dur $func $delay; }