forked from madr/css3-sass-mixins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_all.sass
96 lines (83 loc) · 3.79 KB
/
_all.sass
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// ---- CSS3 SASS MIXINS ----
// https://github.com/madr/css3-sass-mixins
//
// Copyright (C) 2011 by Anders Ytterström
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
// Should IE filters be used or not?
// PROS: gradients, drop shadows etc will be handled by css.
// CONS: will harm the site performance badly,
// especially on sites with heavy rendering and scripting.
$useIEFilters: 0
// might be 0 or 1. disabled by default.
=border-image($path, $offsets, $repeats)
-moz-border-image: $path $offsets $repeats
-o-border-image: $path $offsets $repeats
-webkit-border-image: $path $offsets $repeats
border-image: $path $offsets $repeats
=border-radius($values)
-moz-border-radius: $values
-webkit-border-radius: $values
border-radius: $values
=box-shadow($x, $y, $offset, $hex, $ie: $useIEFilters)
-moz-box-shadow: $x $y $offset $hex
-webkit-box-shadow: $x $y $offset $hex
box-shadow: $x $y $offset $hex
@if $ie == 1
$iecolor: "#" + red($hex) + green($hex) + blue($hex)
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}')
-ms-filter: quote(progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}'))
=linear-gradient($from, $to, $ie: $useIEFilters)
@if $ie != 1
background-color: $to
background-image: -moz-linear-gradient($from, $to)
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, $from),color-stop(1, $to))
background-image: -webkit-linear-gradient($from, $to)
background-image: -o-linear-gradient($from, $to)
background-image: -ms-linear-gradient($from, $to)
@if $ie == 1
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}')
-ms-filter: quote(progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}'))
=rgba($hex, $alpha, $ie: $useIEFilters)
@if $ie == 1
$hexopac: "#" + ceil($alpha * 255 / 16 * 10) + $hex
background-color: none
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#{$hexopac}',EndColorStr='#{$hexopac}}')
-ms-filter: quote(progid:DXImageTransform.Microsoft.gradient(startColorStr='#{$hexopac}',EndColorStr='#{$hexopac}'))
@else
background-color: $hex
background-color: rgba(red($hex), green($hex), blue($hex), $alpha)
=rotate($deg, $ie: $useIEFilters)
-moz-transform: rotate(#{$deg}deg)
-o-transform: rotate(#{$deg}deg)
-webkit-transform: rotate(#{$deg}deg)
=scale ($size) {
-moz-transform: scale(#{$size})
-o-transform: scale(#{$size})
-ms-transform: scale(#{$size})
-webkit-transform: scale(#{$size})
}
=transition($value)
-moz-transition: $value
-o-transition: $value
-ms-transition: $value
-webkit-transition: $value
transition: $value
// ==== /CSS3 SASS MIXINS ====