1 @function linear-gradient-bevel($direction, $bg-color) {
2 @return linear-gradient($direction, color_stops(
3 lighten($bg-color, 15%),
4 lighten($bg-color, 8%) 30%,
10 @function linear-gradient-glossy($direction, $bg-color) {
11 @return linear-gradient($direction, color_stops(
12 lighten($bg-color, 15%),
13 lighten($bg-color, 5%) 50%,
19 @function linear-gradient-recessed($direction, $bg-color) {
20 @return linear-gradient($direction, color_stops(
21 darken($bg-color, 10%),
22 darken($bg-color, 5%) 10%,
24 lighten($bg-color, .5%)
28 @function linear-gradient-matte($direction, $bg-color) {
29 @return linear-gradient($direction, color_stops(
30 lighten($bg-color, 3%),
35 @function linear-gradient-matte-reverse($direction, $bg-color) {
36 @return linear-gradient($direction, color_stops(
37 darken($bg-color, 6%),
38 lighten($bg-color, 4%)
42 @function linear-gradient-panel-header($direction, $bg-color) {
43 @return linear-gradient($direction, color_stops(
44 adjust-color($bg-color, $hue: -0.857deg, $saturation: -1.63%, $lightness: 3.529%),
45 adjust-color($bg-color, $hue: 0.158deg, $saturation: -1.21%, $lightness: 0.392%) 45%,
46 adjust-color($bg-color, $hue: 1.154deg, $saturation: 0.607%, $lightness: -7.647%) 46%,
47 adjust-color($bg-color, $hue: 1.154deg, $saturation: 0.607%, $lightness: -7.647%) 50%,
48 adjust-color($bg-color, $hue: 1.444deg, $saturation: -1.136%, $lightness: -4.706%) 51%,
53 @function linear-gradient-tabbar($direction, $bg-color) {
54 @return linear-gradient($direction, color_stops(
55 adjust-color($bg-color, $hue: 0.0deg, $saturation: 1.604%, $lightness: 4.706%),
60 @function linear-gradient-tab($direction, $bg-color) {
61 @return linear-gradient($direction, color_stops(
62 adjust-color($bg-color, $hue: 1.382deg, $saturation: -18.571%, $lightness: -4.902%),
63 adjust-color($bg-color, $hue: 0.43deg, $saturation: -10.311%, $lightness: -2.157%) 25%,
68 @function linear-gradient-tab-active($direction, $bg-color) {
69 @return linear-gradient($direction, color_stops(
70 adjust-color($bg-color, $hue: -212.903deg, $saturation: -88.571%, $lightness: 6.863%),
71 adjust-color($bg-color, $hue: 0.43deg, $saturation: -6.753%, $lightness: 4.706%) 25%,
76 @function linear-gradient-tab-over($direction, $bg-color) {
77 @return linear-gradient($direction, color_stops(
78 adjust-color($bg-color, $hue: 4.462deg, $saturation: -9.524%, $lightness: -3.725%),
79 adjust-color($bg-color, $hue: 2.272deg, $saturation: 0.0%, $lightness: -1.569%) 25%,
84 @function linear-gradient-tab-disabled($direction, $bg-color) {
85 @return linear-gradient($direction, color_stops(
87 adjust-color($bg-color, $hue: -0.267deg, $saturation: 18.571%, $lightness: 2.941%)
91 @function linear-gradient-grid-header($direction, $bg-color) {
92 @return linear-gradient($direction, color_stops(
93 adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: 20.392%),
94 adjust-color($bg-color, $hue: 220.0deg, $saturation: 5.66%, $lightness: 12.353%)
98 @function linear-gradient-grid-header-over($direction, $bg-color) {
99 @return linear-gradient($direction, color_stops(
100 adjust-color($bg-color, $hue: 0.175deg, $saturation: 0.967%, $lightness: 14.118%),
101 adjust-color($bg-color, $hue: 0.175deg, $saturation: 0.967%, $lightness: 14.118%) 39%,
102 adjust-color($bg-color, $hue: 0.372deg, $saturation: 0.101%, $lightness: 10.196%) 40%,
103 adjust-color($bg-color, $hue: 0.372deg, $saturation: 0.101%, $lightness: 10.196%)
107 @function linear-gradient-grid-row-over($direction, $bg-color) {
108 @return linear-gradient($direction, color_stops(
109 adjust-color($bg-color, $hue: 0.175deg, $saturation: 0.967%, $lightness: 14.118%),
114 @function linear-gradient-grid-cell-special($direction, $bg-color) {
115 @return linear-gradient($direction, color_stops(
121 @function linear-gradient-glossy-button($direction, $bg-color) {
122 @return linear-gradient($direction, color_stops(
124 adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: -2.353%) 48%,
125 adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: -11.373%) 52%,
126 adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: -9.412%)
130 @function linear-gradient-glossy-button-over($direction, $bg-color) {
131 @return linear-gradient($direction, color_stops(
133 adjust-color($bg-color, $hue: 1.754deg, $saturation: 0.0%, $lightness: -2.157%) 48%,
134 adjust-color($bg-color, $hue: 5.833deg, $saturation: -35.135%, $lightness: -9.216%) 52%,
135 adjust-color($bg-color, $hue: 5.833deg, $saturation: -27.273%, $lightness: -7.647%)
139 @function linear-gradient-glossy-button-pressed($direction, $bg-color) {
140 @return linear-gradient($direction, color_stops(
142 adjust-color($bg-color, $hue: -1.839deg, $saturation: -2.18%, $lightness: 2.157%) 48%,
143 adjust-color($bg-color, $hue: -2.032deg, $saturation: 37.871%, $lightness: -4.706%) 52%,
144 adjust-color($bg-color, $hue: -1.641deg, $saturation: 36.301%, $lightness: -2.549%)
148 // Patch compass background-image mixin to fix EXTJSIV-9723.
149 // This patch is only guaranteed to be compatible with the current Sencha Cmd-bundled
150 // version of compass - 0.12.2
151 // Remove this override when proper support for w3c style gradients is implemented in
152 // the compass framework. For more info see:
153 // https://github.com/chriseppstein/compass/issues/965#ref-pullrequest-10812518
154 @mixin background-image(
166 $images: compact($image-1, $image-2, $image-3, $image-4, $image-5, $image-6, $image-7, $image-8, $image-9, $image-10);
167 $add-pie-bg: prefixed(-pie, $images) or -compass-list-size($images) > 1;
169 @if $experimental-support-for-svg and prefixed(-svg, $images) { background-image: -svg($images); background-size: 100%; }
170 @if $support-for-original-webkit-gradients and prefixed(-owg, $images) { background-image: -owg($images); }
171 @if $experimental-support-for-webkit and prefixed(-webkit, $images) { background-image: -webkit($images); }
172 @if $experimental-support-for-mozilla and prefixed(-moz, $images) { background-image: -moz($images); }
173 @if $experimental-support-for-opera and prefixed(-o, $images) { background-image: -o($images); }
174 @if $experimental-support-for-pie and $add-pie-bg { @warn "PIE does not support background-image. Use @include background(#{$images}) instead." }
176 background-image: -ms-#{$images};
178 background-image: $images ;
182 * Creates a background gradient.
186 * @include background-gradient(#808080, matte, left);
189 * @param {Color} $bg-color The background color of the gradient
190 * @param {String/List} [$type=$base-gradient] The type of gradient to be used. Can either
191 * be a String which is a predefined gradient name, or it can can be a list of color stops.
192 * If null is passed, this mixin will still set the `background-color` to $bg-color.
193 * The available predefined gradient names are:
209 * * grid-cell-special
211 * * glossy-button-over
212 * * glossy-button-pressed
214 * Each of these gradient names corresponds to a function named linear-gradient[name].
215 * Themes can override these functions to customize the color stops that they return.
216 * For example, to override the glossy-button gradient function add a function named
217 * "linear-gradient-glossy-button" to a file named "sass/etc/mixins/background-gradient.scss"
218 * in your theme. The function should return the result of calling the Compass linear-gradient
219 * function with the desired direction and color-stop information for the gradient. For example:
221 * @function linear-gradient-glossy-button($direction, $bg-color) {
222 * @return linear-gradient($direction, color_stops(
223 * mix(#fff, $bg-color, 10%),
225 * mix(#000, $bg-color, 5%) 51%,
230 * @param {String} [$direction=top] The direction of the gradient. Can either be
235 @mixin background-gradient($bg-color, $type: $base-gradient, $direction: top) {
236 background-image: none;
237 background-color: $bg-color;
239 @if not is-null($base-gradient) and $bg-color != transparent {
243 @if type-of($type) == "list" {
244 $gradient: linear-gradient($direction, $type);
248 @else if $type == bevel {
249 $gradient: linear-gradient-bevel($direction, $bg-color);
250 } @else if $type == glossy {
251 $gradient: linear-gradient-glossy($direction, $bg-color);
252 } @else if $type == recessed {
253 $gradient: linear-gradient-recessed($direction, $bg-color);
254 } @else if $type == matte {
255 $gradient: linear-gradient-matte($direction, $bg-color);
256 } @else if $type == matte-reverse {
257 $gradient: linear-gradient-matte-reverse($direction, $bg-color);
261 @else if $type == panel-header {
262 $gradient: linear-gradient-panel-header($direction, $bg-color);
263 } @else if $type == tabbar {
264 $gradient: linear-gradient-tabbar($direction, $bg-color);
265 } @else if $type == tab {
266 $gradient: linear-gradient-tab($direction, $bg-color);
267 } @else if $type == tab-active {
268 $gradient: linear-gradient-tab-active($direction, $bg-color);
269 } @else if $type == tab-over {
270 $gradient: linear-gradient-tab-over($direction, $bg-color);
271 } @else if $type == tab-disabled {
272 $gradient: linear-gradient-tab-disabled($direction, $bg-color);
273 } @else if $type == grid-header {
274 $gradient: linear-gradient-grid-header($direction, $bg-color);
275 } @else if $type == grid-header-over {
276 $gradient: linear-gradient-grid-header-over($direction, $bg-color);
277 } @else if $type == grid-row-over {
278 $gradient: linear-gradient-grid-row-over($direction, $bg-color);
279 } @else if $type == grid-cell-special {
280 $gradient: linear-gradient-grid-cell-special($direction, $bg-color);
281 } @else if $type == glossy-button or $type == glossy-button-disabled {
282 $gradient: linear-gradient-glossy-button($direction, $bg-color);
283 } @else if $type == glossy-button-over {
284 $gradient: linear-gradient-glossy-button-over($direction, $bg-color);
285 } @else if $type == glossy-button-pressed {
286 $gradient: linear-gradient-glossy-button-pressed($direction, $bg-color);
289 @if $gradient != null {
290 @include background-image($gradient);