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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
/***********************
! Check and Radio items
************************/
$suffix: if($variant == "dark", "-dark", "");
@mixin toggle($type) {
background-image: none;
-gtk-icon-source: url("../assets/#{$type}-unchecked#{$suffix}.svg");
&:disabled { -gtk-icon-source: url("../assets/#{$type}-unchecked-disabled#{$suffix}.svg"); }
&:checked, &:active {
-gtk-icon-source: url("../assets/#{$type}-checked#{$suffix}.svg");
&:disabled { -gtk-icon-source: url("../assets/#{$type}-checked-disabled#{$suffix}.svg"); }
}
&:indeterminate {
-gtk-icon-source: url("../assets/#{$type}-mixed#{$suffix}.svg");
&:disabled { -gtk-icon-source: url("../assets/#{$type}-mixed-disabled#{$suffix}.svg"); }
}
menuitem &, modelbutton & {
-gtk-icon-source: url("../assets/menuitem-#{$type}-unchecked.svg");
&:disabled {
-gtk-icon-source: url("../assets/menuitem-#{$type}-checked-disabled.svg");
}
&:checked, &:active {
-gtk-icon-source: url("../assets/menuitem-#{$type}-checked.svg");
&:hover { -gtk-icon-source: url("../assets/menuitem-#{$type}-checked-hover.svg"); }
&:disabled { -gtk-icon-source: url("../assets/menuitem-#{$type}-checked-disabled.svg"); }
}
&:indeterminate {
-gtk-icon-source: url("../assets/menuitem-#{$type}-mixed.svg");
&:hover { -gtk-icon-source: url("../assets/menuitem-#{$type}-mixed-hover.svg"); }
&:disabled { -gtk-icon-source: url("../assets/menuitem-#{$type}-mixed-disabled.svg"); }
}
}
}
@include exports("checkradio") {
radio {
@include toggle("radio");
min-width: 16px;
min-height: 16px;
margin-right: $spacing;
}
check {
@include toggle("checkbox");
min-width: 16px;
min-height: 16px;
margin-right: $spacing;
}
radio:dir(rtl), check:dir(rtl) {
margin-right: 0;
margin-left: $spacing;
}
//selection-mode
@each $s,$as in ('', '-unchecked'),
(':hover', '-unchecked'),
(':active', '-checked'),
(':backdrop', '-unchecked'),
(':checked', '-checked'),
(':checked:hover', '-checked'),
(':checked:active', '-checked'),
(':backdrop:checked', '-checked') {
.view.content-view.check#{$s}:not(list) {
-gtk-icon-shadow: none;
-gtk-icon-source: url("../assets/grid-selection#{$as}#{$suffix}.svg");
background-color: transparent;
}
}
}
/********
! Switch
*********/
@include exports("switch") {
switch {
border-radius: $roundness;
padding: $spacing - 1px;
border: none;
outline: none;
transition: background-color .3s linear;
min-width: 88px;
min-height: 24px;
background-color: $switch_bg_color;
color: $switch_fg_color;
box-shadow: inset 1px -1px 0 alpha($dark_shadow, .06), inset -1px 1px 0 alpha($dark_shadow, .06);
slider {
background-color: $switch_slider_bg_color;
transition: all 0.3s ease-in;
box-shadow: 0 1px 2px 0 alpha($dark_shadow, .07), 1px 0 2px 0 alpha($dark_shadow, .07);
border-radius: $roundness;
}
&:checked {
background-color: $selected_bg_color;
background-image: none;
border-color: $selected_bg_color;
color: $base_color;
slider {
background-color: $white;
box-shadow: 0 1px 3px 0 alpha($dark_shadow, .1);
}
}
&:disabled {
background-color: $switch_disabled_bg_color;
background-image: none;
border-color: $switch_disabled_border_color;
color: $switch_disabled_fg_color;
box-shadow: none;
slider {
background-color: $switch_disabled_slider_bg_color;
}
}
list row:selected & {
background-color: $switch_disabled_slider_bg_color;
color: $switch_disabled_bg_color;
slider {
background-color: mix($switch_disabled_bg_color, $base_color, .4);
}
&:checked {
color: $selected_bg_color;
background-color: $switch_slider_bg_color;
slider {
background-color: $selected_bg_color;
}
}
}
}
}
|