_background-gradient-legacy.scss
7.09 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/**
* @mixin background-gradient
*
* @param {Color} $background-color The background color of the gradient
* @param {String/List} $type The type of gradient to be used. Can either be a String which is a predefined gradient, or it can
* can be a list of color_stops. If none is set, it will still set the `background-color` to the $background-color.
* @param {String} $direction The direction of the gradient. Can either me `top` or `left`. (defaults to `top`)
*/
@mixin background-gradient($bg-color, $type: $base-gradient, $direction: top) {
background-image: none;
background-color: $bg-color;
@if $base-gradient != null and $bg-color != transparent {
//color_stops
@if type-of($type) == "list" {
@include background-image(linear-gradient($direction, $type));
}
//default gradients
@else if $type == bevel {
@include background-image(linear-gradient($direction, color_stops(
lighten($bg-color, 15%),
lighten($bg-color, 8%) 30%,
$bg-color 65%,
darken($bg-color, 6%)
)));
} @else if $type == glossy {
@include background-image(linear-gradient($direction, color_stops(lighten($bg-color, 15%), lighten($bg-color, 5%) 50%, $bg-color 51%, darken($bg-color, 5%))));
} @else if $type == recessed {
@include background-image(linear-gradient($direction, color_stops(darken($bg-color, 10%), darken($bg-color, 5%) 10%, $bg-color 65%, lighten($bg-color, .5%))));
} @else if $type == matte {
@include background-image(linear-gradient($direction, color_stops(lighten($bg-color, 15%), lighten($bg-color, 4%) 4%, darken($bg-color, 4%))));
} @else if $type == matte-reverse {
@include background-image(linear-gradient($direction, color_stops(darken($bg-color, 6%), lighten($bg-color, 4%))));
} @else if $type == glossy-toolbar {
@include background-image(linear-gradient($direction, color_stops(#F0F5FA, #DAE6F4 2%, #CEDDEF)));
}
//ext3.3 gradients
@else if $type == panel-header {
@include background-image(linear-gradient($direction, color_stops(
adjust-color($bg-color, $hue: -0.857deg, $saturation: -1.63%, $lightness: 3.529%),
adjust-color($bg-color, $hue: 0.158deg, $saturation: -1.21%, $lightness: 0.392%) 45%,
adjust-color($bg-color, $hue: 1.154deg, $saturation: 0.607%, $lightness: -7.647%) 46%,
adjust-color($bg-color, $hue: 1.154deg, $saturation: 0.607%, $lightness: -7.647%) 50%,
adjust-color($bg-color, $hue: 1.444deg, $saturation: -1.136%, $lightness: -4.706%) 51%,
$bg-color
)));
} @else if $type == tabbar {
@include background-image(linear-gradient($direction, color_stops(
adjust-color($bg-color, $hue: 0.0deg, $saturation: 1.604%, $lightness: 4.706%),
$bg-color
)));
} @else if $type == tab {
@include background-image(linear-gradient($direction, color_stops(
adjust-color($bg-color, $hue: 1.382deg, $saturation: -18.571%, $lightness: -4.902%),
adjust-color($bg-color, $hue: 0.43deg, $saturation: -10.311%, $lightness: -2.157%) 25%,
$bg-color 45%
)));
} @else if $type == tab-active {
@include background-image(linear-gradient($direction, color_stops(
adjust-color($bg-color, $hue: -212.903deg, $saturation: -88.571%, $lightness: 6.863%),
adjust-color($bg-color, $hue: 0.43deg, $saturation: -6.753%, $lightness: 4.706%) 25%,
$bg-color 45%
)));
} @else if $type == tab-over {
@include background-image(linear-gradient($direction, color_stops(
adjust-color($bg-color, $hue: 4.462deg, $saturation: -9.524%, $lightness: -3.725%),
adjust-color($bg-color, $hue: 2.272deg, $saturation: 0.0%, $lightness: -1.569%) 25%,
$bg-color 45%
)));
} @else if $type == tab-disabled {
@include background-image(linear-gradient($direction, color_stops(
$bg-color,
adjust-color($bg-color, $hue: -0.267deg, $saturation: 18.571%, $lightness: 2.941%)
)));
} @else if $type == grid-header {
@include background-image(linear-gradient($direction, color_stops(
adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: 20.392%),
adjust-color($bg-color, $hue: 220.0deg, $saturation: 5.66%, $lightness: 12.353%)
)));
} @else if $type == grid-header-over {
@include background-image(linear-gradient($direction, color_stops(
adjust-color($bg-color, $hue: 0.175deg, $saturation: 0.967%, $lightness: 14.118%),
adjust-color($bg-color, $hue: 0.175deg, $saturation: 0.967%, $lightness: 14.118%) 39%,
adjust-color($bg-color, $hue: 0.372deg, $saturation: 0.101%, $lightness: 10.196%) 40%,
adjust-color($bg-color, $hue: 0.372deg, $saturation: 0.101%, $lightness: 10.196%)
)));
} @else if $type == grid-row-over {
@include background-image(linear-gradient($direction, color_stops(
adjust-color($bg-color, $hue: 0.175deg, $saturation: 0.967%, $lightness: 14.118%),
$bg-color
)));
} @else if $type == grid-cell-special {
@include background-image(linear-gradient(left, color_stops(
$bg-color,
darken($bg-color, 5)
)));
} @else if $type == glossy-button or $type == glossy-button-disabled {
@include background-image(linear-gradient($direction, color_stops(
$bg-color,
adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: -2.353%) 48%,
adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: -11.373%) 52%,
adjust-color($bg-color, $hue: 0deg, $saturation: 0%, $lightness: -9.412%)
)));
} @else if $type == glossy-button-over {
@include background-image(linear-gradient($direction, color_stops(
$bg-color,
adjust-color($bg-color, $hue: 1.754deg, $saturation: 0.0%, $lightness: -2.157%) 48%,
adjust-color($bg-color, $hue: 5.833deg, $saturation: -35.135%, $lightness: -9.216%) 52%,
adjust-color($bg-color, $hue: 5.833deg, $saturation: -27.273%, $lightness: -7.647%)
)));
} @else if $type == glossy-button-pressed {
@include background-image(linear-gradient($direction, color_stops(
$bg-color,
adjust-color($bg-color, $hue: -1.839deg, $saturation: -2.18%, $lightness: 2.157%) 48%,
adjust-color($bg-color, $hue: -2.032deg, $saturation: 37.871%, $lightness: -4.706%) 52%,
adjust-color($bg-color, $hue: -1.641deg, $saturation: 36.301%, $lightness: -2.549%)
)));
}
}
}