Debian Codegraph @

src/gtk3/widgets/_entry.scss

raw
1 @charset "UTF-8";
2
3 @mixin entry(
4 $t,
5 $fc: gtk("@theme_view_active_decoration_color")
6 ) {
7 //
8 // Entries drawing function
9 //
10 // $t: entry type
11 // $fc: focus color
12 // $edge: set to none to not draw the bottom edge or specify a color to not
13 // use the default one
14 //
15 // possible $t values:
16 // normal, focus, insensitive, backdrop, backdrop-insensitive, osd, osd-focus, osd-backdrop;
17 //
18 @if $t==normal {
19 color: gtk("@theme_text_color");
20 border-color: gtk("@borders");
21 background-color: gtk("@theme_base_color");
22 box-shadow: none;
23 }
24
25 @if $t==focus {
26 border-color: $fc;
27 }
28
29 @if $t==insensitive {
30 color: gtk("@insensitive_base_fg_color");
31 border-color: gtk("@insensitive_borders");
32 background-color: gtk("@insensitive_base_color");
33 }
34
35 @if $t==backdrop {
36 color: gtk("@theme_unfocused_text_color");
37 border-color: gtk("@unfocused_borders");
38 background-color: gtk("@theme_unfocused_base_color");
39 }
40
41 @if $t==backdrop-insensitive {
42 color: gtk("@theme_unfocused_view_text_color");
43 border-color: gtk("@unfocused_insensitive_borders");
44 background-color: gtk("@theme_unfocused_view_bg_color");
45 }
46 }
47
48 /****************
49 * Text Entries *
50 ****************/
51
52 %entry,
53 entry {
54 %entry_basic,
55 & {
56 min-height: 30px;
57 padding-left: 8px;
58 padding-right: 8px;
59 border: 1px solid;
60 border-radius: $r;
61
62 @include entry(normal);
63
64 image {
65 // icons inside the entry
66 &.left {
67 padding-left: 0;
68 padding-right: 6px;
69 }
70 &.right {
71 padding-left: 6px;
72 padding-right: 0;
73 }
74 }
75 // FIXME
76 // undershoot {
77 // &.left { @include undershoot(left); }
78 // &.right { @include undershoot(right); }
79 // }
80
81 &.flat {
82 &:focus,
83 & {
84 min-height: 0;
85 padding: 2px;
86 @include entry(normal);
87 }
88 }
89 &:focus {
90 @include entry(focus);
91 }
92 &:disabled {
93 @include entry(insensitive);
94 }
95 &:backdrop {
96 @include entry(backdrop);
97 }
98 &:backdrop:disabled {
99 @include entry(backdrop-insensitive);
100 }
101
102 selection {
103 &:focus,
104 & {
105 @extend %selected_items;
106 }
107 }
108
109 @each $e_type, $e_color in (error, gtk("@error_color")),
110 (warning, gtk("@warning_color"))
111 {
112 &.#{$e_type} {
113 color: $e_color;
114 border-color: $e_color;
115 background-color: gtkalpha($e_color, 0.5);
116 &:focus {
117 @include entry(focus, $e_color);
118 background-color: gtkalpha($e_color, 0.5);
119 }
120 &:selected,
121 &:selected:focus {
122 background-color: $e_color;
123 }
124 &:backdrop {
125 @if $e_color == gtk("@error_color") {
126 color: gtk("@error_color_backdrop");
127 border-color: gtk("@error_color_backdrop");
128 background-color: gtkalpha(
129 gtk("@error_color_backdrop"),
130 0.5
131 );
132 } @else if $e_color == gtk("@warning_color") {
133 color: gtk("@warning_color_backdrop");
134 border-color: gtk("@warning_color_backdrop");
135 background-color: gtkalpha(
136 gtk("@warning_color_backdrop"),
137 0.5
138 );
139 }
140 }
141 }
142 }
143
144 image {
145 // entry icons colors
146 color: gtkmix(
147 gtk("@theme_fg_color"),
148 gtk("@theme_text_color"),
149 0.8
150 );
151 &:hover {
152 color: gtk("@theme_button_decoration_hover");
153 }
154 &:active {
155 color: gtk("@theme_button_decoration_focus");
156 }
157 &:backdrop {
158 color: gtkmix(
159 gtk("@theme_unfocused_fg_color"),
160 gtk("@theme_unfocused_fg_color"),
161 0.8
162 );
163 }
164 }
165 // FIXME
166 // &:drop(active) {
167 // &:focus, & {
168 // border-color: $drop_target_color;
169 // box-shadow: inset 0 0 0 1px $drop_target_color;
170 // }
171 // }
172 }
173
174 progress {
175 margin: 1px;
176 border-radius: 0;
177 border-width: 0 0 2px;
178 border-color: gtk("@theme_selected_bg_color");
179 border-style: solid;
180 background-image: none;
181 background-color: transparent;
182 box-shadow: none;
183 &:backdrop {
184 background-color: transparent;
185 border-color: gtk(
186 "@theme_unfocused_selected_bg_color"
187 );
188 }
189 }
190 }
191
192 treeview acceleditor > label {
193 background-color: gtk("@theme_selected_bg_color");
194 }
195
196 treeview entry {
197 &.flat,
198 & {
199 border-radius: 0;
200 background-image: none;
201 background-color: gtk("@theme_base_color");
202
203 &:focus {
204 border-color: gtk(
205 "@theme_view_active_decoration_color"
206 );
207 }
208 }
209 }
210
211 combobox > box > button.combo:not(:only-child) {
212 background: none;
213 @include entry(normal);
214
215 &:focus {
216 @include entry(focus);
217 }
218 &:disabled {
219 @include entry(insensitive);
220 }
221 &:backdrop {
222 @include entry(backdrop);
223 }
224 &:backdrop:disabled {
225 @include entry(backdrop-insensitive);
226 }
227 }