themes/whitey/gtk-3.0/_drawing.scss (view raw)
1//
2// Drawing mixins
3//
4// Generic drawing of more complex things
5//
6
7
8//
9// Default shadows
10//
11
12$z-depth-1: 0 1px 1px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.16);
13$z-depth-2: 0 2px 2px rgba(0, 0, 0, 0.12), 0 3px 4px rgba(0, 0, 0, 0.20);
14$z-depth-3: 0 5px 5px rgba(0, 0, 0, 0.16), 0 4px 4px rgba(0, 0, 0, 0.20);
15$z-depth-4: 0 6px 8px -4px rgba(0, 0, 0, 0.16),
16 0 10px 6px rgba(0, 0, 0, 0.20);
17$z-depth-5: 0 8px 10px -4px rgba(0, 0, 0, 0.20),
18 0 12px 8px rgba(0, 0, 0, 0.24);
19
20
21//
22// Header-bar shadows
23//
24
25$header-shadow-light: 0 1px 1px rgba(0, 0, 0, 0.16),
26 0 1px 2px rgba(0, 0, 0, 0.26),
27 0 2px 3px rgba(0, 0, 0, 0.32);
28$header-shadow-dark: 0 1px 1px rgba(0, 0, 0, 0.06),
29 0 1px 2px rgba(0, 0, 0, 0.14),
30 0 2px 3px rgba(0, 0, 0, 0.20);
31$sub-header-shadow-light-ltr: 0 1px 1px rgba(0, 0, 0, 0.16),
32 0 1px 2px rgba(0, 0, 0, 0.26),
33 0 2px 3px rgba(0, 0, 0, 0.32),
34 -5px 0 0 -1px $inverted_dark_color,
35 -2px 0 0 -1px $borders_color;
36$sub-header-shadow-dark-ltr: 0 1px 1px rgba(0, 0, 0, 0.06),
37 0 1px 2px rgba(0, 0, 0, 0.14),
38 0 2px 3px rgba(0, 0, 0, 0.20),
39 -5px 0 0 -1px $inverted_dark_color,
40 -2px 0 0 -1px $borders_color;
41$sub-header-shadow-light-rtl: 0 1px 1px rgba(0, 0, 0, 0.16),
42 0 1px 2px rgba(0, 0, 0, 0.26),
43 0 2px 3px rgba(0, 0, 0, 0.32),
44 5px 0 0 -1px $inverted_dark_color,
45 2px 0 0 -1px $borders_color;
46$sub-header-shadow-dark-rtl: 0 1px 1px rgba(0, 0, 0, 0.06),
47 0 1px 2px rgba(0, 0, 0, 0.14),
48 0 2px 3px rgba(0, 0, 0, 0.20),
49 5px 0 0 -1px $inverted_dark_color,
50 2px 0 0 -1px $borders_color;
51$selected-header-shadow-light-ltr: 0 1px 1px rgba(0, 0, 0, 0.16),
52 0 1px 2px rgba(0, 0, 0, 0.26),
53 0 2px 3px rgba(0, 0, 0, 0.32),
54 -5px 0 0 -1px $selected_bg_color,
55 -2px 0 0 -1px $solid_dark_borders_color;
56$selected-header-shadow-dark-ltr: 0 1px 1px rgba(0, 0, 0, 0.06),
57 0 1px 2px rgba(0, 0, 0, 0.14),
58 0 2px 3px rgba(0, 0, 0, 0.20),
59 -5px 0 0 -1px $selected_bg_color,
60 -2px 0 0 -1px $solid_dark_borders_color;
61$selected_header-shadow-light-rtl: 0 1px 1px rgba(0, 0, 0, 0.16),
62 0 1px 2px rgba(0, 0, 0, 0.26),
63 0 2px 3px rgba(0, 0, 0, 0.32),
64 5px 0 0 -1px $selected_bg_color,
65 2px 0 0 -1px $solid_dark_borders_color;
66$selected-header-shadow-dark-rtl: 0 1px 1px rgba(0, 0, 0, 0.06),
67 0 1px 2px rgba(0, 0, 0, 0.14),
68 0 2px 3px rgba(0, 0, 0, 0.20),
69 5px 0 0 -1px $selected_bg_color,
70 2px 0 0 -1px $solid_dark_borders_color;
71
72
73//
74// Side-bar shadows
75//
76
77$sidebar-light-ltr: inset -2px 2px 2px -2px rgba(0, 0, 0, 0.05),
78 inset -3px 3px 3px -2px rgba(0, 0, 0, 0.05);
79$sidebar-light-rtl: inset 2px 2px 2px -2px rgba(0, 0, 0, 0.05),
80 inset 3px 3px 3px -2px rgba(0, 0, 0, 0.05);
81$sidebar-dark-ltr: inset -2px 2px 1px -2px rgba(0, 0, 0, 0.02),
82 inset -3px 3px 3px -2px rgba(0, 0, 0, 0.06);
83$sidebar-dark-rtl: inset 2px 2px 1px -2px rgba(0, 0, 0, 0.02),
84 inset 3px 3px 3px -2px rgba(0, 0, 0, 0.06);
85
86
87//
88// Inline-toolbar shadows
89//
90
91$inline-shadow-light: inset 0 1px 2px -1px rgba(0, 0, 0, 0.02),
92 inset 0 2px 3px -2px rgba(0, 0, 0, 0.07);
93$inline-shadow-dark: inset 0 1px 2px -1px rgba(0, 0, 0, 0.03),
94 inset 0 3px 4px -3px rgba(0, 0, 0, 0.06);
95
96
97//
98// Reorderable-tab shadows
99//
100
101$tab-shadow-light: -1px 0 2px rgba(0, 0, 0, 0.02),
102 -1px 0 4px rgba(0, 0, 0, 0.02),
103 1px 0 2px rgba(0, 0, 0, 0.02),
104 1px 0 4px rgba(0, 0, 0, 0.02);
105$tab-shadow-dark: -1px 0 2px rgba(0, 0, 0, 0.02),
106 -1px 0 4px rgba(0, 0, 0, 0.03),
107 1px 0 2px rgba(0, 0, 0, 0.02),
108 1px 0 4px rgba(0, 0, 0, 0.03);
109
110
111//
112// Menubar shadows
113//
114
115$menubar-shadow: inset 0 2px 2px -3px rgba(0, 0, 0, 0.26),
116 inset 0 5px 3px -5px rgba(0, 0, 0, 0.39),
117 inset 0 -1px $borders_color;
118
119
120//
121// Toolbar shadows
122//
123
124$toolbar-shadow-light: inset 0 1px 1px rgba(0, 0, 0, 0.18),
125 inset 0 4px 2px -4px rgba(0, 0, 0, 0.20),
126 inset 0 8px 3px -5px rgba(0, 0, 0, 0.24);
127$toolbar-shadow-dark: inset 0 1px 1px rgba(0, 0, 0, 0.20),
128 inset 0 4px 3px -4px rgba(0, 0, 0, 0.22),
129 inset 0 8px 3px -5px rgba(0, 0, 0, 0.24);
130
131
132/******************
133 * Ripple effects *
134 ******************/
135
136//
137// Ripple effects
138//
139
140@keyframes ripple_effect {
141//
142// Ripple effect drawing function
143//
144
145 from {
146 background-image: -gtk-gradient(radial,
147 center center, 0,
148 center center, 0.001,
149 to(gtkalpha(currentColor, 0.1)),
150 to(transparent)),
151 linear-gradient(to bottom, gtkalpha(currentColor, 0));
152 }
153 to {
154 background-image: -gtk-gradient(radial,
155 center center, 0,
156 center center, 0.4,
157 to(gtkalpha(currentColor, 0.1)),
158 to(transparent)),
159 linear-gradient(to bottom, gtkalpha(currentColor, 0.1));
160 }
161}
162
163@keyframes flat_ripple_effect {
164 from {
165 background-image: -gtk-gradient(radial,
166 center center, 0,
167 center center, 0.001,
168 to(gtkalpha(currentColor, 0.1)),
169 to(transparent)),
170 linear-gradient(to bottom, gtkalpha(currentColor, 0.1));
171 }
172 to {
173 background-image: -gtk-gradient(radial,
174 center center, 0,
175 center center, 0.4,
176 to(gtkalpha(currentColor, 0.1)),
177 to(transparent)),
178 linear-gradient(to bottom, gtkalpha(currentColor, 0.1));
179 }
180}
181
182@keyframes list_ripple_effect {
183 from {
184 background-image: -gtk-gradient(radial,
185 center center, 0,
186 center center, 0.001,
187 to(gtkalpha(currentColor, 0)),
188 to(transparent)),
189 linear-gradient(to bottom, gtkalpha(currentColor, 0.05));
190 }
191 to {
192 background-image: -gtk-gradient(radial,
193 center center, 0,
194 center center, 0.4,
195 to(gtkalpha(currentColor, 0.1)),
196 to(transparent)),
197 linear-gradient(to bottom, gtkalpha(currentColor, 0.1));
198 }
199}
200
201
202//
203// Entries
204//
205
206@mixin entry($t, $fc:$selected_bg_color) {
207//
208// Entries drawing function
209//
210// $t: entry type
211// $fc: focus color
212//
213// possible $t values:
214// normal, focus, insensitive, flat-normal, flat-focus, flat-insensitive;
215//
216
217 @if $t==normal {
218 border-radius: 0;
219 outline-radius: 0;
220 border-color: $solid_light_borders_color;
221 border-image: -gtk-gradient(radial,
222 center bottom, 0,
223 center bottom, 0.5,
224 to($track_color),
225 to(transparent))
226 0 0 1 / 0 0 1px;
227 background-color: transparent;
228 color: $secondary_fg_color;
229 }
230 @if $t==focus {
231 border-color: $solid_light_borders_color;
232 border-image: -gtk-gradient(radial,
233 center bottom, 0,
234 center bottom, 0.5,
235 to($fc),
236 to(transparent))
237 0 0 2 / 0 0 2px;
238 color: $fg_color;
239 transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1),
240 box-shadow 0 cubic-bezier(0.4, 0, 0.2, 1) 0.2s, color 0;
241 }
242 @if $t==insensitive {
243 border-color: $solid_light_borders_color;
244 border-image: -gtk-gradient(radial,
245 center bottom, 0,
246 center bottom, 0.5,
247 to($track_color),
248 to(transparent))
249 0 0 1 / 0 0 1px;
250 background-color: transparent;
251 color: $insensitive_fg_color;
252 }
253 @if $t==flat-normal {
254 border-radius: 0;
255 outline-radius: 0;
256 border-color: $solid_light_borders_color;
257 border-image: -gtk-gradient(radial,
258 center bottom, 0,
259 center bottom, 0.5,
260 to($track_color),
261 to(transparent))
262 0 0 1 / 0 0 1px;
263 background-color: transparent;
264 color: $secondary_fg_color;
265 }
266 @if $t==flat-focus {
267 border-color: $solid_light_borders_color;
268 border-image: -gtk-gradient(radial,
269 center bottom, 0,
270 center bottom, 0.5,
271 to($fc),
272 to(transparent))
273 0 0 2 / 0 0 2px;
274 color: $fg_color;
275 transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1),
276 box-shadow 0 cubic-bezier(0.4, 0, 0.2, 1) 0.2s, color 0;
277 }
278 @if $t==flat-insensitive {
279 border-color: $solid_light_borders_color;
280 border-image: -gtk-gradient(radial,
281 center bottom, 0,
282 center bottom, 0.5,
283 to($track_color),
284 to(transparent))
285 0 0 1 / 0 0 1px;
286 color: $insensitive_fg_color;
287 }
288}
289
290
291//
292// Buttons
293//
294
295@mixin button($t, $c:$light_color, $tc:$fg_color) {
296//
297// Button drawing function
298//
299// $t: button type,
300// $c: base button color for colored* types
301// $tc: optional text color for colored* types
302//
303// possible $t values:
304// normal, hover, active, insensitive, checked, checked-insensitive,
305// flat-normal, flat-hover, flat-active, flat-insensitive, flat-checked,
306// flat-checked-insensitive, undecorated
307//
308
309 @if $t==normal {
310 //
311 // normal button
312 //
313 box-shadow: $z-depth-1,
314 inset 0 1px $highlight_color;
315 background-color: $c;
316 background-image: -gtk-gradient(radial,
317 center center, 0,
318 center center, 0.5,
319 to(gtkalpha(currentColor, 0)),
320 to(transparent)),
321 linear-gradient(to bottom, gtkalpha(currentColor, 0));
322 color: $secondary_fg_color;
323 }
324
325 @else if $t==hover {
326 //
327 // hovered button
328 //
329 box-shadow: $z-depth-2,
330 inset 0 1px $highlight_color;
331 background-image: -gtk-gradient(radial,
332 center center, 0,
333 center center, 0.5,
334 to(gtkalpha(currentColor, 0)),
335 to(transparent)),
336 linear-gradient(to bottom, gtkalpha(currentColor, 0));
337 color: $fg_color;
338 }
339
340 @else if $t==active {
341 //
342 // pushed button
343 //
344 box-shadow: $z-depth-2,
345 inset 0 1px $highlight_color;
346 color: $fg_color;
347 transition-duration: 0;
348 animation: ripple_effect 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
349 }
350 @else if $t==insensitive {
351 //
352 // insensitive button
353 //
354 box-shadow: none;
355 background-color: $track_color;
356 color: if($tc!=$fg_color, $insensitive_fg_color,
357 $insensitive_secondary_fg_color);
358 > .label { color: inherit; }
359 }
360 @else if $t==checked {
361 //
362 // checked button
363 //
364 box-shadow: $z-depth-1,
365 inset 0 1px $highlight_color;
366 background-color: $selected_bg_color;
367 color: $selected_fg_color;
368 }
369 @else if $t==checked-insensitive {
370 //
371 // checked insensitive button
372 //
373 box-shadow: none;
374 background-color: $track_color;
375 color: gtkopacity($selected_bg_color, 0.4);
376 > .label { color: inherit; }
377 }
378
379 @else if $t==flat-normal {
380 //
381 // normal flat button
382 //
383 box-shadow: none;
384 background-color: transparent;
385 background-image: -gtk-gradient(radial,
386 center center, 0,
387 center center, 0.5,
388 to(gtkalpha(currentColor, 0)),
389 to(transparent)),
390 linear-gradient(to bottom, gtkalpha(currentColor, 0));
391 }
392 @else if $t==flat-hover {
393 //
394 // hovered flat button
395 //
396 box-shadow: none;
397 background-image: -gtk-gradient(radial,
398 center center, 0,
399 center center, 0.5,
400 to(gtkalpha(currentColor, 0)),
401 to(transparent)),
402 linear-gradient(to bottom, gtkalpha(currentColor, 0.1));
403 }
404 @else if $t==flat-active {
405 //
406 // pushed flat button
407 //
408 box-shadow: none;
409 animation: flat_ripple_effect 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
410 }
411 @else if $t==flat-insensitive {
412 //
413 // insensitive flat button
414 //
415 box-shadow: none;
416 background-color: transparent;
417 }
418 @else if $t==flat-checked {
419 //
420 // checked flat button
421 //
422 background-color: $track_color;
423 color: $fg_color;
424 }
425 @else if $t==flat-checked-insensitive {
426 //
427 // checked flat insensitive button
428 //
429 > .label { color: inherit; }
430 }
431
432 @else if $t==undecorated {
433 //
434 // reset
435 //
436 border-color: transparent;
437 background-color: transparent;
438 background-image: none;
439 box-shadow: none;
440 text-shadow: none;
441 icon-shadow: none;
442 }
443}
444
445
446//
447// Overshoot
448//
449
450@mixin overshoot($p, $t:normal, $c:$secondary_selected_bg_color) {
451//
452// Overshoot drawing function
453//
454// $p: position
455// $t: type
456// $c: base color
457//
458// possible $p values:
459// top, bottom, right, left
460//
461// possible $t values:
462// normal, backdrop
463//
464
465 $_position: center $p;
466
467 @if ($p == left) or ($p == right) {
468 $_position: $p center;
469 }
470
471 background-image: -gtk-gradient(radial,
472 $_position, 0,
473 $_position, 0.75,
474 to(gtkopacity($c, 0.2)),
475 to(transparent));
476
477 background-repeat: no-repeat;
478 background-position: $_position;
479
480 // reset some properties to be sure to not inherit them somehow
481 background-color: transparent;
482 border: none;
483 box-shadow: none;
484}
485
486
487//
488// Undershoot
489//
490
491@mixin undershoot($p, $fading_color: $base_color) {
492//
493// Undershoot drawing function
494//
495// $p: position
496//
497// possible $p values:
498// top, bottom, right, left
499//
500
501 // shouldn't be needed, but better to be sure
502 background: transparent;
503
504 $_gradient_dir: $p;
505 $_fader_size: 16px 32px;
506 $_gradient_repeat: repeat-x;
507 $_bg_pos: center $p;
508
509 @if ($p == left) or ($p == right) {
510 $_fader_size: 32px 16px;
511 $_gradient_repeat: repeat-y;
512 $_bg_pos: $p center;
513 }
514
515 // this is the dashed line
516 background-image: linear-gradient(to $_gradient_dir,
517 gtkopacity($fading_color, 0.01),
518 gtkopacity($fading_color, 0.04),
519 gtkopacity($fading_color, 0.20),
520 gtkopacity($fading_color, 0.44),
521 gtkopacity($fading_color, 0.94));
522
523 padding-#{$p}: 0;
524 background-size: $_fader_size;
525 background-repeat: $_gradient_repeat;
526 background-origin: content-box;
527 background-position: $_bg_pos;
528}
529