1 | :global {
|
2 | @function str-replace($string, $search, $replace) {
|
3 | $index: str-index($string, $search);
|
4 |
|
5 | @if $index {
|
6 | @return str-slice($string, 1, $index - 1) + $replace + str-replace(
|
7 | str-slice($string, $index + str-length($search)), $search, $replace
|
8 | );
|
9 | }
|
10 |
|
11 | @return $string;
|
12 | }
|
13 |
|
14 | @function clean-url($url) {
|
15 | $fixed-url: str-replace(str-replace($url, "http:/", "http://"), "http:///", "http://");
|
16 | @return $fixed-url;
|
17 | }
|
18 |
|
19 | |
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | @mixin box-sizing($type) {
|
28 | -webkit-box-sizing:$type;
|
29 | -moz-box-sizing:$type;
|
30 | box-sizing:$type;
|
31 | }
|
32 |
|
33 | |
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | @mixin circle {
|
40 | @include border-radius(100%);
|
41 | }
|
42 |
|
43 | |
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | @mixin square($size) {
|
52 | width: $size;
|
53 | height: $size;
|
54 | }
|
55 |
|
56 |
|
57 | |
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | @mixin vertical-align {
|
66 | position: relative;
|
67 | top: 50%;
|
68 | -webkit-transform: translateY(-50%);
|
69 | -ms-transform: translateY(-50%);
|
70 | transform: translateY(-50%);
|
71 | }
|
72 |
|
73 | |
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | @mixin gradient($start-color, $end-color, $orientation) {
|
85 | background: $start-color;
|
86 |
|
87 |
|
88 | @if $orientation == vertical {
|
89 | background: -moz-linear-gradient(top, $start-color 0%, $end-color 100%);
|
90 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,$start-color), color-stop(100%,$end-color));
|
91 | background: -webkit-linear-gradient(top, $start-color 0%,$end-color 100%);
|
92 | background: -o-linear-gradient(top, $start-color 0%,$end-color 100%);
|
93 | background: -ms-linear-gradient(top, $start-color 0%,$end-color 100%);
|
94 | background: linear-gradient(to bottom, $start-color 0%,$end-color 100%);
|
95 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='$start-color', endColorstr='$end-color',GradientType=0 );
|
96 |
|
97 |
|
98 | } @else if $orientation == horizontal {
|
99 | background: -moz-linear-gradient(left, $start-color 0%, $end-color 100%);
|
100 | background: -webkit-gradient(linear, left top, right top, color-stop(0%,$start-color), color-stop(100%,$end-color));
|
101 | background: -webkit-linear-gradient(left, $start-color 0%,$end-color 100%);
|
102 | background: -o-linear-gradient(left, $start-color 0%,$end-color 100%);
|
103 | background: -ms-linear-gradient(left, $start-color 0%,$end-color 100%);
|
104 | background: linear-gradient(to right, $start-color 0%,$end-color 100%);
|
105 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='$start-color', endColorstr='$end-color',GradientType=1 );
|
106 |
|
107 |
|
108 | } @else {
|
109 | background: -moz-radial-gradient(center, ellipse cover, $start-color 0%, $end-color 100%);
|
110 | background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,$start-color), color-stop(100%,$end-color));
|
111 | background: -webkit-radial-gradient(center, ellipse cover, $start-color 0%,$end-color 100%);
|
112 | background: -o-radial-gradient(center, ellipse cover, $start-color 0%,$end-color 100%);
|
113 | background: -ms-radial-gradient(center, ellipse cover, $start-color 0%,$end-color 100%);
|
114 | background: radial-gradient(ellipse at center, $start-color 0%,$end-color 100%);
|
115 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='$start-color', endColorstr='$end-color',GradientType=1 );
|
116 | }
|
117 | }
|
118 |
|
119 | |
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 | %clearfix {
|
126 | *zoom: 1;
|
127 | &:before, &:after {
|
128 | content: " ";
|
129 | display: table;
|
130 | }
|
131 | &:after {
|
132 | clear: both;
|
133 | }
|
134 | }
|
135 | }
|
136 |
|
137 | @mixin height($height) {
|
138 | height: $height;
|
139 | min-height: $height;
|
140 | max-height: $height;
|
141 | }
|
142 |
|
143 | @mixin width($width) {
|
144 | width: $width;
|
145 | min-width: $width;
|
146 | max-width: $width;
|
147 | }
|