Debian Codegraph @

dark/gtk-3.0/_common.scss

raw
1 @function gtkalpha($c,$a) {
2 @return unquote("alpha(#{$c},#{$a})");
3 }
4
5 $ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
6 $asset_suffix: if($variant=='dark', '-dark', '');
7 $backdrop_transition: 200ms ease-out;
8 $button_transition: all 200ms $ease-out-quad;
9 $button_radius: 3px;
10
11 * {
12 padding: 0;
13 -GtkToolButton-icon-spacing: 4;
14 -GtkTextView-error-underline-color: $error_color;
15
16 // The size for scrollbars. The slider is 2px smaller, but we keep it
17 // up so that the whole area is sensitive to button presses for the
18 // slider. The stepper button is larger in both directions, the slider
19 // only in the width
20
21 -GtkScrolledWindow-scrollbar-spacing: 0;
22
23 -GtkToolItemGroup-expander-size: 11;
24
25 -GtkWidget-text-handle-width: 20;
26 -GtkWidget-text-handle-height: 24;
27
28 -GtkDialog-button-spacing: 4;
29 -GtkDialog-action-area-border: 0;
30
31 // We use the outline properties to signal the focus properties
32 // to the adwaita engine: using real CSS properties is faster,
33 // and we don't use any outlines for now.
34
35 outline-color: gtkalpha(currentColor, 0.3);
36 outline-style: dashed;
37 outline-offset: -3px;
38 outline-width: 1px;
39 -gtk-outline-radius: 2px;
40
41 -gtk-secondary-caret-color: $selected_bg_color
42 }
43
44 selection { @extend %selected_items; }
45
46 /***************
47 * Base States *
48 ***************/
49 .background {
50 color: $fg_color;
51 background-color: $bg_color;
52
53 &:backdrop {
54 color: $backdrop_fg_color;
55 background-color: $backdrop_bg_color;
56 text-shadow: none;
57 -gtk-icon-shadow: none;
58 }
59 }
60
61 /*
62 These wildcard seems unavoidable, need to investigate.
63 Wildcards are bad and troublesome, use them with care,
64 or better, just don't.
65 Everytime a wildcard is used a kitten dies, painfully.
66 */
67
68 spinner:disabled,
69 arrow:disabled,
70 scrollbar:disabled,
71 check:disabled,
72 radio:disabled,
73 treeview.expander:disabled { -gtk-icon-effect: dim; }
74
75 .gtkstyle-fallback {
76 color: $fg_color;
77 background-color: $bg_color;
78 text-shadow: none;
79
80 &:hover {
81 color: $fg_color;
82 background-color: lighten($bg_color, 10%);
83 }
84
85 &:active {
86 color: $fg_color;
87 background-color: darken($bg_color, 10%);
88 }
89
90 &:disabled {
91 color: $insensitive_fg_color;
92 background-color: $insensitive_bg_color;
93 }
94
95 &:selected {
96 color: $selected_fg_color;
97 background-color: $selected_bg_color;
98 }
99 }
100
101 .view,
102 %view {
103 color: $text_color;
104 background-color: $base_color;
105
106 &:backdrop {
107 color: $backdrop_text_color;
108 background-color: $backdrop_base_color;
109 &:disabled { color: $backdrop_insensitive_color; }
110 }
111
112 &:disabled {
113 color: $insensitive_fg_color;
114 background-color: $insensitive_bg_color;
115 }
116
117 &:selected {
118 @extend %selected_items;
119 &:focus, & {
120 border-radius: 3px;
121 }
122 }
123 }
124
125 .view,
126 textview {
127 text {
128 @extend %view;
129 }
130 }
131
132 textview border { background-color: mix($bg_color, $base_color, 50%); }
133
134 iconview { @extend .view; }
135
136 .rubberband,
137 rubberband {
138 border: 1px solid darken($selected_bg_color, 10%);
139 background-color: transparentize(darken($selected_bg_color, 10%), 0.8);
140 }
141
142 flowbox {
143 rubberband { @extend rubberband; }
144
145 flowboxchild {
146 padding: 3px;
147 border-radius: 3px;
148
149 &:selected {
150 @extend %selected_items;
151
152 outline-offset: -2px;
153 }
154 }
155 }
156
157 .content-view .tile {
158 margin: 2px;
159 background-color: if($variant=='light', transparent, black);
160 border-radius: 0;
161 padding: 0;
162
163 &:backdrop { background-color: if($variant=='light', transparent, darken($backdrop_base_color,5%)); }
164 &:active, &:selected { background-color: if($variant=='light', transparent, $selected_bg_color); }
165 &:disabled { background-color: if($variant=='light', transparent, $insensitive_bg_color); }
166 }
167
168 label {
169 caret-color: currentColor; // this shouldn't be needed.
170
171 &.separator {
172 @extend .dim-label;
173
174 color: $fg_color;
175
176 &:backdrop { color: $backdrop_fg_color; }
177 }
178
179 row:selected &,
180 &:selected { @extend %nobg_selected_items; }
181
182 &:disabled {
183 color: $insensitive_fg_color;
184
185 button & { color: inherit; }
186
187 &:backdrop {
188 color: $backdrop_insensitive_color;
189
190 button & { color: inherit; }
191 }
192
193 selection { @extend %selected_items:disabled; }
194 }
195
196 // Special case for selections in labels.
197 // (because `selection:backdrop` does not apply)
198 &:backdrop selection {
199 color: $backdrop_selected_fg_color;
200 background-color: $backdrop_selected_bg_color;
201 }
202 }
203
204 .dim-label {
205 opacity: 0.55;
206 text-shadow: none;
207 }
208
209 assistant {
210 .sidebar {
211 background-color: $base_color;
212 border-top: 1px solid $borders_color;
213
214 &:backdrop {
215 background-color: $backdrop_base_color;
216 border-color: $backdrop_borders_color;
217 }
218 }
219
220 &.csd .sidebar { border-top-style: none; }
221
222 .sidebar label { padding: 6px 12px; }
223
224 .sidebar label.highlight { background-color: mix($bg_color, $fg_color, 80%); }
225 }
226
227 %osd,
228 .osd {
229 color: $osd_fg_color;
230 border: none;
231 background-color: $osd_bg_color;
232 background-clip: padding-box;
233 outline-color: transparentize($osd_fg_color, 0.7);
234 text-shadow: 0 1px black;
235 -gtk-icon-shadow: 0 1px black;
236
237 &:backdrop {
238 color: shade($osd_fg_color, 1.2);
239 background-color: shade($osd_bg_color, 1.6);
240 text-shadow: none;
241 -gtk-icon-shadow: none;
242 }
243 }
244
245
246 /*********************
247 * Spinner Animation *
248 *********************/
249 @keyframes spin {
250 to { -gtk-icon-transform: rotate(1turn); }
251 }
252
253 spinner {
254 background: none;
255 &:backdrop { color: $backdrop_fg_color; }
256 opacity: 0; // non spinning spinner makes no sense
257 -gtk-icon-source: -gtk-icontheme('process-working-symbolic');
258
259 &:checked {
260 opacity: 1;
261 animation: spin 1s linear infinite;
262
263 &:disabled { opacity: 0.5; }
264 }
265 }
266
267
268 /****************
269 * Text Entries *
270 ****************/
271
272 %entry,
273 entry {
274 %entry_basic, & {
275 min-height: 28px;
276 padding-left: 4px;
277 padding-right: 4px;
278 border: 1px solid;
279 border-radius: 3px;
280 transition: all 200ms $ease-out-quad;
281
282 @include entry(normal);
283
284 image { // icons inside the entry
285 &.left { margin-right: 6px; }
286 &.right { margin-left: 6px; }
287 }
288
289 undershoot {
290 &.left { @include undershoot(left); }
291 &.right { @include undershoot(right); }
292 }
293
294 &.flat {
295 &:focus, &:backdrop, &:disabled, &:backdrop:disabled, & {
296 min-height: 0;
297 padding: 2px;
298 background-color: transparent;
299 border-color: transparent;
300 border-radius: 0;
301 }
302 }
303
304 &:focus { @include entry(focus); }
305
306 &:disabled { @include entry(insensitive); }
307
308 &:backdrop {
309 @include entry(backdrop);
310
311 transition: $backdrop_transition;
312 }
313
314 &:backdrop:disabled { @include entry(backdrop-insensitive); }
315
316 // entry error and warning style
317 @each $e_type, $e_color in (error, $error_color),
318 (warning, $warning_color) {
319 &.#{$e_type} {
320 background-color: transparentize($e_color, 0.9);
321 color: $e_color;
322 text-shadow: none;
323 border-color: entry_focus_border($e_color);
324
325 &:focus { @include entry(focus, $e_color); }
326
327 selection { background-color: $e_color; }
328 }
329 }
330
331 image { // entry icons colors
332 color: mix($fg_color, $base_color, 80%);
333
334 &:hover { color: $fg_color; }
335
336 &:active { color: $selected_bg_color; }
337
338 &:backdrop { color: mix($backdrop_fg_color, $backdrop_base_color, 80%); }
339 }
340
341 &:drop(active) {
342 &:focus, & {
343 border-color: $drop_target_color;
344 box-shadow: inset 0 0 0 1px $drop_target_color;
345 }
346 }
347
348 .osd & {
349 @include entry(osd);
350
351 &:focus { @include entry(osd-focus); }
352
353 &:backdrop { @include entry(osd-backdrop); }
354
355 &:disabled { @include entry(osd-insensitive); }
356 }
357 }
358
359 progress {
360 margin: 2px -6px;
361 background-color: transparent;
362 background-image: none;
363 border-radius: 0;
364 border-width: 0 0 2px;
365 border-color: $selected_bg_color;
366 border-style: solid;
367 box-shadow: none;
368
369 &:backdrop { background-color: transparent; }
370 }
371
372 // linked entries
373 .linked:not(.vertical) > & { @extend %linked; }
374 .linked:not(.vertical) > &:focus + &,
375 .linked:not(.vertical) > &:focus + button,
376 .linked:not(.vertical) > &:focus + combobox > box > button.combo { border-left-color: entry_focus_border(); }
377
378 .linked:not(.vertical) > &:focus.error + &,
379 .linked:not(.vertical) > &:focus.error + button,
380 .linked:not(.vertical) > &:focus.error + combobox > box > button.combo { border-left-color: entry_focus_border($error_color); }
381
382 .linked:not(.vertical) > &:drop(active) + &,
383 .linked:not(.vertical) > &:drop(active) + button,
384 .linked:not(.vertical) > &:drop(active) + combobox > box > button.combo { border-left-color: $drop_target_color; }
385
386 // Vertically linked entries
387 // FIXME: take care of "colored" entries
388 .linked.vertical > & {
389 @extend %linked_vertical;
390
391 // brighter border between linked entries
392 &:not(:disabled) + entry:not(:disabled),
393 &:not(:disabled) + %entry:not(:disabled) {
394 border-top-color: mix($borders_color, $base_color, 30%);
395 background-color: $base_color;
396
397 &:backdrop {
398 border-top-color: mix($backdrop_borders_color, $backdrop_base_color, 30%);
399 background-color: $backdrop_base_color;
400 }
401 }
402
403 // brighter border between linked insensitive entries
404 &:disabled + %entry:disabled,
405 &:disabled + entry:disabled { border-top-color: mix($borders_color, $base_color, 30%); }
406
407 // color back the top border of a linked focused entry following another entry and add back the focus shadow.
408 // :not(:only-child) is a specificity bump hack.
409 + %entry:focus:not(:only-child),
410 + entry:focus:not(:only-child) { border-top-color: entry_focus_border(); }
411
412 + %entry:focus.error:not(:only-child),
413 + entry:focus.error:not(:only-child) { border-top-color: entry_focus_border($error_color); }
414
415 + %entry:drop(active):not(:only-child),
416 + entry:drop(active):not(:only-child) { border-top-color: $drop_target_color; }
417
418 // this takes care of coloring the top border of the focused entry subsequent widget.
419 // :not(:only-child) is a specificity bump hack.
420 &:focus:not(:only-child) {
421 + %entry,
422 + entry,
423 + button,
424 + combobox > box > button.combo { border-top-color: entry_focus_border(); }
425 }
426
427 &:focus.error:not(:only-child) {
428 + %entry,
429 + entry,
430 + button,
431 + combobox > box > button.combo { border-top-color: entry_focus_border($error_color); }
432 }
433
434 &:drop(active):not(:only-child) {
435 + %entry,
436 + entry,
437 + button,
438 + combobox > box > button.combo { border-top-color: $drop_target_color; }
439 }
440 }
441 }
442
443 treeview entry {
444 &:focus {
445 &:dir(rtl), &:dir(ltr) { // specificity bump hack
446 background-color: $base_color;
447 transition-property: color, background;
448 }
449 }
450
451 &.flat, & {
452 border-radius: 0;
453 background-image: none;
454 background-color: $base_color;
455
456 &:focus { border-color: $selected_bg_color; }
457 }
458 }
459
460 /***********
461 * Buttons *
462 ***********/
463 // stuff for .needs-attention
464 $_dot_color: if($variant=='light', $selected_bg_color,
465 lighten($selected_bg_color,15%));
466 @keyframes needs_attention {
467 from {
468 background-image: -gtk-gradient(radial,
469 center center, 0,
470 center center, 0.01,
471 to($_dot_color),
472 to(transparent));
473 }
474
475 to {
476 background-image: -gtk-gradient(radial,
477 center center, 0,
478 center center, 0.5,
479 to($selected_bg_color),
480 to(transparent));
481 }
482 }
483
484 %button,
485 button {
486 @at-root %button_basic, & {
487
488 min-height: 24px;
489 min-width: 22px;
490 padding: 1px 2px;
491 border: 1px solid;
492 border-radius: 3px;
493 transition: $button_transition;
494
495 @include button(normal);
496
497 &.flat {
498 @include button(undecorated);
499 // to avoid adiacent buttons borders clashing when transitioning, the transition on the normal state is set
500 // to none, while it's added back in the hover state, so the button decoration will fade in on hover, but
501 // it won't fade out when the pointer leave the button allocation area. To make the transition more evident
502 // in this case the duration is increased.
503 transition: none;
504
505 &:hover {
506 transition: $button_transition;
507 transition-duration: 500ms;
508
509 &:active { transition: $button_transition; }
510 }
511 }
512
513 &:hover {
514 @include button(hover);
515 -gtk-icon-effect: highlight;
516 }
517
518 &:active,
519 &:checked {
520 @include button(active);
521
522 transition-duration: 50ms;
523 }
524
525 &:backdrop {
526 &.flat, & {
527 @include button(backdrop);
528
529 transition: $backdrop_transition;
530 -gtk-icon-effect: none;
531
532 &:active,
533 &:checked { @include button(backdrop-active); }
534
535 &:disabled {
536 @include button(backdrop-insensitive);
537
538 &:active,
539 &:checked { @include button(backdrop-insensitive-active); }
540 }
541 }
542 }
543
544 &.flat { &:backdrop, &:disabled, &:backdrop:disabled { @include button(undecorated); }}
545
546 &:disabled {
547 @include button(insensitive);
548
549 &:active,
550 &:checked { @include button(insensitive-active); }
551 }
552
553 &.image-button {
554 min-height: 20px;
555 min-width: 20px;
556 padding: 2px;
557 }
558
559 &.text-button {
560 padding-left: 8px;
561 padding-right: 8px;
562 }
563
564 &.text-button.image-button {
565 padding-left: 4px;
566 padding-right: 4px;
567
568 label {
569 padding-left: 4px;
570 padding-right: 4px;
571 }
572 }
573
574 &:drop(active) {
575 color: $drop_target_color;
576 border-color: $drop_target_color;
577 box-shadow: inset 0 0 0 1px $drop_target_color;
578 }
579 }
580
581 @at-root %button_selected, & {
582 row:selected & {
583 @if $variant == 'light' { border-color: $selected_borders_color; }
584
585 &.flat:not(:active):not(:checked):not(:hover):not(disabled) {
586 color: $selected_fg_color;
587 border-color: transparent;
588
589 &:backdrop { color: if($variant=='light', $backdrop_base_color, $backdrop_fg_color); }
590 }
591 }
592 }
593
594
595 // big standalone buttons like in Documents pager
596 &.osd {
597 min-width: 24px;
598 min-height: 32px;
599
600 &.image-button { min-width: 32px; }
601
602 color: $osd_fg_color;
603 border-radius: 5px;
604 outline-color: transparentize($osd_fg_color, 0.7); //FIXME: define a color var?
605
606 @include button(osd);
607
608 border: none;
609 box-shadow: none;
610
611 &:hover {
612 @include button(osd-hover);
613
614 border: none;
615 box-shadow: none;
616 }
617
618 &:active,
619 &:checked {
620 @include button(osd-active);
621
622 border: none;
623 box-shadow: none;
624 }
625
626 &:disabled {
627 &:backdrop, & {
628 @include button(osd-insensitive);
629
630 border: none;
631 }
632 }
633
634 &:backdrop {
635 @include button(osd-backdrop);
636
637 border: none;
638 }
639 }
640
641 //overlay / OSD style
642 @at-root %osd_button,
643 .osd & {
644 @include button(osd);
645
646 &:hover { @include button(osd-hover); }
647
648 &:active,
649 &:checked { &:backdrop, & { @include button(osd-active); }}
650
651 &:disabled { &:backdrop, & { @include button(osd-insensitive); }}
652
653 &:backdrop { @include button(osd-backdrop); }
654
655 &.flat {
656 @include button(undecorated);
657
658 box-shadow: none; //FIXME respect no edge on the button mixin
659 text-shadow: 0 1px black;
660 -gtk-icon-shadow: 0 1px black;
661
662 &:hover { @include button(osd-hover); }
663
664 &:disabled {
665 @include button(osd-insensitive);
666 background-image: none;
667 border-color: transparent;
668 box-shadow: none;
669 }
670
671 &:backdrop { @include button(undecorated); }
672
673 &:active,
674 &:checked { @include button(osd-active); }
675 }
676 }
677
678 // Suggested and Destructive Action buttons
679 @each $b_type, $b_color in (suggested-action, $selected_bg_color),
680 (destructive-action, $destructive_color) {
681 &.#{$b_type} {
682 @include button(normal, $b_color, white);
683
684 &.flat {
685 @include button(undecorated);
686
687 color: $b_color; //FIXME: does it work on the dark variant?
688 }
689
690 &:hover { @include button(hover, $b_color, white); }
691
692 &:active,
693 &:checked { @include button(active, $b_color, white); }
694
695 &:backdrop,
696 &.flat:backdrop {
697 @include button(backdrop, $b_color, white);
698
699 &:active,
700 &:checked { @include button(backdrop-active, $b_color, white); }
701
702 &:disabled {
703 @include button(backdrop-insensitive);
704
705 &:active,
706 &:checked { @include button(backdrop-insensitive-active, $b_color, white); }
707 }
708 }
709
710 &.flat {
711 &:backdrop, &:disabled, &:backdrop:disabled {
712 @include button(undecorated);
713
714 color: transparentize($b_color, 0.2);
715 }
716 }
717
718 &:disabled {
719 @include button(insensitive, $b_color, white);
720
721 &:active,
722 &:checked { @include button(insensitive-active, $b_color, white); }
723 }
724
725 .osd & {
726 @include button(osd, $b_color);
727
728 &:hover { @include button(osd-hover, $b_color); }
729
730 &:active,
731 &:checked { &:backdrop, & { @include button(osd-active, $b_color); }}
732
733 &:disabled { &:backdrop, & { @include button(osd-insensitive, $b_color); }}
734
735 &:backdrop { @include button(osd-backdrop, $b_color); }
736 }
737 }
738 }
739
740 .stack-switcher > & {
741 // to position the needs attention dot, padding is added to the button
742 // child, a label needs just lateral padding while an icon needs vertical
743 // padding added too.
744
745 outline-offset: -3px; // needs to be set or it gets overriden by GtkRadioButton outline-offset
746
747 > label {
748 padding-left: 6px; // label padding
749 padding-right: 6px; //
750 }
751
752 > image {
753 padding-left: 6px; // image padding
754 padding-right: 6px; //
755 padding-top: 3px; //
756 padding-bottom: 3px; //
757 }
758
759 &.text-button {
760 // compensate text-button paddings
761 padding-left: 10px;
762 padding-right: 10px;
763 }
764
765 &.image-button {
766 // we want image buttons to have a 1:1 aspect ratio, so compensation
767 // of the padding added to the GtkImage is needed
768 padding-left: 2px;
769 padding-right: 2px;
770 }
771
772 &.needs-attention {
773 > label,
774 > image { @extend %needs_attention; }
775
776 &:active,
777 &:checked {
778 > label,
779 > image {
780 animation: none;
781 background-image: none;
782 }
783 }
784 }
785 }
786
787 //inline-toolbar buttons
788 .inline-toolbar &, .inline-toolbar &:backdrop {
789 border-radius: 2px;
790 border-width: 1px;
791 @extend %linked;
792 button {
793 padding-left: 4px;
794 padding-right: 4px;
795 }
796 }
797
798 .primary-toolbar & { -gtk-icon-shadow: none; } // tango icons don't need shadows
799
800 .linked:not(.vertical) > & { @extend %linked; }
801
802 .linked.vertical > & { @extend %linked_vertical; }
803
804 &.circular { // The Bloody Circul Button
805 border-radius: 9999px;
806 -gtk-outline-radius: 9999px;
807
808 label { padding: 0; }
809 }
810 }
811
812 %needs_attention {
813 // the dot is drawn by using two radial gradient, the first one is the actuall dot, the other
814 // simulates the shadow labels and icons normally have in buttons.
815 animation: needs_attention 150ms ease-in;
816 $_dot_shadow: _text_shadow_color(); // shadow color
817
818 background-image: radial-gradient(farthest-side, $_dot_color 96%, transparentize($_dot_color,1 )),
819 radial-gradient(farthest-side, $_dot_shadow 95%, transparentize($_dot_shadow, 1));
820 background-size: 6px 6px, 6px 6px;
821 background-repeat: no-repeat;
822
823 @if $variant == 'light' { background-position: right 3px, right 4px; }
824
825 @else { background-position: right 3px, right 2px; }
826
827 &:backdrop { background-size: 6px 6px, 0 0;}
828
829 &:dir(rtl) {
830 @if $variant == 'light' { background-position: left 3px, left 4px; }
831
832 @else { background-position: left 3px, left 2px; }
833 }
834 }
835
836
837 // all the following is for the +|- buttons on inline toolbars, that way
838 // should really be deprecated...
839 .inline-toolbar toolbutton > button { // redefining the button look is
840 // needed since those are flat...
841 @include button(normal);
842
843 &:hover { @include button(hover); }
844
845 &:active,
846 &:checked{ @include button(active); }
847
848 &:disabled {
849 @include button(insensitive);
850
851 &:active,
852 &:checked { @include button(insensitive-active); }
853 }
854
855 &:backdrop {
856 @include button(backdrop);
857
858 &:active,
859 &:checked { @include button(backdrop-active); }
860
861 &:disabled {
862 @include button(backdrop-insensitive);
863
864 &:active,
865 &:checked { @include button(backdrop-insensitive-active); }
866 }
867 }
868 }
869
870 // More inline toolbar buttons
871 toolbar.inline-toolbar toolbutton {
872 > button.flat { @extend %linked_middle; }
873
874 &:first-child > button.flat { @extend %linked_left; }
875
876 &:last-child > button.flat { @extend %linked_right; }
877
878 &:only-child > button.flat { @extend %linked_only_child; }
879 }
880
881 %linked_middle {
882 border-right-style: none;
883 border-radius: 0;
884 -gtk-outline-radius: 0;
885 }
886
887 %linked_left {
888 border-top-left-radius: $button_radius;
889 border-bottom-left-radius: $button_radius;
890 -gtk-outline-top-left-radius: $button_radius;
891 -gtk-outline-bottom-left-radius: $button_radius;
892 }
893
894 %linked_right {
895 border-right-style: solid;
896 border-top-right-radius: $button_radius;
897 border-bottom-right-radius: $button_radius;
898 -gtk-outline-top-right-radius: $button_radius;
899 -gtk-outline-bottom-right-radius: $button_radius;
900 }
901
902 %linked_only_child {
903 border-style: solid;
904 border-radius: $button_radius;
905 -gtk-outline-radius: $button_radius;
906 }
907
908 // .linked assumes Box, which reverses nodes in RTL, so 1st child is always left
909 %linked {
910 @extend %linked_middle;
911
912 &:first-child { @extend %linked_left; }
913 &:last-child { @extend %linked_right; }
914
915 &:only-child { @extend %linked_only_child; }
916 }
917
918 // Other widgets use widget child order, so 1st/last child are at text start/end
919 %linked_flippable {
920 @extend %linked_middle;
921
922 &:dir(ltr) {
923 &:first-child { @extend %linked_left; }
924 &:last-child { @extend %linked_right; }
925 }
926
927 &:dir(rtl) {
928 &:first-child { @extend %linked_right; }
929 &:last-child { @extend %linked_left; }
930 }
931
932 &:only-child { @extend %linked_only_child; }
933 }
934
935 %linked_vertical_middle {
936 border-style: solid solid none solid;
937 border-radius: 0;
938 -gtk-outline-radius: 0;
939 }
940
941 %linked_vertical_top {
942 border-top-left-radius: $button_radius;
943 border-top-right-radius: $button_radius;
944 -gtk-outline-top-left-radius: $button_radius;
945 -gtk-outline-top-right-radius: $button_radius;
946 }
947
948 %linked_vertical_bottom {
949 border-bottom-style: solid;
950 border-bottom-left-radius: $button_radius;
951 border-bottom-right-radius: $button_radius;
952 -gtk-outline-bottom-left-radius: $button_radius;
953 -gtk-outline-bottom-right-radius: $button_radius;
954 }
955
956 %linked_vertical_only_child {
957 border-style: solid;
958 border-radius: $button_radius;
959 -gtk-outline-radius: $button_radius;
960 }
961
962 %linked_vertical {
963 @extend %linked_vertical_middle;
964
965 &:first-child { @extend %linked_vertical_top; }
966
967 &:last-child { @extend %linked_vertical_bottom; }
968
969 &:only-child { @extend %linked_vertical_only_child; }
970 }
971
972 %undecorated_button {
973 background-color: transparent;
974 background-image: none;
975 border-color: transparent;
976 box-shadow: inset 0 1px transparentize(white, 1),
977 0 1px transparentize(white, 1);
978 text-shadow: none;
979 -gtk-icon-shadow: none;
980 }
981
982 /* menu buttons */
983 modelbutton.flat,
984 .menuitem.button.flat {
985 min-height: 26px;
986 padding-left: 5px;
987 padding-right: 5px;
988 border-radius: 3px;
989 outline-offset: -2px;
990
991 @extend %undecorated_button;
992
993 &:hover { background-color: $popover_hover_color; }
994
995 &:disabled {
996 color: $insensitive_fg_color;
997
998 &:backdrop { color: $backdrop_insensitive_color; }
999 }
1000
1001 &:selected { @extend %selected_items; }
1002
1003 &:backdrop,
1004 &:backdrop:hover { @extend %undecorated_button; }
1005 }
1006
1007 modelbutton.flat arrow {
1008 background: none;
1009
1010 &:hover { background: none; }
1011
1012 &.left { -gtk-icon-source: -gtk-icontheme("pan-start-symbolic"); }
1013
1014 &.right { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
1015 }
1016
1017 button.color {
1018 padding: 4px;
1019
1020 colorswatch:only-child {
1021 &, overlay { border-radius: 0; }
1022
1023 @if $variant == 'light' {
1024 box-shadow: 0 1px _text_shadow_color();
1025
1026 &:disabled,
1027 &:backdrop,
1028 &:active,
1029 &:checked { colorswatch:only-child { box-shadow: none; }}
1030 }
1031 }
1032 }
1033
1034
1035 /*********
1036 * Links *
1037 *********/
1038 %link,
1039 *:link {
1040 color: $link_color;
1041
1042 &:visited {
1043 color: $link_visited_color;
1044
1045 *:selected & { color: mix($selected_fg_color, $selected_bg_color, 60%); }
1046 }
1047
1048 &:hover {
1049 color: lighten($link_color,10%);
1050
1051 *:selected & { color: mix($selected_fg_color, $selected_bg_color, 90%); }
1052 }
1053
1054 &:active {
1055 color: $link_color;
1056
1057 *:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
1058 }
1059
1060 &:disabled, &:disabled:backdrop { color: transparentize(desaturate($link_color,100%), 0.2); }
1061
1062 &:backdrop { &:backdrop:hover, &:backdrop:hover:selected, & { color: $selected_bg_color; }}
1063
1064 @at-root %link_selected,
1065 &:selected,
1066 *:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); }
1067 }
1068
1069 button:link,
1070 button:visited {
1071 @extend %undecorated_button;
1072
1073 @extend %link;
1074
1075 text-shadow: none;
1076
1077 &:hover,
1078 &:active,
1079 &:checked {
1080 @extend %undecorated_button;
1081
1082 text-shadow: none;
1083 }
1084
1085 > label {
1086 @extend %link;
1087
1088 text-decoration-line: underline;
1089 }
1090 }
1091
1092
1093 /*****************
1094 * GtkSpinButton *
1095 *****************/
1096 spinbutton {
1097 &:not(.vertical) {
1098 // in this horizontal configuration, the whole spinbutton
1099 // behaves as the entry, so we extend the entry styling
1100 // and nuke the style on the internal entry
1101 @extend %entry;
1102
1103 padding: 0;
1104
1105 entry {
1106 min-width: 28px;
1107 // reset all the other props since the spinbutton node is styled here
1108 margin: 0;
1109 background: none;
1110 background-color: transparent;
1111 border: none;
1112 border-radius: 0;
1113 box-shadow: none;
1114 }
1115
1116 button {
1117 min-height: 16px;
1118 margin: 0;
1119 padding-bottom: 0;
1120 padding-top: 0;
1121 color: mix($fg_color, $base_color, 90%);
1122 background-image: none;
1123 border-style: none none none solid;
1124 border-color: transparentize($borders_color, 0.7);
1125 border-radius: 0;
1126 box-shadow: none;
1127
1128 &:dir(rtl) { border-style: none solid none none; }
1129
1130 &:hover {
1131 color: $fg_color;
1132 background-color: $base_hover_color;
1133 }
1134
1135 &:disabled {
1136 color: transparentize($insensitive_fg_color, 0.7);
1137 background-color: transparent;
1138 }
1139
1140 &:active {
1141 background-color: transparentize(black, 0.9);
1142 box-shadow: inset 0 2px 3px -1px transparentize(black, 0.8);
1143 }
1144
1145 &:backdrop {
1146 color: mix($backdrop_fg_color, $backdrop_base_color, 90%);
1147 background-color: transparent;
1148 border-color: transparentize($backdrop_borders_color, 0.7);
1149 transition: $backdrop_transition;
1150 }
1151
1152 &:backdrop:disabled {
1153 color: transparentize($backdrop_insensitive_color,0.7);
1154 background-color: transparent;
1155 border-style: none none none solid; // It is needed or it gets overridden
1156
1157 &:dir(rtl) { border-style: none solid none none; }
1158 }
1159 }
1160 }
1161
1162 // OSD horizontal
1163 .osd &:not(.vertical) {
1164 button {
1165 @include button(undecorated);
1166
1167 color: $osd_fg_color;
1168 border-style: none none none solid;
1169 border-color: transparentize($osd_borders_color, 0.3);
1170 border-radius: 0;
1171 box-shadow: none;
1172 -gtk-icon-shadow: 0 1px black;
1173
1174 &:dir(rtl) { border-style: none solid none none; }
1175
1176 &:hover {
1177 @include button(undecorated);
1178
1179 color: $osd_fg_color;
1180 border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
1181 background-color: transparentize($osd_fg_color, 0.9);
1182 -gtk-icon-shadow: 0 1px black;
1183 box-shadow: none;
1184 }
1185
1186 &:backdrop {
1187 @include button(undecorated);
1188
1189 color: $osd_fg_color;
1190 border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
1191 -gtk-icon-shadow: none;
1192 box-shadow: none;
1193 }
1194
1195 &:disabled {
1196 @include button(undecorated);
1197
1198 color: $osd_insensitive_fg_color;
1199 border-color: transparentize(opacify($osd_borders_color, 1), 0.5);
1200 -gtk-icon-shadow: none;
1201 box-shadow: none;
1202 }
1203
1204 &:dir(ltr):last-child { border-radius: 0 3px 3px 0; }
1205
1206 &:dir(rtl):first-child { border-radius: 3px 0 0 3px; }
1207 }
1208 }
1209
1210 // Vertical
1211 &.vertical {
1212 // in the vertical configuration, we treat the spinbutton
1213 // as a box, and tweak the style of the entry in the middle
1214 // so that it's linked
1215
1216 // FIXME: this should not be set at all, but otherwise it gets the wrong
1217 // color
1218 &:disabled { color: $insensitive_fg_color; }
1219
1220 &:backdrop:disabled { color: $backdrop_insensitive_color; }
1221
1222 &:drop(active) {
1223 border-color: transparent;
1224 box-shadow: none;
1225 }
1226
1227 entry {
1228 min-height: 32px;
1229 min-width: 32px;
1230 padding: 0;
1231 border-radius: 0;
1232 }
1233
1234 button {
1235 min-height: 32px;
1236 min-width: 32px;
1237 padding: 0;
1238
1239 &.up { @extend %top_button; }
1240
1241 &.down { @extend %bottom_button; }
1242 }
1243
1244 %top_button {
1245 border-radius: 3px 3px 0 0;
1246 border-style: solid solid none solid;
1247 }
1248
1249 %bottom_button {
1250 border-radius: 0 0 3px 3px;
1251 border-style: none solid solid solid;
1252 }
1253 }
1254
1255 // OSD vertical
1256 .osd &.vertical button:first-child {
1257 @include button(osd);
1258
1259 &:hover { @include button(osd-hover);}
1260
1261 &:active { @include button(osd-active); }
1262
1263 &:disabled { @include button(osd-insensitive); }
1264
1265 &:backdrop { @include button(osd-backdrop); }
1266 }
1267
1268 // Misc
1269 treeview &:not(.vertical) {
1270 min-height: 0;
1271 border-style: none;
1272 border-radius: 0;
1273
1274 entry {
1275 min-height: 0;
1276 padding: 1px 2px;
1277 }
1278 }
1279 }
1280
1281
1282 /**************
1283 * ComboBoxes *
1284 **************/
1285 combobox {
1286 arrow {
1287 -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
1288 min-height: 16px;
1289 min-width: 16px;
1290 }
1291
1292 &.linked {
1293 button:nth-child(2) {
1294 &:dir(ltr) { @extend %linked:last-child; }
1295 &:dir(rtl) { @extend %linked:first-child; }
1296 }
1297 }
1298
1299 &:drop(active) { // FIXME: untested
1300 box-shadow: none;
1301
1302 button.combo { @extend %button_basic:drop(active); }
1303 }
1304 }
1305
1306 .linked > combobox > box > button.combo {
1307 // the combo is a composite widget so the way we do button linking doesn't
1308 // work, special case needed. See
1309 // https://bugzilla.gnome.org/show_bug.cgi?id=733979
1310
1311 &:dir(ltr),
1312 &:dir(rtl) { @extend %linked_middle; } // specificity bump
1313 }
1314
1315 .linked:not(.vertical) > combobox:first-child > box > button.combo { @extend %linked:first-child; }
1316 .linked:not(.vertical) > combobox:last-child > box > button.combo { @extend %linked:last-child; }
1317 .linked:not(.vertical) > combobox:only-child > box > button.combo { @extend %linked:only-child; }
1318
1319 .linked.vertical > combobox > box > button.combo { @extend %linked_vertical_middle; }
1320 .linked.vertical > combobox:first-child > box > button.combo { @extend %linked_vertical:first-child;}
1321 .linked.vertical > combobox:last-child > box > button.combo { @extend %linked_vertical:last-child; }
1322 .linked.vertical > combobox:only-child > box > button.combo { @extend %linked_vertical:only-child; }
1323
1324
1325 /************
1326 * Toolbars *
1327 ************/
1328 %toolbar {
1329 -GtkWidget-window-dragging: true;
1330 padding: 4px;
1331 background-color: $bg_color;
1332 }
1333
1334 toolbar {
1335 @extend %toolbar;
1336 @include headerbar_fill;
1337
1338 box-shadow: none;
1339 border-bottom:1px solid $borders_color;
1340 padding: 4px 3px 3px 4px;
1341
1342 // on OSD
1343 .osd & { background-color: transparent; }
1344
1345 // stand-alone OSD toolbars
1346 &.osd {
1347 padding: 13px;
1348 border: none;
1349 border-radius: 5px;
1350 background-color: $osd_bg_color;
1351
1352 &.left,
1353 &.right,
1354 &.top,
1355 &.bottom { border-radius: 0; } // positional classes for `attached` osd toolbars
1356 }
1357
1358 // toolbar separators
1359 &.horizontal separator { margin: 0 7px 1px 6px; }
1360 &.vertical separator { margin: 6px 1px 7px 0; }
1361
1362 &:not(.inline-toolbar):not(.osd) {
1363 switch,
1364 scale,
1365 entry,
1366 spinbutton,
1367 button {
1368 margin-right: 1px;
1369 margin-bottom: 1px;
1370 }
1371 }
1372 }
1373
1374 //searchbar, location-bar & inline-toolbar
1375 .inline-toolbar {
1376 @extend %toolbar;
1377
1378 @extend %darkbar;
1379
1380 padding: 3px;
1381 border-width: 0 1px 1px;
1382 border-radius: 0 0 5px 5px;
1383 }
1384
1385 searchbar,
1386 .location-bar {
1387 @extend %toolbar;
1388
1389 @extend %darkbar;
1390
1391 border-width: 0 0 1px;
1392 padding: 3px;
1393 }
1394
1395 %darkbar {
1396 border-style: solid;
1397 border-color: $borders_color;
1398 $_bg: mix($bg_color, $borders_color, 70%);
1399 background-color: $_bg;
1400
1401 &:backdrop {
1402 border-color: $backdrop_borders_color;
1403 background-color: $backdrop_dark_fill;
1404 box-shadow: none;
1405 transition: $backdrop_transition;
1406 }
1407 }
1408
1409
1410 /***************
1411 * Header bars *
1412 ***************/
1413 %titlebar,
1414 headerbar {
1415 padding: 0 5px;
1416 min-height: 32px;
1417 border-width: 0 0 1px;
1418 border-style: solid;
1419 border-color: $borders_color;
1420 border-radius: 0;
1421
1422 @include headerbar_fill;
1423
1424 &:backdrop {
1425 border-color: $backdrop_borders_color;
1426 background-color: $bg_color;
1427 background-image: none;
1428 box-shadow: inset 0 1px $top_hilight;
1429
1430 transition: $backdrop_transition;
1431 }
1432
1433 .title {
1434 padding-left: 12px;
1435 padding-right: 12px;
1436 font-weight: bold;
1437 }
1438
1439 .subtitle {
1440 font-size: smaller;
1441 padding-left: 12px;
1442 padding-right: 12px;
1443
1444 @extend .dim-label;
1445 }
1446
1447 &.selection-mode {
1448 $_hc: mix($top_hilight,$selected_bg_color, 50%); // hilight color
1449
1450 color: $selected_fg_color;
1451 text-shadow: none;
1452 border-color: $selected_borders_color;
1453
1454 @include headerbar_fill($selected_bg_color, $_hc);
1455
1456 &:backdrop {
1457 background-color: $selected_bg_color;
1458 background-image: none;
1459 box-shadow: inset 0 1px mix($top_hilight, $selected_bg_color, 60%);
1460 }
1461
1462 .subtitle:link { @extend *:link:selected; }
1463
1464 button {
1465 @include button(normal, $selected_bg_color, $selected_fg_color);
1466
1467 &.flat { @include button(undecorated); }
1468
1469 &:hover { @include button(hover, $selected_bg_color, $selected_fg_color); }
1470
1471 &:active,
1472 &:checked { @include button(active, $selected_bg_color, $selected_fg_color); }
1473
1474 &:backdrop {
1475 &.flat, & {
1476 @include button(backdrop, $selected_bg_color, $selected_fg_color);
1477
1478 -gtk-icon-effect: none;
1479 border-color: $selected_borders_color;
1480
1481 &:active,
1482 &:checked {
1483 @include button(backdrop-active, $selected_bg_color, $selected_fg_color);
1484
1485 border-color: $selected_borders_color;
1486 }
1487
1488 &:disabled {
1489 @include button(backdrop-insensitive, $selected_bg_color, $selected_fg_color);
1490
1491 border-color: $selected_borders_color;
1492
1493 &:active, &:checked {
1494 @include button(backdrop-insensitive-active, $selected_bg_color, $selected_fg_color);
1495
1496 border-color: $selected_borders_color;
1497 }
1498 }
1499 }
1500 }
1501
1502 &.flat { &:backdrop, &:disabled, &:backdrop:disabled { @include button(undecorated); }}
1503
1504 &:disabled {
1505 @include button(insensitive, $selected_bg_color, $selected_fg_color);
1506
1507 &:active,
1508 &:checked { @include button(insensitive-active, $selected_bg_color, $selected_fg_color); }
1509 }
1510
1511 &.suggested-action {
1512 @include button(normal);
1513 color: $selected_fg_color;
1514
1515 border-color: $selected_borders_color;
1516
1517 &:hover {
1518 @include button(hover);
1519
1520 border-color: $selected_borders_color;
1521 }
1522
1523 &:active {
1524 @include button(active);
1525
1526 border-color: $selected_borders_color;
1527 }
1528
1529 &:disabled {
1530 @include button(insensitive);
1531 background-image: none;
1532 background: $bg_color;
1533
1534 border-color: $selected_borders_color;
1535 }
1536
1537 &:backdrop {
1538 @include button(backdrop);
1539
1540 border-color: $selected_borders_color;
1541 }
1542
1543 &:backdrop:disabled {
1544 @include button(backdrop-insensitive);
1545
1546 border-color: $selected_borders_color;
1547 }
1548 }
1549 }
1550
1551 .selection-menu {
1552 &:backdrop, & {
1553 border-color: transparentize($selected_bg_color, 1);
1554 background-color: transparentize($selected_bg_color, 1);
1555 background-image: none;
1556 box-shadow: none;
1557 padding-left: 10px;
1558 padding-right: 10px;
1559
1560 .arrow {
1561 -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
1562 color: transparentize($selected_fg_color,0.5);
1563 -gtk-icon-shadow: none;
1564 }
1565 }
1566 }
1567 }
1568
1569 // squared corners when the window is maximized, tiled, or fullscreen
1570 .tiled &,
1571 .tiled-top &,
1572 .tiled-right &,
1573 .tiled-bottom &,
1574 .tiled-left &,
1575 .maximized &,
1576 .fullscreen & {
1577 &:backdrop, & {
1578 border-radius: 0;
1579 }
1580 }
1581
1582 &.default-decoration {
1583 min-height: 24px;
1584 padding: 4px;
1585
1586 button.titlebutton,
1587 menubutton.titlebutton {
1588 min-height: 22px;
1589 min-width: 22px;
1590 margin: 0;
1591 padding: 0;
1592 }
1593
1594 menubutton.titlebutton button {
1595 min-height: 20px;
1596 min-width: 20px;
1597 margin: 0;
1598 padding: 4px;
1599 }
1600 }
1601
1602 .solid-csd & {
1603 &:backdrop, & {
1604 &:dir(rtl), &:dir(ltr) { // specificity bump
1605 margin-left: -1px;
1606 margin-right: -1px;
1607 margin-top: -1px;
1608 border-radius: 0;
1609 box-shadow: none;
1610 }
1611 }
1612 }
1613 }
1614
1615 headerbar {
1616 // add vertical margins to common widget on the headerbar to avoid them spanning the whole height
1617 entry,
1618 separator {
1619 margin-top: 3px;
1620 margin-bottom: 3px;
1621 }
1622 spinbutton,
1623 button {
1624 margin-top: 2px;
1625 margin-bottom: 2px;
1626 padding-top: 0;
1627 padding-bottom: 0;
1628 }
1629 button label {
1630 min-width: 28px;
1631 min-height: 22px;
1632 }
1633 button.titlebutton image {
1634 min-width: 22px;
1635 min-height: 22px;
1636 }
1637 button:not(.image-button):not(.titlebutton) image {
1638 min-width: 22px;
1639 min-height: 22px;
1640 }
1641 button.image-button {
1642 min-width: 22px;
1643 min-height: 22px;
1644 padding-left: 2px;
1645 padding-right: 2px;
1646 }
1647 .stack-switcher button {
1648 min-width: 26px;
1649 min-height: 26px;
1650 &:not(.text-button) {
1651 min-height: 22px;
1652 min-width: 22px;
1653 padding-left: 0px;
1654 padding-right: 0px;
1655 }
1656 }
1657 buttonbox {
1658 padding: 0px;
1659 button {
1660 min-width: 26px;
1661 min-height: 26px;
1662 &:not(.text-button) {
1663 min-width: 22px;
1664 padding-left: 0px;
1665 padding-right: 0px;
1666 }
1667 }
1668 }
1669 switch {
1670 margin-top: 5px;
1671 margin-bottom: 5px;
1672 }
1673 }
1674
1675 .background:not(.tiled):not(.maximized):not(.solid-csd) .titlebar,
1676 .background:not(.tiled-top):not(.maximized):not(.solid-csd) .titlebar,
1677 .background:not(.tiled-left):not(.maximized):not(.solid-csd) .titlebar,
1678 .background:not(.tiled-right):not(.maximized):not(.solid-csd) .titlebar,
1679 .background:not(.tiled-bottom):not(.maximized):not(.solid-csd) .titlebar {
1680 &:backdrop, & {
1681 border-top-left-radius: 7px;
1682 border-top-right-radius: 7px;
1683 }
1684 }
1685
1686 headerbar { // headerbar border rounding
1687 window:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) separator:first-child + &, // tackles the paned container case
1688 window:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) &:first-child { &:backdrop, & { border-top-left-radius: 7px; }}
1689 window:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) &:last-child { &:backdrop, & { border-top-right-radius: 7px; }}
1690 window:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) stack & { // tackles the stacked headerbars case
1691 &:first-child, &:last-child {
1692 &:backdrop, & {
1693 border-top-left-radius: 7px;
1694 border-top-right-radius: 7px;
1695 }
1696 }
1697 }
1698
1699 window.tiled &,
1700 window.tiled-top &,
1701 window.tiled-right &,
1702 window.tiled-bottom &,
1703 window.tiled-left &,
1704 window.maximized &,
1705 window.fullscreen &,
1706 window.solid-csd & {
1707 &, &:backdrop {
1708 &,
1709 &:first-child,
1710 &:last-child,
1711 &:only-child {
1712 border-top-left-radius: 0;
1713 border-top-right-radius: 0;
1714 }
1715 }
1716 }
1717 }
1718
1719 .titlebar:not(headerbar) {
1720 window.csd > & {
1721 // in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases
1722 padding: 0;
1723 background-color: transparent;
1724 background-image: none;
1725 border-style: none;
1726 border-color: transparent;
1727 box-shadow: none;
1728 }
1729
1730 > separator { background-color: $borders_color; }
1731
1732 @extend %titlebar;
1733 }
1734
1735 // Development versions of apps to use a differently styled headerbar
1736
1737 window.devel {
1738 headerbar.titlebar:not(.selection-mode) {
1739 $c: darken($bg_color, 10%);
1740 $gradient: cross-fade(10% -gtk-icontheme("system-run-symbolic"), image(transparent)) 90% 0/256px 256px no-repeat,
1741 linear-gradient(to right, transparent 65%, transparentize($selected_bg_color, 0.8)),
1742 linear-gradient(to top, darken($c, 3%), $c 3px, lighten($c, 6%));
1743 @if $variant == 'dark' {
1744 $gradient: cross-fade(10% -gtk-icontheme("system-run-symbolic"), image(transparent)) 90% 0/256px 256px no-repeat,
1745 linear-gradient(to right, transparent 65%, transparentize($selected_bg_color, 0.9)),
1746 linear-gradient(to top, lighten($c, 3%) 3px, lighten($c, 5%));
1747 }
1748
1749 background: $bg_color $gradient;
1750
1751 &:backdrop {
1752 background: $bg_color cross-fade(10% -gtk-icontheme("system-run-symbolic"), image(transparent)) 90% 0/256px 256px no-repeat,
1753 image($bg_color); /* background-color would flash */
1754 }
1755 }
1756 }
1757
1758 // Fixes: https://github.com/shimmerproject/Greybird/issues/157
1759 // workaround for ugly Ubuntu-related CSD patches
1760 .background:not(.csd):not(.ssd):not(.solid-csd) headerbar {
1761 &, &:backdrop {
1762 &, &:not(:last-child) {
1763 border-radius: 0;
1764 border-top-color: transparent;
1765 box-shadow: none;
1766 }
1767 }
1768 }
1769
1770 /************
1771 * Pathbars *
1772 ************/
1773 .path-bar button {
1774 &.text-button, &.image-button, & {
1775 padding-left: 4px;
1776 padding-right: 4px;
1777 }
1778
1779 &.text-button.image-button label {
1780 padding-left: 0;
1781 padding-right: 0;
1782 }
1783
1784 &.text-button.image-button, & {
1785 label:last-child { padding-right: 8px; }
1786 label:first-child { padding-left: 8px; }
1787 }
1788
1789 image {
1790 padding-left: 4px;
1791 padding-right: 4px;
1792 }
1793
1794 &.slider-button {
1795 padding-left: 0;
1796 padding-right: 0;
1797 }
1798 }
1799
1800 /**************
1801 * Tree Views *
1802 **************/
1803 treeview.view {
1804 @at-root * {
1805 -GtkTreeView-horizontal-separator: 4;
1806 -GtkTreeView-grid-line-width: 1;
1807 -GtkTreeView-grid-line-pattern: '';
1808 -GtkTreeView-tree-line-width: 1;
1809 -GtkTreeView-tree-line-pattern: '';
1810 -GtkTreeView-expander-size: 16;
1811 }
1812
1813 border-left-color: mix($fg_color, $base_color, 50%); // this is actually the tree lines color,
1814 border-top-color: $bg_color; // while this is the grid lines color, better then nothing
1815
1816 rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props
1817
1818 &:selected {
1819 &:focus, & {
1820 border-radius: 0;
1821 }
1822
1823 &:backdrop, & {
1824 border-left-color: mix($selected_fg_color, $selected_bg_color, 50%);
1825 border-top-color: transparentize($fg_color, 0.9); // doesn't work unfortunatelly
1826 }
1827 }
1828
1829 &:disabled {
1830 color: $insensitive_fg_color;
1831
1832 &:selected {
1833 color: mix($selected_fg_color, $selected_bg_color, 40%);
1834 &:backdrop { color: mix($backdrop_selected_fg_color, $selected_bg_color, 30%); }
1835 }
1836
1837 &:backdrop { color: $backdrop_insensitive_color; }
1838 }
1839
1840 &.separator {
1841 min-height: 2px;
1842 color: $bg_color;
1843
1844 &:backdrop { color: transparentize($bg_color, 0.9); }
1845 }
1846
1847 &:backdrop {
1848 border-left-color: mix($backdrop_fg_color, $backdrop_bg_color, 50%);
1849 border-top: $backdrop_bg_color;
1850 }
1851 &:drop(active) {
1852 border-style: solid none;
1853 border-width: 1px;
1854 border-color: $selected_borders_color;
1855
1856 &.after { border-top-style: none; }
1857
1858 &.before { border-bottom-style: none; }
1859 }
1860
1861 &.expander {
1862 // GtkTreeView uses the larger of the expander’s min-width and min-height
1863 min-width: 16px;
1864 min-height: 16px;
1865 -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
1866
1867 &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
1868
1869 color: mix($fg_color, $base_color, 70%);
1870
1871 &:hover { color: $fg_color; }
1872
1873 &:selected {
1874 color: mix($selected_fg_color, $selected_bg_color, 70%);
1875
1876 &:hover { color: $selected_fg_color; }
1877
1878 &:backdrop { color: mix($backdrop_selected_fg_color, $selected_bg_color, 70%); }
1879 }
1880
1881 &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
1882
1883 &:backdrop { color: mix($backdrop_fg_color, $backdrop_base_color, 70%); }
1884 }
1885
1886 &.progressbar { // progress bar in treeviews
1887 @if $variant == light { color: $base_color; }
1888
1889 border: 1px solid $selected_borders_color;
1890 border-radius: 4px;
1891 background-color: $selected_bg_color;
1892 background-image: linear-gradient(to bottom,
1893 $selected_bg_color,
1894 darken($selected_bg_color, 10%));
1895 box-shadow: inset 0 1px if($variant=='light', transparentize(white, 0.7),
1896 transparentize(white, 0.85)),
1897 0 1px if($variant=='light', transparentize(black, 0.8),
1898 transparentize(black, 0.9));
1899
1900 &:selected {
1901 &:focus, & {
1902 border-radius: 4px;
1903
1904 @if $variant == 'light' {
1905 color: $selected_bg_color;
1906 box-shadow: none;
1907 }
1908
1909 @else { box-shadow: inset 0 1px transparentize(white, 0.95); }
1910
1911 background-image: linear-gradient(to bottom,
1912 $base_color,
1913 darken($base_color, 10%));
1914
1915 &:backdrop {
1916 @if $variant == 'light' {
1917 color: $selected_bg_color;
1918 border-color: $selected_borders_color; // otherwise it gets inherited by .view(?!?)
1919 }
1920
1921 @else { border-color: $backdrop_base_color; }
1922
1923 background-color: $backdrop_base_color;
1924 }
1925 }
1926 }
1927
1928 &:backdrop {
1929 @if $variant == 'light' { color: $backdrop_base_color; }
1930
1931 @else { border-color: $backdrop_base_color; }
1932
1933 background-image: none;
1934 box-shadow: none;
1935 }
1936 }
1937
1938 &.trough { // progress bar trough in treeviews
1939 background-color: transparentize($fg_color,0.9);
1940 border-radius: 4px;
1941
1942 &:selected {
1943 &:focus, & {
1944 background-color: if($variant == 'light',
1945 transparentize($selected_fg_color, 0.7),
1946 darken($selected_bg_color, 10%));
1947 border-radius: 4px;
1948
1949 @if $variant == 'light' {
1950 border-width: 1px 0;
1951 border-style: solid;
1952 border-color: $selected_bg_color;
1953 }
1954 }
1955 }
1956 }
1957
1958 header {
1959 button {
1960 $_column_header_color: mix($fg_color, $base_color, 50%);
1961
1962 @extend %column_header_button;
1963
1964 color: $_column_header_color;
1965 background-color: $base_color;
1966 font-weight: bold;
1967 text-shadow: none;
1968 box-shadow: none;
1969
1970 &:hover {
1971 @extend %column_header_button;
1972
1973 color: mix($_column_header_color, $fg_color, 50%);
1974 box-shadow: none;
1975 transition: none; //I shouldn't need this
1976 }
1977
1978 &:active {
1979 @extend %column_header_button;
1980
1981 color: $fg_color;
1982 transition: none; //I shouldn't need this
1983 }
1984 }
1985
1986 button:last-child { &:backdrop, & { border-right-style: none; }}
1987 }
1988
1989 button.dnd,
1990 header.button.dnd { // for treeview-like derive widgets
1991 &:active, &:selected, &:hover, & {
1992 padding: 0 6px;
1993 color: $base_color;
1994 background-image: none;
1995 background-color: $selected_bg_color;
1996 border-style: none;
1997 border-radius: 0;
1998 box-shadow: inset 0 0 0 1px $base_color;
1999 text-shadow: none;
2000 transition: none;
2001 }
2002 }
2003
2004 acceleditor > label { background-color: $selected_bg_color; } // see tests/testaccel to test
2005 }
2006
2007 %column_header_button {
2008 padding: 0 6px;
2009 background-image: none;
2010 border-style: none solid solid none;
2011 border-color: $bg_color;
2012 border-radius: 0;
2013 text-shadow: none;
2014
2015 &:disabled {
2016 border-color: $bg_color;
2017 background-image: none;
2018 }
2019
2020 &:backdrop {
2021 color: mix($backdrop_fg_color, $backdrop_bg_color, 50%);
2022 border-color: $backdrop_bg_color;
2023 border-style: none solid solid none;
2024 background-image: none;
2025 background-color: $backdrop_base_color;
2026
2027 &:disabled {
2028 border-color: $backdrop_bg_color;
2029 background-image: none;
2030 }
2031 }
2032
2033 &:last-child { &:backdrop, & { border-right-style: none; }}
2034 }
2035
2036
2037 /*********
2038 * Menus *
2039 *********/
2040 menubar,
2041 .menubar {
2042 -GtkWidget-window-dragging: true;
2043 padding: 0px;
2044
2045 &:backdrop { background-color: $backdrop_bg_color; }
2046
2047 > menuitem {
2048 min-height: 16px;
2049 padding: 3px 8px;
2050 border: 1px solid transparent;
2051
2052 &:hover { //Seems like it :hover even with keyboard focus
2053 background-image: linear-gradient(to bottom,
2054 shade($selected_bg_color, 1.2),
2055 shade($selected_bg_color, 1.0)
2056 );
2057 color: $selected_fg_color;
2058 border-color: shade($selected_bg_color, 1.1);
2059 }
2060
2061 &:disabled {
2062 color: $insensitive_fg_color;
2063 box-shadow: none;
2064 }
2065 }
2066 }
2067
2068 menu,
2069 .menu,
2070 .context-menu {
2071 margin: 4px;
2072 padding: 2px 0px;
2073 background-color: $menu_color;
2074 border: 1px solid $borders_color; // adds borders in a non composited env
2075
2076 .csd & { border: none; } // axes borders in a composited env
2077
2078 &:backdrop { background-color: $backdrop_menu_color; }
2079
2080 menuitem {
2081 min-height: 16px;
2082 min-width: 40px;
2083 padding: 4px 6px;
2084 text-shadow: none;
2085
2086 &:hover {
2087 color: $selected_fg_color;
2088 background-image: linear-gradient(to bottom, shade($selected_bg_color, 1.2), shade($selected_bg_color, 1.0));
2089 box-shadow: inset 1px 1px shade($selected_bg_color, 0.8),
2090 inset -1px -1px shade($selected_bg_color, 0.8);
2091 }
2092
2093 &:disabled {
2094 color: $insensitive_fg_color;
2095 &:backdrop { color: $backdrop_insensitive_color; }
2096 }
2097
2098 &:backdrop,
2099 &:backdrop:hover {
2100 color: $backdrop_fg_color;
2101 background-color: transparent;
2102 }
2103
2104 // submenu indicators
2105 arrow {
2106 min-height: 16px;
2107 min-width: 16px;
2108
2109 &:dir(ltr) {
2110 -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
2111 margin-left: 10px;
2112 }
2113
2114 &:dir(rtl) {
2115 -gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl');
2116 margin-right: 10px;
2117 }
2118 }
2119
2120 // avoids labels color being overridden, see
2121 // https://bugzilla.gnome.org/show_bug.cgi?id=767058
2122 label { &:dir(rtl), &:dir(ltr) { color: inherit; }}
2123 }
2124
2125 // overflow arrows
2126 > arrow {
2127 @include button(undecorated);
2128
2129 min-height: 16px;
2130 min-width: 16px;
2131 padding: 4px;
2132 background-color: $menu_color;
2133 border-radius: 0;
2134
2135 &.top {
2136 margin-top: -6px;
2137 border-bottom: 1px solid mix($fg_color, $base_color, 10%);
2138 -gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
2139 }
2140
2141 &.bottom {
2142 margin-bottom: -6px;
2143 border-top: 1px solid mix($fg_color, $base_color, 10%);
2144 -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
2145 }
2146
2147 &:hover { background-color: mix($fg_color, $base_color, 10%); }
2148
2149 &:backdrop { background-color: $backdrop_menu_color; }
2150
2151 &:disabled {
2152 color: transparent;
2153 background-color: transparent;
2154 border-color: transparent ;
2155 }
2156 }
2157 }
2158
2159 menuitem {
2160 accelerator { color: gtkalpha(currentColor,0.55); }
2161
2162 check,
2163 radio {
2164 min-height: 16px;
2165 min-width: 16px;
2166
2167 &:dir(ltr) { margin-right: 7px; }
2168 &:dir(rtl) { margin-left: 7px; }
2169 }
2170 }
2171
2172 /***************
2173 * Popovers *
2174 ***************/
2175
2176 popover.background {
2177 padding: 2px;
2178 border-radius: 5px;
2179 background-color: $popover_bg_color;
2180
2181 modelbutton:hover { color: $selected_fg_color; }
2182
2183 .csd &, & { border: 1px solid $borders_color; }
2184
2185 box-shadow: 0 1px 2px transparentize(black, 0.7);
2186
2187 &:backdrop {
2188 background-color: $backdrop_bg_color;
2189 box-shadow: none;
2190 }
2191
2192 > list,
2193 > .view,
2194 > toolbar {
2195 border-style: none;
2196 background-color: transparent;
2197 }
2198
2199 .csd &, & {
2200 &.touch-selection,
2201 &.magnifier {
2202 @extend %osd;
2203
2204 border: 1px solid transparentize(white, 0.9);
2205
2206 button { @extend %osd_button };
2207 }
2208
2209 &.osd { @extend %osd; }
2210 }
2211
2212 separator { margin: 3px; }
2213
2214 list separator { margin: 0px; }
2215
2216 checkbutton,
2217 radiobutton { @extend modelbutton.flat; }
2218 }
2219
2220 /*************
2221 * Notebooks *
2222 *************/
2223 notebook {
2224 &.frame {
2225 border-style: none;
2226
2227 > header { margin-left: 0; }
2228
2229 > stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks
2230 border: 1px solid shade($bg_color, 0.9);
2231 }
2232 }
2233
2234 > header {
2235 padding: 1px;
2236 background-color: $bg_color;
2237
2238 &:backdrop {
2239 border-color: $backdrop_borders_color;
2240 background-color: $backdrop_bg_color;
2241 }
2242
2243 tabs { margin: -1px; }
2244
2245 &.top {
2246 > stack { border-top-style: none; }
2247 > tabs > tab {
2248 border-radius: 3px 3px 0 0;
2249 border: 1px solid shade($bg_color, 0.9);
2250
2251 &:backdrop { box-shadow: none; }
2252
2253 &:checked { border-width: 1px 1px 0 1px; }
2254 }
2255 }
2256
2257 &.bottom {
2258 > stack { border-bottom-style: none; }
2259 > tabs > tab {
2260 border-radius: 0 0 3px 3px;
2261
2262 &:backdrop { box-shadow: none; }
2263
2264 &:checked { border-width: 0 1px 1px 1px; }
2265 }
2266 }
2267
2268 &.left {
2269 > stack { border-left-style: none; }
2270 > tabs > tab {
2271 border-radius: 3px 0 0 3px;
2272
2273 &:backdrop { box-shadow: none; }
2274
2275 &:checked { border-width: 1px 0 1px 1px; }
2276 }
2277 }
2278
2279 &.right {
2280 > stack { border-right-style: none; }
2281 > tabs > tab {
2282 border-radius: 0 3px 3px 0;
2283
2284 &:backdrop { box-shadow: none; }
2285
2286 &:checked { border-width: 1px 1px 1px 0; }
2287 }
2288 }
2289
2290 &.top > tabs > arrow {
2291 @extend %notebook_vert_arrows;
2292
2293 border-top-style: none;
2294 }
2295
2296 &.bottom > tabs > arrow {
2297 @extend %notebook_vert_arrows;
2298
2299 border-bottom-style: none;
2300 }
2301
2302 @at-root %notebook_vert_arrows {
2303 margin-left: -5px;
2304 margin-right: -5px;
2305 padding-left: 4px;
2306 padding-right: 4px;
2307
2308 &.down { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); }
2309
2310 &.up { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); }
2311 }
2312
2313 &.left > tabs > arrow {
2314 @extend %notebook_horz_arrows;
2315
2316 border-left-style: none;
2317 }
2318
2319 &.right > tabs > arrow {
2320 @extend %notebook_horz_arrows;
2321
2322 border-right-style: none;
2323 }
2324
2325 @at-root %notebook_horz_arrows {
2326 margin-top: -5px;
2327 margin-bottom: -5px;
2328 padding-top: 4px;
2329 padding-bottom: 4px;
2330
2331 &.down { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
2332
2333 &.up { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
2334 }
2335
2336 > tabs > arrow {
2337 @extend %button_basic;
2338
2339 @extend %button_basic.flat;
2340
2341 min-height: 16px;
2342 min-width: 16px;
2343 border-radius: 0;
2344
2345 &:hover:not(:active):not(:backdrop) {
2346 background-clip: padding-box;
2347 background-image: none;
2348 background-color: transparentize(white, 0.7);
2349 border-color: transparent;
2350 box-shadow: none;
2351 }
2352
2353 &:disabled { @include button(undecorated); }
2354 }
2355
2356 tab {
2357 min-height: 20px;
2358 min-width: 24px;
2359 padding: 3px 12px;
2360
2361 outline-offset: -5px;
2362
2363 color: $insensitive_fg_color;
2364 background-color: $bg_color;
2365
2366 border-width: 1px; // for reorderable tabs
2367 border-radius: 3px;
2368 border-color: shade($bg_color, 0.9); //
2369 border-style: solid;
2370
2371 &:hover {
2372 color: mix($insensitive_fg_color, $fg_color, 50%);
2373
2374 &.reorderable-page {
2375 border-color: transparentize($borders_color, 0.7);
2376 background-color: transparentize($bg_color, 0.8);
2377 }
2378 }
2379
2380 &:backdrop {
2381 color: mix($backdrop_fg_color, $backdrop_bg_color, 60%);
2382
2383 &.reorderable-page {
2384 border-color: transparent;
2385 background-color: transparent;
2386 }
2387 }
2388
2389 &:checked {
2390 color: $fg_color;
2391 background-color: shade($bg_color, 1.05);
2392 border-width: 1px 1px 0 1px;
2393 &:backdrop {
2394 background-color: $bg_color;
2395 }
2396 &.reorderable-page {
2397 border-color: transparentize($borders_color, 0.5);
2398 background-color: shade($bg_color, 1.05);
2399 }
2400 }
2401
2402 &:backdrop:checked {
2403 color: $backdrop_fg_color;
2404
2405 &.reorderable-page {
2406 border-color: $backdrop_borders_color;
2407 background-color: $backdrop_bg_color;
2408 }
2409 }
2410
2411 // colors the button like the label, overridden otherwise
2412 button.flat {
2413 &:hover { color: currentColor; }
2414
2415 &, &:backdrop { color: gtkalpha(currentColor, 0.3); }
2416
2417 padding: 0;
2418 margin-top: 1px;
2419 margin-bottom: 1px;
2420 // FIXME: generalize .small-button?
2421 min-width: 16px;
2422 min-height: 16px;
2423
2424 &:last-child {
2425 margin-left: 1px;
2426 margin-right: -1px;
2427 }
2428
2429 &:first-child {
2430 margin-left: -1px;
2431 margin-right: 1px;
2432 }
2433 }
2434 }
2435
2436 &.top,
2437 &.bottom {
2438 tabs {
2439 padding: 0;
2440
2441 &:not(:only-child) {
2442 margin-left: 2px;
2443 margin-right: 2px;
2444 }
2445 &:first-child { margin-left: -3px; }
2446 &:last-child { margin-right: -3px; }
2447
2448 tab {
2449 margin-left: 2px;
2450 margin-right: 2px;
2451 }
2452 }
2453 }
2454
2455 &.left,
2456 &.right {
2457 tabs {
2458 padding: 0;
2459
2460 &:not(:only-child) {
2461 margin-top: 2px;
2462 margin-bottom: 2px;
2463 }
2464 &:first-child { margin-top: -3px; }
2465 &:last-child { margin-bottom: -3px; }
2466
2467 tab {
2468 margin-top: 2px;
2469 margin-bottom: 2px;
2470 }
2471 }
2472 }
2473
2474 &.top tab { padding-bottom: 4px; }
2475 &.bottom tab { padding-top: 4px; }
2476
2477 &.top > tabs {
2478 margin-bottom: -2px;
2479 }
2480
2481 &.bottom > tabs {
2482 margin-top: -2px;
2483 }
2484
2485 &.left > tabs {
2486 margin-right: -2px;
2487 }
2488
2489 &.right > tabs {
2490 margin-left: -2px;
2491 }
2492 }
2493
2494 // if the notebook property show_border is set to false, the frame directly inside the notebook
2495 // doesn't exist, so we define the tab margins, the background and backdrop colors here:
2496
2497 > header {
2498 margin-left: 6px;
2499 }
2500
2501 > stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks
2502 background-color: shade($bg_color, 1.05);
2503 border-width: 1px;
2504 border-color: shade($bg_color, 0.9);
2505 border-style: solid;
2506 &:backdrop { background-color: $backdrop_bg_color; }
2507 }
2508 }
2509
2510
2511 /**************
2512 * Scrollbars *
2513 **************/
2514 scrollbar {
2515 $_slider_min_length: 40px;
2516
2517 // disable steppers
2518 @at-root * {
2519 -GtkScrollbar-has-backward-stepper: false;
2520 -GtkScrollbar-has-forward-stepper: false;
2521 }
2522
2523 &.vertical {
2524 background-image: linear-gradient(to right,
2525 lighten($bg_color, 10%),
2526 lighten($bg_color, 30%)
2527 );
2528
2529 slider {
2530 background-image: linear-gradient(to right,
2531 lighten($scrollbar_slider_color, 5%),
2532 lighten($scrollbar_slider_color, 1%));
2533
2534 &:hover {
2535 background-image: linear-gradient(to right,
2536 darken($scrollbar_slider_color, 5%),
2537 darken($scrollbar_slider_color, 1%));
2538 }
2539 }
2540 }
2541
2542 &.horizontal {
2543 background-image: linear-gradient(to bottom,
2544 lighten($bg_color, 10%),
2545 lighten($bg_color, 30%)
2546 );
2547
2548 slider {
2549 background-image: linear-gradient(to bottom,
2550 lighten($scrollbar_slider_color, 5%),
2551 lighten($scrollbar_slider_color, 1%));
2552
2553 &:hover {
2554 background-image: linear-gradient(to bottom,
2555 darken($scrollbar_slider_color, 5%),
2556 darken($scrollbar_slider_color, 1%));
2557 }
2558 }
2559 }
2560
2561 transition: 300ms $ease-out-quad;
2562
2563 // scrollbar border
2564 &.top { border-bottom: 1px solid lighten($bg_color, 5%); }
2565 &.bottom { border-top: 1px solid lighten($bg_color, 5%); }
2566 &.left { border-right: 1px solid lighten($bg_color, 5%); }
2567 &.right { border-left: 1px solid lighten($bg_color, 5%); }
2568
2569 &:backdrop {
2570 background-color: $backdrop_scrollbar_bg_color;
2571 border-color: lighten($bg_color, 5%);
2572 transition: $backdrop_transition;
2573 }
2574
2575 // slider
2576 slider {
2577 min-width: 7px;
2578 min-height: 7px;
2579 margin: 3px;
2580 border: 1px solid darken($bg_color, 30%);
2581 border-radius: 10px;
2582 background-clip: padding-box;
2583
2584
2585
2586 &:hover:active { background-color: $scrollbar_slider_active_color; }
2587
2588 &:backdrop { background-color: $backdrop_scrollbar_slider_color; }
2589
2590 &:disabled { background-color: transparent; }
2591 }
2592
2593 &.fine-tune {
2594 slider {
2595 min-width: 4px;
2596 min-height: 4px;
2597 }
2598
2599 &.horizontal slider { border-width: 5px 4px; }
2600 &.vertical slider { border-width: 4px 5px; }
2601 }
2602
2603 &.overlay-indicator {
2604 &:not(.dragging):not(.hovering) {
2605 border-color: transparent;
2606 opacity: 0.4;
2607 background-color: transparent;
2608
2609 slider {
2610 margin: 0;
2611 min-width: 6px;
2612 min-height: 6px;
2613 background-color: shade($fg_color, 0.9);
2614 background-image: none;
2615 border: 1px solid if($variant == 'light', white, black);
2616 }
2617
2618 button {
2619 min-width: 5px;
2620 min-height: 5px;
2621 background-color: shade($fg_color, 0.9);
2622 background-image: none;
2623 background-clip: padding-box;
2624 border-radius: 100%;
2625 border: 1px solid if($variant == 'light', white, black);
2626 -gtk-icon-source: none;
2627 }
2628
2629 &.horizontal {
2630 slider {
2631 margin: 0 2px;
2632 min-width: $_slider_min_length;
2633 }
2634
2635 button {
2636 margin: 1px 2px;
2637 min-width: 5px;
2638 }
2639 }
2640
2641 &.vertical {
2642 slider {
2643 margin: 2px 0;
2644 min-height: $_slider_min_length;
2645 }
2646
2647 button {
2648 margin: 2px 1px;
2649 min-height: 5px;
2650 }
2651 }
2652 }
2653
2654 &.dragging,
2655 &.hovering { opacity: 0.8; }
2656 }
2657
2658 &.horizontal slider { min-width: $_slider_min_length; }
2659
2660 &.vertical slider { min-height: $_slider_min_length; }
2661
2662 // button styling
2663 button {
2664 padding: 0;
2665 min-width: 12px;
2666 min-height: 12px;
2667 border-style: none;
2668 border-radius: 0;
2669 transition-property: min-height, min-width, color;
2670
2671 @include button(undecorated);
2672
2673 color: $scrollbar_slider_color;
2674
2675 &:hover {
2676 @include button(undecorated);
2677
2678 color: $scrollbar_slider_hover_color;
2679 }
2680 &:active, &:checked {
2681 @include button(undecorated);
2682
2683 color: $scrollbar_slider_active_color;
2684 }
2685 &:disabled {
2686 @include button(undecorated);
2687
2688 color: transparentize($scrollbar_slider_color, 0.8);
2689 }
2690 &:backdrop {
2691 @include button(undecorated);
2692
2693 color: $backdrop_scrollbar_slider_color;
2694
2695 &:disabled {
2696 @include button(undecorated);
2697
2698 color: transparentize($backdrop_scrollbar_slider_color, 0.8);
2699 }
2700 }
2701 }
2702
2703 // button icons
2704 &.vertical {
2705 button {
2706 &.down { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
2707
2708 &.up { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
2709 }
2710 }
2711
2712 &.horizontal {
2713 button {
2714 &.down { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); }
2715
2716 &.up { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); }
2717 }
2718 }
2719 }
2720
2721 treeview ~ scrollbar.vertical {
2722 border-top: 1px solid $borders_color;
2723 margin-top: -1px;
2724 }
2725
2726 /**********
2727 * Switch *
2728 **********/
2729 switch {
2730 font-size: 0;
2731 outline-offset: -4px;
2732 box-shadow: inset 0 1px transparentize(black, 0.9), // needs to be set here
2733 _widget_edge(transparent); // otherwise it gets
2734 // clipped
2735 // similar to the .scale
2736 border: 1px solid gtkalpha(black, 0.25);
2737 border-radius: 10px;
2738 background-color: mix($bg_color, $borders_color, 60%);
2739 text-shadow: 0 1px transparentize(black, 0.9);
2740 min-height: 20px;
2741 min-width: 20px;
2742 transition: all 200ms ease-in;
2743
2744 &:checked {
2745 box-shadow: inset 0 1px transparentize(black, 0.9),
2746 _widget_edge(transparent);
2747 border-color: shade($selected_borders_color, 1.1);
2748 background-image: linear-gradient(to bottom,
2749 shade($selected_bg_color, 1.1),
2750 $selected_bg_color
2751 );
2752 text-shadow: 0 1px transparentize($selected_borders_color, 0.5),
2753 0 0 2px transparentize(white, 0.4);
2754 }
2755
2756 &:disabled {
2757 border-color: $borders_color;
2758 background-color: $insensitive_bg_color;
2759 box-shadow: _widget_edge(transparent);
2760 text-shadow: none;
2761 }
2762
2763 &:backdrop {
2764 border-color: $backdrop_borders_color;
2765 background-color: $backdrop_dark_fill;
2766 box-shadow: none;
2767 text-shadow: none;
2768 transition: $backdrop_transition;
2769
2770 &:checked {
2771 @if $variant == 'light' { color: $backdrop_bg_color; }
2772 border-color: transparentize($selected_borders_color, 0.3);
2773 background-color: transparentize($selected_bg_color, 0.3);
2774 background-image: none;
2775 box-shadow: none;
2776 }
2777 }
2778
2779 &:disabled {
2780 border-color: $backdrop_borders_color;
2781 background-image: none;
2782 background-color: $insensitive_bg_color;
2783 }
2784
2785 slider {
2786 margin: -1px;
2787 border: 1px solid gtkalpha(black, 0.2);
2788 border-radius: 10px;
2789 min-width: 20px;
2790 min-height: 20px;
2791 transition: $button_transition;
2792
2793 @include button(normal-alt, $edge: $shadow_color);
2794 }
2795
2796 image { color: transparent; } /* only show i / o for the accessible theme */
2797
2798 &:hover slider { @include button(hover-alt, $edge: $shadow_color); }
2799
2800 &:checked slider { border: 1px solid gtkalpha($selected_borders_color, 0.8); }
2801
2802 &:disabled slider { @include button(insensitive); }
2803
2804 &:backdrop {
2805 slider {
2806 transition: $backdrop_transition;
2807
2808 @include button(backdrop);
2809 }
2810
2811 &:checked slider { border-color: transparentize($selected_borders_color, 0.3); }
2812
2813 &:disabled slider { @include button(backdrop-insensitive); }
2814 }
2815
2816 row:selected & {
2817 @if $variant == 'light' {
2818 box-shadow: none;
2819 border-color: $selected_borders_color;
2820
2821 &:backdrop { border-color: $selected_borders_color; }
2822
2823 &.slider:dir(rtl) { border-left-color: $borders_color; }
2824 &.slider:dir(ltr) { border-right-color: $borders_color; }
2825
2826 &.slider { &:checked, & { border-color: $selected_borders_color; } }
2827 }
2828 }
2829 }
2830
2831
2832 /*************************
2833 * Check and Radio items *
2834 *************************/
2835 // draw regular check and radio items using our PNG assets
2836 // all assets are rendered from assets.svg. never add pngs directly
2837
2838
2839 //selection-mode
2840 @each $s,$as in ('','-selectionmode'),
2841 (':hover', '-hover-selectionmode'),
2842 (':active', '-active-selectionmode'),
2843 (':backdrop', '-backdrop-selectionmode'),
2844 (':checked', '-checked-selectionmode'),
2845 (':checked:hover', '-checked-hover-selectionmode'),
2846 (':checked:active', '-checked-active-selectionmode'),
2847 (':backdrop:checked', '-checked-backdrop-selectionmode') {
2848 .view.content-view.check#{$s}:not(list) {
2849 -gtk-icon-shadow: none;
2850 -gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}.png"),
2851 url("assets/checkbox#{$as}@2.png"));
2852 background-color: transparent;
2853 }
2854 }
2855
2856 checkbutton.text-button, radiobutton.text-button {
2857 // this is for a nice focus on check and radios text
2858 padding: 2px 0;
2859 outline-offset: 0;
2860
2861 label:not(:only-child) {
2862 &:first-child { margin-left: 4px; }
2863 &:last-child { margin-right: 4px; }
2864 }
2865 }
2866
2867 check,
2868 radio {
2869 margin: 0 4px;
2870
2871 &:only-child { margin: 0; }
2872
2873 min-height: 14px;
2874 min-width: 14px;
2875 border: 1px solid;
2876 -gtk-icon-source: none;
2877
2878 @include button(normal-alt, $c:lighten($bg_color, 5%), $edge: $shadow_color);
2879
2880 &:hover { @include button(hover-alt, $edge: $shadow_color); }
2881 &:active { @include button(active); }
2882 &:disabled { @include button(insensitive); }
2883 &:backdrop {
2884 @include button(backdrop);
2885
2886 transition: $backdrop_transition;
2887
2888 &:disabled { @include button(backdrop-insensitive); }
2889 }
2890
2891 @if $variant == 'light' {
2892 // the borders of the light variant versions of checks and radios are too similar in luminosity to the selected background
2893 // color, hence we need special casing.
2894 row:selected & { border-color: $selected_borders_color; }
2895 }
2896
2897 .osd & {
2898 @include button(osd);
2899
2900 &:hover { @include button(osd); }
2901 &:active { @include button(osd-active); }
2902 &:backdrop { @include button(osd-backdrop); }
2903 &:disabled { @include button(osd-insensitive); }
2904 }
2905
2906 menu menuitem & {
2907 margin: 0; // this is a workaround for a menu check/radio size allocation issue
2908
2909 &, &:hover, &:disabled { //FIXME use button reset mixin
2910 min-height: 14px;
2911 min-width: 14px;
2912 background-image: none;
2913 background-color: transparent;
2914 box-shadow: none;
2915 -gtk-icon-shadow: none;
2916 color: inherit;
2917 border-color: currentColor;
2918 animation: none;
2919 }
2920 }
2921 }
2922
2923 %check,
2924 check {
2925 border-radius: 3px;
2926
2927 &:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/check-symbolic.svg")),
2928 -gtk-recolor(url("assets/check-symbolic.symbolic.png"))); }
2929
2930 &:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/dash-symbolic.svg")),
2931 -gtk-recolor(url("assets/dash-symbolic.symbolic.png"))); }
2932 }
2933
2934 %radio,
2935 radio {
2936 border-radius: 100%;
2937
2938 &:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/bullet-symbolic.svg")),
2939 -gtk-recolor(url("assets/bullet-symbolic.symbolic.png"))); }
2940
2941 &:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/dash-symbolic.svg")),
2942 -gtk-recolor(url("assets/dash-symbolic.symbolic.png"))); }
2943 }
2944
2945 // let's animate things
2946 @keyframes check_check {
2947 from { -gtk-icon-transform: translate(6px, -3px) rotate(-45deg) scaleY(0.2) rotate(45deg) scaleX(0); }
2948 to { -gtk-icon-transform: unset; }
2949 }
2950
2951 @keyframes check_radio {
2952 from { -gtk-icon-transform: scale(0); }
2953 to { -gtk-icon-transform: unset; }
2954 }
2955
2956 @keyframes check_indeterminate {
2957 from { -gtk-icon-transform: scale(0, 1); }
2958 to { -gtk-icon-transform: unset; }
2959 }
2960
2961 check:not(:indeterminate):checked { animation: check_check 400ms; }
2962
2963 radio:not(:indeterminate):checked { animation: check_radio 400ms; }
2964
2965 check:indeterminate:checked, radio:indeterminate:checked { animation: check_indeterminate 400ms; }
2966
2967 // no animations in menus
2968 menu menuitem {
2969 check:not(:indeterminate):checked,
2970 radio:not(:indeterminate):checked,
2971 check:indeterminate:checked:active,
2972 radio:indeterminate:checked { animation: none; }
2973 }
2974
2975 treeview.view check,
2976 treeview.view radio {
2977 &:selected {
2978 &:focus, & {
2979 color: $fg_color;
2980
2981 @if $variant == 'light' { border-color: $selected_borders_color; }
2982 }
2983
2984 &:disabled {
2985 color: $insensitive_fg_color;
2986
2987 &:backdrop { color: $backdrop_insensitive_color; }
2988 }
2989 }
2990
2991 &:backdrop { &:selected, & { color: $backdrop_fg_color; }}
2992 }
2993
2994 treeview.view radio:selected { &:focus, & { @extend %radio; }} // This is a workaround
2995
2996
2997 /************
2998 * GtkScale *
2999 ************/
3000 %scale_trough {
3001 border: 1px solid $borders_color;
3002 border-radius: 3px;
3003 background-color: $dark_fill;
3004 box-shadow: inset 1px 1px transparentize(black, 0.9);
3005
3006 &:disabled {
3007 background-color: $insensitive_bg_color;
3008 box-shadow: none;
3009 }
3010
3011 &:backdrop {
3012 background-color: $backdrop_dark_fill;
3013 border-color: $backdrop_borders_color;
3014 box-shadow: none;
3015 transition: $backdrop_transition;
3016
3017 &:disabled { background-color: $insensitive_bg_color; }
3018 }
3019
3020 // ...on selected list rows
3021 row:selected & {
3022 box-shadow: none;
3023
3024 &, &:disabled { border-color: $selected_borders_color; }
3025 }
3026
3027 // OSD
3028 .osd & {
3029 border-color: $osd_borders_color;
3030 background-color: transparentize($osd_borders_color, 0.2);
3031 box-shadow: none;
3032 outline-color: transparentize($osd_fg_color, 0.8);
3033
3034 &:disabled { background-color: $osd_insensitive_bg_color; }
3035 }
3036 }
3037
3038 %scale_highlight {
3039 border: 1px solid shade($selected_bg_color, 0.7);
3040 border-radius: 3px;
3041 background-image: linear-gradient(to bottom,
3042 shade($selected_bg_color, 1.1),
3043 shade($selected_bg_color, 0.9)
3044 );
3045
3046 &:disabled {
3047 background-color: transparent;
3048 border-color: transparent;
3049 }
3050
3051 &:backdrop {
3052 border-color: transparentize($selected_borders_color, 0.3);
3053 background-color: transparentize($selected_bg_color, 0.3);
3054 background-image: none;
3055 &:disabled {
3056 background-color: transparent;
3057 border-color: transparent;
3058 }
3059 }
3060
3061 // ...on selected list rows
3062 row:selected & { &:disabled, & { border-color: $selected_borders_color; } }
3063
3064 // OSD
3065 .osd & {
3066 border-color: $osd_borders_color;
3067
3068 &:disabled { border-color: transparent; }
3069 }
3070 }
3071
3072 scale {
3073 // sizing
3074 $_marks_length: 6px;
3075 $_marks_distance: 6px;
3076
3077 min-height: 10px;
3078 min-width: 10px;
3079 padding: 12px;
3080
3081 // those are inside the trough node, I need them to show their own border over the trough one, so negative margin
3082 fill,
3083 highlight { margin: -2px; }
3084
3085 // the slider is inside the trough, so to have make it bigger there's a negative margin
3086
3087 slider {
3088 min-height: 13px;
3089 min-width: 13px;
3090 margin: -7px;
3091 }
3092
3093 // click-and-hold the slider to activate
3094 &.fine-tune {
3095 &.horizontal {
3096 padding-top: 9px;
3097 padding-bottom: 9px;
3098 min-height: 16px;
3099 }
3100
3101 &.vertical {
3102 padding-left: 9px;
3103 padding-right: 9px;
3104 min-width: 16px;
3105 }
3106
3107 // to make the trough grow in fine-tune mode
3108 slider { margin: -6px; }
3109
3110 fill,
3111 highlight,
3112 trough {
3113 border-radius: 5px;
3114 -gtk-outline-radius: 7px;
3115 }
3116 }
3117
3118 // the backing bit
3119 trough {
3120 @extend %scale_trough;
3121
3122 padding: 1px;
3123 outline-offset: 2px;
3124 -gtk-outline-radius: 5px;
3125 }
3126
3127 // the colored part of the backing bit
3128 highlight { @extend %scale_highlight; }
3129
3130 // this is another differently styled part of the backing bit, the most relevant use case is for example
3131 // in media player to indicate how much video stream has been cached
3132 fill {
3133 @extend %scale_trough;
3134
3135 &, &:backdrop {
3136 background-color: $borders_color;
3137 box-shadow: none;
3138 }
3139
3140 &:disabled {
3141 &, &:backdrop {
3142 border-color: transparent;
3143 background-color: transparent;
3144 }
3145 }
3146
3147 // OSD
3148 .osd & {
3149 background-color: mix($osd_fg_color, $osd_borders_color, 25%);
3150
3151 &:disabled {
3152 &, &:backdrop {
3153 border-color: transparent;
3154 background-color: transparent;
3155 }
3156 }
3157 }
3158 }
3159
3160 slider {
3161 @include button(normal);
3162
3163 background-image: linear-gradient(to bottom,
3164 shade($bg_color, 1.45),
3165 shade($bg_color, 1.15)
3166 );
3167 border: 1px solid darken($borders_color, 3%);
3168 border-radius: 100%;
3169 transition: $button_transition;
3170 transition-property: background, border, box-shadow;
3171
3172 &:hover { @include button(hover-alt, $edge: $shadow_color); }
3173
3174 &:active { border-color: $selected_borders_color; }
3175
3176 &:disabled { @include button (insensitive); }
3177
3178 &:backdrop {
3179 transition: $backdrop_transition;
3180
3181 @include button(backdrop);
3182
3183 &:disabled { @include button(backdrop-insensitive); }
3184 }
3185
3186 // ...on selected list rows
3187 row:selected & { &, &:disabled { border-color: $selected_borders_color; } }
3188
3189 // OSD
3190 .osd & {
3191 @include button(osd);
3192 border-color: darken($osd_borders_color, 3%);
3193 background-color: opacify($osd_bg_color, 1); // solid background needed here
3194
3195 &:hover { @include button(osd-hover); }
3196
3197 &:active { @include button(osd-active); }
3198
3199 &:disabled { @include button(osd-insensitive); }
3200
3201 &:backdrop {
3202 @include button(osd-backdrop);
3203
3204 &:disabled { @include button(osd-backdrop-insensitive); }
3205 }
3206 }
3207 }
3208
3209 value { color: gtkalpha(currentColor, 0.6); }
3210
3211 marks {
3212 color: gtkalpha(currentColor, 0.4);
3213
3214 @each $marks_class, $marks_pos, $marks_margin in (top, top, bottom),
3215 (bottom, bottom, top),
3216 (top, left, right),
3217 (bottom, right, left) {
3218 &.#{$marks_class} {
3219 margin-#{$marks_margin}: $_marks_distance;
3220 margin-#{$marks_pos}: -($_marks_distance + $_marks_length);
3221 }
3222 }
3223 }
3224 &.fine-tune marks {
3225 @each $marks_class, $marks_pos, $marks_margin in (top, top, bottom),
3226 (bottom, bottom, top),
3227 (top, left, right),
3228 (bottom, right, left) {
3229 &.#{$marks_class} {
3230 margin-#{$marks_margin}: $_marks_distance;
3231 margin-#{$marks_pos}: -($_marks_distance + $_marks_length - 3px);
3232 }
3233 }
3234 }
3235
3236 &.horizontal {
3237 indicator {
3238 min-height: $_marks_length;
3239 min-width: 1px;
3240 }
3241
3242 &.fine-tune indicator { min-height: ($_marks_length - 3px); }
3243 }
3244
3245 &.vertical {
3246 indicator {
3247 min-height: 1px;
3248 min-width: $_marks_length;
3249 }
3250
3251 &.fine-tune indicator { min-width: ($_marks_length - 3px); }
3252 }
3253
3254 &.color {
3255 min-height: 0;
3256 min-width: 0;
3257
3258 trough {
3259 background-image: image($borders_color);
3260 background-repeat: no-repeat;
3261 }
3262
3263 &.horizontal {
3264 padding: 0 0 15px 0;
3265
3266 trough {
3267 padding-bottom: 4px;
3268 background-position: 0 -3px;
3269 border-top-left-radius: 0;
3270 border-top-right-radius: 0;
3271 }
3272
3273 slider {
3274 &:dir(ltr), &:dir(rtl) { // specificity bumb
3275 &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
3276 margin-bottom: -15px;
3277 margin-top: 6px;
3278 }
3279 }
3280 }
3281 }
3282
3283 &.vertical {
3284 &:dir(ltr) {
3285 padding: 0 0 0 15px;
3286
3287 trough {
3288 padding-left: 4px;
3289 background-position: 3px 0;
3290 border-bottom-right-radius: 0;
3291 border-top-right-radius: 0;
3292 }
3293
3294 slider {
3295 &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
3296 margin-left: -15px;
3297 margin-right: 6px;
3298 }
3299 }
3300 }
3301
3302 &:dir(rtl) {
3303 padding: 0 15px 0 0;
3304
3305 trough {
3306 padding-right: 4px;
3307 background-position: -3px 0;
3308 border-bottom-left-radius: 0;
3309 border-top-left-radius: 0;
3310 }
3311
3312 slider {
3313 &:hover, &:backdrop, &:disabled, &:backdrop:disabled, & {
3314 margin-right: -15px;
3315 margin-left: 6px;
3316 }
3317 }
3318 }
3319 }
3320
3321 &.fine-tune {
3322 &.horizontal {
3323 &:dir(ltr), &:dir(rtl) { // specificity bump
3324 padding: 0 0 12px 0;
3325
3326 trough {
3327 padding-bottom: 7px;
3328 background-position: 0 -6px;
3329 }
3330
3331 slider {
3332 margin-bottom: -15px;
3333 margin-top: 6px;
3334 }
3335 }
3336 }
3337
3338 &.vertical {
3339 &:dir(ltr) {
3340 padding: 0 0 0 12px;
3341
3342 trough {
3343 padding-left: 7px;
3344 background-position: 6px 0;
3345 }
3346
3347 slider {
3348 margin-left: -15px;
3349 margin-right: 6px;
3350 }
3351 }
3352
3353 &:dir(rtl) {
3354 padding: 0 12px 0 0;
3355
3356 trough {
3357 padding-right: 7px;
3358 background-position: -6px 0;
3359 }
3360
3361 slider {
3362 margin-right: -15px;
3363 margin-left: 6px;
3364 }
3365 }
3366 }
3367 }
3368 }
3369 }
3370
3371
3372 /*****************
3373 * Progress bars *
3374 *****************/
3375 progressbar {
3376 // sizing
3377 &.horizontal {
3378 trough { min-height: 6px; padding: 1px 0; }
3379 progress { min-height: 8px; }
3380 }
3381
3382 &.vertical {
3383 trough { min-width: 6px; padding: 0 1px; }
3384 progress { min-width: 8px; }
3385 }
3386
3387 &.horizontal progress,
3388 &.vertical progress { margin: 0; }
3389
3390
3391 // FIXME: insensitive state missing and some other state should be set probably
3392 font-size: smaller;
3393 color: transparentize($fg_color, 0.6);
3394 font-feature-settings: "tnum";
3395
3396 &:backdrop {
3397 box-shadow: none;
3398 transition: $backdrop_transition;
3399 }
3400
3401 trough { @extend %scale_trough; }
3402
3403 progress {
3404 @extend %scale_highlight;
3405
3406 border: 1px solid shade($selected_bg_color, 0.7);
3407 border-radius: 3px;
3408
3409 &.left {
3410 border-top-left-radius: 3px;
3411 border-bottom-left-radius: 3px;
3412 }
3413
3414 &.right {
3415 border-top-right-radius: 3px;
3416 border-bottom-right-radius: 3px;
3417 }
3418
3419 &.top {
3420 border-top-right-radius: 3px;
3421 border-top-left-radius: 3px;
3422 }
3423
3424 &.bottom {
3425 border-bottom-right-radius: 3px;
3426 border-bottom-left-radius: 3px;
3427 }
3428 }
3429
3430 &.osd { // progressbar.osd used for epiphany page loading progress
3431 min-width: 3px;
3432 min-height: 3px;
3433 background-color: transparent;
3434
3435 trough {
3436 border-style: none;
3437 border-radius: 0;
3438 background-color: transparent;
3439 box-shadow: none;
3440 }
3441
3442 progress {
3443 border-style: none;
3444 border-radius: 0;
3445 }
3446 }
3447
3448 trough.empty progress { all: unset; } // makes the progress indicator disappear, when the fraction is 0
3449 }
3450
3451 /*************
3452 * Level Bar *
3453 *************/
3454 levelbar {
3455 block {
3456 min-width: 32px;
3457 min-height: 1px;
3458 }
3459
3460 &.vertical block {
3461 min-width: 1px;
3462 min-height: 32px;
3463 }
3464
3465 &:backdrop { transition: $backdrop_transition; }
3466
3467 trough {
3468 border: 1px solid;
3469 padding: 2px;
3470 border-radius: 3px;
3471 @include entry(normal);
3472
3473 &:backdrop { @include entry(backdrop); }
3474 }
3475
3476 &.horizontal.discrete block { margin: 0 1px; }
3477
3478 &.vertical.discrete block { margin: 1px 0; }
3479
3480 block {
3481 border: 1px solid;
3482 border-radius: 1px;
3483 box-shadow: 0 1px transparentize(black, 0.8);
3484
3485 &:backdrop { box-shadow: none; }
3486
3487 &.low {
3488 border-color: if($variant == 'light', darken($warning_color, 20%), $warning_color);
3489 background-color: $warning_color;
3490
3491 &:backdrop { border-color: $warning_color; };
3492 }
3493
3494 &.high,
3495 &:not(.empty) {
3496 border-color: if($variant == 'light', darken($selected_bg_color, 20%), $selected_bg_color);
3497 background-color: $selected_bg_color;
3498
3499 &:backdrop { border-color: $selected_bg_color; }
3500 }
3501
3502 &.full {
3503 border-color: if($variant == 'light', darken($success_color, 20%), $success_color);
3504 background-color: $success_color;
3505
3506 &:backdrop { border-color: $success_color; };
3507 }
3508
3509 &.empty {
3510 background-color: transparent;
3511 border-color: if($variant == 'light', transparentize($fg_color,0.8), transparentize($fg_color,0.9));
3512 box-shadow: none;
3513
3514 &:backdrop { border-color: transparentize($backdrop_fg_color,0.85); }
3515 }
3516 }
3517 }
3518
3519
3520 /****************
3521 * Print dialog *
3522 *****************/
3523 printdialog {
3524 paper {
3525 color: $fg_color;
3526 border: 1px solid $borders_color;
3527 background: white;
3528 padding: 0;
3529
3530 &:backdrop {
3531 color: $backdrop_fg_color;
3532 border-color: $backdrop_borders_color;
3533 }
3534 }
3535 .dialog-vbox {
3536 background-color: $bg_color;
3537 &:backdrop { background-color: $backdrop_bg_color; }
3538 }
3539
3540 .dialog-action-box { margin: 12px; }
3541 }
3542
3543
3544 /**********
3545 * Frames *
3546 **********/
3547 frame > border,
3548 .frame {
3549 box-shadow: none;
3550 margin: 0;
3551 padding: 0;
3552 border-radius: 0;
3553 border: 1px solid $borders_color;
3554
3555 &.flat { border-style: none; }
3556
3557 &:backdrop { border-color: $backdrop_borders_color; }
3558 }
3559
3560 actionbar > revealer > box {
3561 padding: 6px;
3562 border-top: 1px solid $borders_color;
3563
3564 &:backdrop { border-color: $backdrop_borders_color; }
3565 }
3566
3567 scrolledwindow {
3568 viewport.frame { // avoid double borders when viewport inside scrolled window
3569 border-style: none;
3570 }
3571
3572 // This is used when content is touch-dragged past boundaries.
3573 // draws a box on top of the content, the size changes programmatically.
3574 overshoot {
3575 &.top {
3576 @include overshoot(top);
3577
3578 &:backdrop { @include overshoot(top, backdrop); }
3579 }
3580
3581 &.bottom {
3582 @include overshoot(bottom);
3583
3584 &:backdrop { @include overshoot(bottom, backdrop); }
3585 }
3586
3587 &.left {
3588 @include overshoot(left);
3589
3590 &:backdrop { @include overshoot(left, backdrop); }
3591 }
3592
3593 &.right {
3594 @include overshoot(right);
3595
3596 &:backdrop { @include overshoot(right, backdrop); }
3597 }
3598 }
3599
3600 // Overflow indication, works similarly to the overshoot, the size if fixed tho.
3601 undershoot {
3602 &.top { @include undershoot(top); }
3603
3604 &.bottom { @include undershoot(bottom); }
3605
3606 &.left { @include undershoot(left); }
3607
3608 &.right { @include undershoot(right); }
3609 }
3610
3611 junction { // the small square between two scrollbars
3612 border-color: transparent;
3613 // the border image is used to add the missing dot between the borders, details, details, details...
3614 border-image: linear-gradient(to bottom, $borders_color 1px, transparent 1px) 0 0 0 1 / 0 1px stretch;
3615 background-color: $scrollbar_bg_color;
3616
3617 &:dir(rtl) { border-image-slice: 0 1 0 0; }
3618
3619 &:backdrop {
3620 border-image-source: linear-gradient(to bottom, $backdrop_borders_color 1px, transparent 1px);
3621 background-color: $backdrop_scrollbar_bg_color;
3622 transition: $backdrop_transition;
3623 }
3624 }
3625 }
3626
3627 //vbox and hbox separators
3628 separator {
3629 background: transparentize(black, 0.9);
3630 min-width: 1px;
3631 min-height: 1px;
3632 }
3633
3634
3635 /*********
3636 * Lists *
3637 *********/
3638 list {
3639 color: $text_color;
3640 background-color: $base_color;
3641 border-color: $borders_color;
3642
3643 &:backdrop {
3644 color: $backdrop_text_color;
3645 background-color: $backdrop_base_color;
3646 border-color: $backdrop_borders_color;
3647 }
3648
3649 row { padding: 2px; }
3650 row.expander { padding: 0px; }
3651 row.expander .row-header { padding: 2px; }
3652
3653 &.separators row:not(:first-child) {
3654 border-top: 1px solid $borders_color;
3655 }
3656 }
3657
3658 row {
3659 transition: all 150ms $ease-out-quad;
3660
3661 &:hover { transition: none; }
3662
3663 &:backdrop { transition: $backdrop_transition; }
3664
3665 &.activatable {
3666 &.has-open-popup, // this is for indicathing which row generated a popover see https://bugzilla.gnome.org/show_bug.cgi?id=754411
3667
3668 &:hover { background-color: if(variant == light, transparentize($fg_color, 0.9), transparentize($fg_color, 0.95)); }
3669
3670 &:active { box-shadow: inset 0 2px 2px -2px transparentize(black, 0.8); }
3671
3672 &:backdrop:hover { background-color: transparent; }
3673
3674 &:selected {
3675 @extend %selected_items;
3676
3677 &:active { box-shadow: inset 0 2px 3px -1px transparentize(black, 0.5); }
3678
3679 &.has-open-popup,
3680 &:hover { background-color: mix($fg_color, $selected_bg_color, 10%); }
3681 }
3682 }
3683
3684 &:selected { @extend %selected_items; }
3685 }
3686
3687
3688 /*********************
3689 * App Notifications *
3690 *********************/
3691 .app-notification,
3692 .app-notification.frame {
3693 @extend %osd;
3694
3695 padding: 10px;
3696 border-radius: 0 0 5px 5px;
3697 background-color: $osd_bg_color;
3698 background-image: linear-gradient(to bottom, transparentize(black, 0.8),
3699 transparent 2px);
3700 background-clip: padding-box;
3701
3702 &:backdrop {
3703 background-image: none;
3704 transition: $backdrop_transition;
3705 }
3706
3707 button { @extend %osd_button; }
3708
3709 border { border: none; }
3710 }
3711
3712
3713 /*************
3714 * Expanders *
3715 *************/
3716 expander {
3717 title > arrow {
3718 min-width: 16px;
3719 min-height: 16px;
3720 -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
3721 &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
3722
3723 &:hover { color: lighten($fg_color,30%); } //only lightens the arrow
3724 &:disabled { color: $insensitive_fg_color; }
3725 &:disabled:backdrop { color: $backdrop_insensitive_color; }
3726
3727 &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
3728 }
3729 }
3730
3731
3732 /************
3733 * Calendar *
3734 ***********/
3735 calendar {
3736 color: $text_color;
3737 border: 1px solid $borders_color;
3738
3739 &:selected {
3740 @extend %selected_items;
3741
3742 border-radius: 3px;
3743 }
3744
3745 &.header {
3746 border-bottom-color: transparentize(black, 0.9);
3747
3748 &:backdrop { border-bottom-color: transparentize(black, 0.9); }
3749 }
3750
3751 &.button {
3752 @extend %undecorated_button;
3753
3754 color: transparentize($fg_color, 0.55);
3755
3756 &:hover { color: $fg_color; }
3757
3758 &:backdrop { color: transparentize($backdrop_fg_color,0.55); }
3759
3760 &:disabled { color: transparentize($insensitive_fg_color,0.55); }
3761 }
3762
3763 &.highlight {
3764 color: $insensitive_fg_color;
3765
3766 &:backdrop { color: $backdrop_insensitive_color; }
3767 }
3768
3769 &:backdrop {
3770 color: $backdrop_text_color;
3771 border-color: $backdrop_borders_color;
3772 }
3773
3774 &:indeterminate { color: gtkalpha(currentColor, 0.1); }
3775 }
3776
3777
3778 /***********
3779 * Dialogs *
3780 ***********/
3781 messagedialog { // Message Dialog styling
3782 .titlebar {
3783 min-height: 20px;
3784 background-image: none;
3785 background-color: $bg_color;
3786 border-style: none;
3787 border-top-left-radius: 7px;
3788 border-top-right-radius: 7px;
3789 }
3790
3791 &.csd { // rounded bottom border styling for csd version
3792 &.background {
3793 // bigger radius for better antialiasing
3794 border-bottom-left-radius: 9px;
3795 border-bottom-right-radius: 9px;
3796 }
3797
3798 .dialog-action-area {
3799 padding: 0px;
3800 button {
3801 padding: 3px;
3802 border-radius: 0px;
3803 border-left-style: solid;
3804 border-right-style: none;
3805 border-bottom-style: none;
3806
3807 &:first-child{
3808 border-left-style: none;
3809 border-bottom-left-radius: 7px;
3810 -gtk-outline-bottom-left-radius: 5px;
3811 }
3812
3813 &:last-child {
3814 border-bottom-right-radius: 7px;
3815 -gtk-outline-bottom-right-radius: 5px;
3816 }
3817 }
3818 }
3819 }
3820 }
3821
3822 filechooser {
3823 .dialog-action-box {
3824 border-top: 1px solid $borders_color;
3825
3826 &:backdrop { border-top-color: $backdrop_borders_color; }
3827 }
3828
3829 #pathbarbox {
3830 border-bottom: 1px solid $bg_color;
3831 stack { background-color: $bg_color; }
3832 }
3833 }
3834
3835 filechooserbutton:drop(active) {
3836 box-shadow: none;
3837 border-color: transparent;
3838 }
3839
3840
3841 /***********
3842 * Sidebar *
3843 ***********/
3844 .sidebar {
3845 border-style: none;
3846 background-color: $sidebar_bg_color;
3847
3848 row,
3849 treeview {
3850 border-top: 1px solid transparent;
3851 border-bottom: 1px solid transparent;
3852 &:selected, &:selected:focus {
3853 background-image: linear-gradient(to bottom,
3854 shade($sidebar_bg_color, 0.87),
3855 shade($sidebar_bg_color, 0.95) 10%,
3856 shade($sidebar_bg_color, 0.99) 92%,
3857 shade($sidebar_bg_color, 0.92)
3858 );
3859 border-top: 1px solid shade($bg_color, 0.85);
3860 border-bottom: 1px solid shade($bg_color, 1.12);
3861
3862 label {
3863 color: $fg_color;
3864 &:backdrop { color: $backdrop_fg_color; }
3865 }
3866 &:backdrop {
3867 background-image: none;
3868 background-color: $bg_color;
3869 color: $fg_color;
3870 border-top: 1px solid shade($bg_color, 0.9);
3871 border-bottom: 1px solid shade($bg_color, 0.9);
3872 }
3873 }
3874 .view:selected, .view:selected:focus { color: $fg_color; }
3875 &:backdrop { background-color: transparent; }
3876 }
3877 @at-root %sidebar_left,
3878 &:dir(ltr),
3879 &.left,
3880 &.left:dir(rtl) {
3881 border-right: 1px solid $borders_color;
3882 border-left-style: none;
3883 border-top-style: none;
3884 border-bottom-style: none;
3885 }
3886
3887 @at-root %sidebar_right
3888 &:dir(rtl),
3889 &.right {
3890 border-left: 1px solid $borders_color;
3891 border-right-style: none;
3892 border-top-style: none;
3893 border-bottom-style: none;
3894 }
3895
3896 &:backdrop {
3897 background-color: $backdrop_sidebar_bg_color;
3898 border-color: $backdrop_borders_color;
3899 transition: $backdrop_transition;
3900 }
3901
3902 list, treeview {
3903 background-color: transparent;
3904 &:backdrop {
3905 background-color: transparent;
3906 }
3907 }
3908
3909 paned & { &.left, &.right, &.left:dir(rtl), &:dir(rtl), &:dir(ltr), & { border-style: none; } }
3910 }
3911
3912 stacksidebar {
3913 &.sidebar {
3914 &:dir(ltr),
3915 &.left,
3916 &.left:dir(rtl) { list { @extend %sidebar_left; }}
3917
3918 &:dir(rtl),
3919 &.right { list { @extend %sidebar_right; }}
3920 }
3921
3922 row {
3923 padding: 10px 4px;
3924
3925 > label {
3926 padding-left: 6px;
3927 padding-right: 6px;
3928 }
3929
3930 &.needs-attention > label {
3931 @extend %needs_attention;
3932
3933 background-size: 6px 6px, 0 0;
3934 }
3935 }
3936 }
3937
3938
3939 /****************
3940 * File chooser *
3941 ****************/
3942 $_placesidebar_icons_opacity: 0.7;
3943
3944 placessidebar {
3945 > viewport.frame { border-style: none; }
3946
3947 row {
3948 // Needs overriding of the GtkListBoxRow padding
3949 min-height: 24px;
3950 padding: 0px;
3951
3952 // Using margins/padding directly in the SidebarRow
3953 // will make the animation of the new bookmark row jump
3954 > revealer { padding: 0 14px; }
3955
3956 &:selected { color: $fg_color; }
3957
3958 &:disabled { color: $insensitive_fg_color; }
3959
3960 &:backdrop {
3961 color: $backdrop_fg_color;
3962 background-color: $backdrop_bg_color;
3963
3964 &:selected { color: $backdrop_fg_color; }
3965
3966 &:disabled { color: $backdrop_insensitive_color; }
3967 }
3968
3969 image.sidebar-icon {
3970 &:dir(ltr) { padding-right: 8px; }
3971 &:dir(rtl) { padding-left: 8px; }
3972 }
3973
3974 label.sidebar-label {
3975 &:dir(ltr) { padding-right: 2px; }
3976 &:dir(rtl) { padding-left: 2px; }
3977 }
3978
3979 @at-root button.sidebar-button {
3980 @extend %button_basic.flat;
3981
3982 @extend %button_selected.flat;
3983
3984 min-height: 26px;
3985 min-width: 26px;
3986 margin-top: 3px;
3987 margin-bottom: 3px;
3988 padding: 0;
3989 border-radius: 100%;
3990 -gtk-outline-radius: 100%;
3991
3992 &:not(:hover):not(:active),
3993 &:backdrop { > image { opacity: $_placesidebar_icons_opacity; }}
3994 }
3995
3996 // in the sidebar case it makes no sense to click the selected row
3997 &:selected:active { box-shadow: none; }
3998
3999 &.sidebar-placeholder-row {
4000 padding: 0 8px;
4001 min-height: 2px;
4002 background-image: image($drop_target_color);
4003 background-clip: content-box;
4004 }
4005
4006 &.sidebar-new-bookmark-row { color: $selected_bg_color; }
4007
4008 &:drop(active):not(:disabled) {
4009 color: $drop_target_color;
4010 box-shadow: inset 0 1px $drop_target_color,
4011 inset 0 -1px $drop_target_color;
4012
4013 &:selected {
4014 color: $selected_fg_color;
4015 background-image: linear-gradient(to bottom,
4016 darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 13%),
4017 darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 5%) 10%,
4018 darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 1%) 92%,
4019 darken(mix(darken($base_color, 10%), lighten($selected_bg_color, 35%), 0.1), 8%)
4020 );
4021 }
4022 }
4023 }
4024 }
4025
4026 placesview {
4027 .server-list-button > image {
4028 transition: 200ms $ease-out-quad;
4029 -gtk-icon-transform: rotate(0turn);
4030 }
4031
4032 .server-list-button:checked > image {
4033 transition: 200ms $ease-out-quad;
4034 -gtk-icon-transform: rotate(-0.5turn);
4035 }
4036
4037 row.activatable:hover { background-color: transparent; }
4038
4039 // this selects the "connect to server" label
4040 > actionbar > revealer > box > label {
4041 padding-left: 8px;
4042 padding-right: 8px;
4043 }
4044 }
4045
4046
4047 /*********
4048 * Paned *
4049 *********/
4050 paned {
4051 > separator {
4052 min-width: 1px;
4053 min-height: 1px;
4054 -gtk-icon-source: none; // defeats the ugly default handle decoration
4055 border-style: none; // just to be sure
4056 background-color: transparent;
4057 // workaround, using background istead of a border since the border will get rendered twice (?)
4058 background-image: image($borders_color);
4059 background-size: 1px 1px;
4060
4061 &:selected { background-image: image($selected_bg_color); } // FIXME is this needed?
4062
4063 &:backdrop { background-image: image($backdrop_borders_color); }
4064
4065 &.wide {
4066 min-width: 5px;
4067 min-height: 5px;
4068 background-color: $bg_color;
4069 background-image: image($borders_color), image($borders_color);
4070 background-size: 1px 1px, 1px 1px;
4071
4072 &:backdrop {
4073 background-color: $backdrop_bg_color;
4074 background-image: image($backdrop_borders_color),
4075 image($backdrop_borders_color);
4076 }
4077 }
4078 }
4079
4080 &.horizontal > separator {
4081 background-repeat: repeat-y;
4082
4083 &:dir(ltr) {
4084 margin: 0 -8px 0 0;
4085 padding: 0 8px 0 0;
4086 background-position: left;
4087 }
4088 &:dir(rtl) {
4089 margin: 0 0 0 -8px;
4090 padding: 0 0 0 8px;
4091 background-position: right;
4092 }
4093
4094 &.wide {
4095 margin: 0;
4096 padding: 0;
4097 background-repeat: repeat-y, repeat-y;
4098 background-position: left, right;
4099 }
4100 }
4101
4102 &.vertical > separator {
4103 margin: 0 0 -8px 0;
4104 padding: 0 0 8px 0;
4105 background-repeat: repeat-x;
4106 background-position: top;
4107
4108 &.wide {
4109 margin: 0;
4110 padding: 0;
4111 background-repeat: repeat-x, repeat-x;
4112 background-position: bottom, top;
4113 }
4114 }
4115 }
4116
4117
4118 /**************
4119 * GtkInfoBar *
4120 **************/
4121 infobar { border-style: none; }
4122
4123 .info,
4124 .question,
4125 .warning,
4126 .error {
4127 &:backdrop, & {
4128 label, & { color: $selected_fg_color; }
4129 background-color: $selected_bg_color;
4130 border-color: darken($selected_bg_color, 10%);
4131 }
4132
4133 text-shadow: 0 1px darken($selected_bg_color, 10%);
4134
4135 &:backdrop { text-shadow: none; }
4136
4137 button {
4138 // FIXME: extend selection mode buttons
4139 @include button(normal, $selected_bg_color, $selected_fg_color, none);
4140 border-color: darken($selected_bg_color, 20%);
4141
4142 &:hover { @include button(hover, $selected_bg_color, $selected_fg_color, none); }
4143
4144 &:active,
4145 &:checked { @include button(active, $selected_bg_color, $selected_fg_color, none); }
4146
4147 &:disabled { @include button(insensitive,$selected_bg_color,$selected_fg_color,none); }
4148
4149 &:backdrop {
4150 @include button(backdrop, $selected_bg_color, $selected_fg_color, none);
4151 border-color: _border_color($selected_bg_color);
4152
4153 &:disabled {
4154 @include button(backdrop-insensitive, $selected_bg_color,
4155 $selected_fg_color, none);
4156 border-color: _border_color($selected_bg_color);
4157 }
4158 }
4159 }
4160
4161 label:selected { &:focus, &:hover, & { background-color: darken($selected_bg_color, 10%); }}
4162
4163 *:link { @extend %link_selected; }
4164 }
4165
4166
4167 /*************
4168 * Buttonbox *
4169 *************/
4170 buttonbox {
4171 padding: 6px;
4172 }
4173
4174
4175 /************
4176 * Tooltips *
4177 ************/
4178 tooltip {
4179 &.background {
4180 // background-color needs to be set this way otherwise it gets drawn twice
4181 // see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details.
4182 background-color: transparentize(black, 0.2);
4183 background-clip: padding-box;
4184 border: 1px solid $tooltip_borders_color; // this suble border is meant to
4185 // not make the tooltip melt with
4186 // very dark backgrounds
4187 }
4188
4189 padding: 1px; /* not working */
4190 border-radius: 5px;
4191 box-shadow: none; // otherwise it gets inherited by windowframe.csd
4192 text-shadow: 0 1px black;
4193
4194 // FIXME: we need a border or tooltips vanish on black background.
4195 decoration { background-color: transparent; }
4196
4197 * { // Yeah this is ugly
4198 padding: 1px;
4199 background-color: transparent;
4200 color: white;
4201 }
4202 }
4203
4204
4205 /*****************
4206 * Color Chooser *
4207 *****************/
4208 colorswatch {
4209 // This widget is made of two boxes one on top of the other, the lower box is colorswatch {} the other one
4210 // is colorswatch overlay {}, colorswatch has the programmatically set background, so most of the style is
4211 // applied to the overlay box.
4212
4213 &, &:drop(active) { border-style: none; } // FIXME: implement a proper drop(active) state
4214
4215 $_colorswatch_radius: 5px;
4216 $_colorswatch_overlay_shadow: if($variant == 'light', inset 0 2px 2px -3px transparentize(black, 0.3),
4217 inset 0 3px 2px -2px transparentize(black, 0.5));
4218
4219 // base color corners rounding
4220 // to avoid the artifacts caused by rounded corner anti-aliasing the base color
4221 // sports a bigger radius.
4222 // nth-child is needed by the custom color strip.
4223
4224 &.top {
4225 border-top-left-radius: $_colorswatch_radius + 0.5px;
4226 border-top-right-radius: $_colorswatch_radius + 0.5px;
4227
4228 overlay {
4229 border-top-left-radius: $_colorswatch_radius;
4230 border-top-right-radius: $_colorswatch_radius;
4231 }
4232 }
4233
4234 &.bottom {
4235 border-bottom-left-radius: $_colorswatch_radius + 0.5px;
4236 border-bottom-right-radius: $_colorswatch_radius + 0.5px;
4237
4238 overlay {
4239 border-bottom-left-radius: $_colorswatch_radius;
4240 border-bottom-right-radius: $_colorswatch_radius;
4241 }
4242 }
4243
4244 &.left,
4245 &:first-child:not(.top) {
4246 border-top-left-radius: $_colorswatch_radius + 0.5px;
4247 border-bottom-left-radius: $_colorswatch_radius + 0.5px;
4248
4249 overlay {
4250 border-top-left-radius: $_colorswatch_radius;
4251 border-bottom-left-radius: $_colorswatch_radius;
4252 }
4253 }
4254
4255 &.right,
4256 &:last-child:not(.bottom) {
4257 border-top-right-radius: $_colorswatch_radius + 0.5px;
4258 border-bottom-right-radius: $_colorswatch_radius + 0.5px;
4259
4260 overlay {
4261 border-top-right-radius: $_colorswatch_radius;
4262 border-bottom-right-radius: $_colorswatch_radius;
4263 }
4264 }
4265
4266 &.dark overlay {
4267 color: $selected_fg_color;
4268
4269 &:hover { border-color: if($variant == 'light', transparentize(black, 0.2), $borders_color); }
4270
4271 &:backdrop { color: $backdrop_selected_fg_color; }
4272 }
4273
4274 &.light overlay {
4275 color: $text_color;
4276
4277 &:hover { border-color: if($variant == 'light', transparentize(black, 0.5), $borders_color); }
4278
4279 &:backdrop { color: $backdrop_text_color; }
4280 }
4281
4282 &:drop(active) {
4283 box-shadow: none;
4284
4285 &.light overlay {
4286 border-color: $drop_target_color;
4287 box-shadow: inset 0 0 0 2px if($variant == 'light', darken($drop_target_color, 7%), $borders_color),
4288 inset 0 0 0 1px $drop_target_color;
4289 }
4290
4291 &.dark overlay {
4292 border-color: $drop_target_color;
4293 box-shadow: inset 0 0 0 2px if($variant == 'light', transparentize(black, 0.7), $borders_color),
4294 inset 0 0 0 1px $drop_target_color;
4295 }
4296 }
4297
4298 overlay {
4299 box-shadow: $_colorswatch_overlay_shadow;
4300 border: 1px solid if($variant == 'light', transparentize(black, 0.7), $borders_color);
4301
4302 &:hover { box-shadow: inset 0 1px transparentize(white, 0.7); }
4303
4304 &:backdrop, &:backdrop:hover {
4305 border-color: if($variant == 'light', transparentize(black, 0.7), $borders_color);
4306 box-shadow: none;
4307 }
4308 }
4309
4310 &#add-color-button {
4311 border-radius: $_colorswatch_radius $_colorswatch_radius 0 0;
4312
4313 &:only-child { border-radius: $_colorswatch_radius; }
4314
4315 overlay {
4316 @include button(normal);
4317
4318 &:hover { @include button(hover); }
4319
4320 &:backdrop { @include button(backdrop); }
4321 }
4322 }
4323
4324 &:disabled {
4325 opacity: 0.5;
4326
4327 overlay {
4328 border-color: transparentize(black, 0.4);
4329 box-shadow: none;
4330 }
4331 }
4332
4333 row:selected & { box-shadow: 0 0 0 2px $selected_fg_color; }
4334
4335 &#editor-color-sample {
4336 border-radius: 4px;
4337
4338 overlay { border-radius: 4.5px; }
4339 }
4340 }
4341
4342 // colorscale popup
4343 colorchooser .popover.osd { border-radius: 5px; }
4344
4345 /********
4346 * Misc *
4347 ********/
4348 //content view (grid/list)
4349 .content-view {
4350 background-color: darken($bg_color,7%);
4351
4352 &:hover { -gtk-icon-effect: highlight; }
4353
4354 &:backdrop { background-color: darken($bg_color,7%); }
4355
4356 rubberband, .rubberband { @extend rubberband; }
4357 }
4358
4359 .scale-popup {
4360 .osd & { @extend %osd; }
4361
4362 .osd & button.flat { //FIXME: quick hack, redo properly
4363 border-style: none;
4364 border-radius: 5px;
4365 }
4366
4367 button { // +/- buttons on GtkVolumeButton popup
4368 &:hover {
4369 @extend %undecorated_button;
4370 background-color: transparentize($fg_color,0.9);
4371 border-radius: 5px;
4372 }
4373
4374 &:backdrop { &:hover, &:disabled, & { @extend %undecorated_button; }}
4375 }
4376 }
4377
4378
4379 /**********************
4380 * Window Decorations *
4381 *********************/
4382 decoration {
4383 border-radius: 7px 7px 0 0;
4384 // lamefun trick to get rounded borders regardless of CSD use
4385 border-width: 0px;
4386
4387 // this needs to be transparent
4388 // see bug #722563
4389 $_wm_border: if($variant=='light', transparentize(black, 0.77), transparentize($borders_color, 0.1));
4390 $_wm_border_backdrop: if($variant=='light', transparentize(black, 0.82), transparentize($borders_color, 0.1));
4391
4392 box-shadow: 0 3px 9px 1px transparentize(black, 0.5),
4393 0 0 0 1px $_wm_border; //doing borders with box-shadow
4394
4395 // FIXME rationalize shadows
4396
4397 // this is used for the resize cursor area
4398 margin: 10px;
4399
4400 &:backdrop {
4401 // the transparent shadow here is to enforce that the shadow extents don't
4402 // change when we go to backdrop, to prevent jumping windows.
4403 // The biggest shadow should be in the same order then in the active state
4404 // or the jumping will happen during the transition.
4405 box-shadow: 0 3px 9px 1px transparent,
4406 0 2px 6px 2px transparentize(black, 0.8),
4407 0 0 0 1px $_wm_border_backdrop;
4408 transition: $backdrop_transition;
4409 }
4410
4411 .maximized &,
4412 .fullscreen &,
4413 .tiled &,
4414 .tiled-top &,
4415 .tiled-right &,
4416 .tiled-bottom &,
4417 .tiled-left & { border-radius: 0; }
4418
4419 .popup & { box-shadow: none; }
4420
4421 // server-side decorations as used by mutter
4422 .ssd & { box-shadow: 0 0 0 1px $_wm_border; } //just doing borders, wm draws actual shadows
4423
4424 .csd.popup & {
4425 border-radius: 0;
4426 box-shadow: 0 1px 2px transparentize(black, 0.8),
4427 0 0 0 1px transparentize($_wm_border,0.1);
4428 }
4429
4430 tooltip.csd & {
4431 border-radius: 5px;
4432 box-shadow: none;
4433 }
4434
4435 messagedialog.csd & {
4436 border-radius: 7px;
4437 box-shadow: 0 1px 2px transparentize(black, 0.8),
4438 0 0 0 1px transparentize($_wm_border,0.1);
4439 }
4440
4441 .solid-csd & {
4442 margin: 0;
4443 padding: 4px;
4444 background-color: $borders_color;
4445 border: solid 1px $borders_color;
4446 border-radius: 0;
4447 box-shadow: inset 0 0 0 3px $headerbar_color, inset 0 1px $top_hilight;
4448
4449 &:backdrop { box-shadow: inset 0 0 0 3px $backdrop_bg_color, inset 0 1px $top_hilight; }
4450 }
4451 }
4452
4453 // Window buttons
4454 button.titlebutton {
4455 @extend %button_basic;
4456
4457 @extend %button_basic.flat;
4458
4459 @include _button_text_shadow;
4460
4461 &:not(.appmenu) {
4462 color: transparent;
4463 background-color: transparent;
4464 background-position: center;
4465 background-repeat: no-repeat;
4466
4467 // fade the png buttons out on unfocused windows
4468 &:backdrop { opacity: 0.5; }
4469 }
4470 // Load png assets for each button
4471 @each $k in ('close','maximize', 'minimize') {
4472 @each $l, $m in ('',''), (':backdrop','-backdrop'), (':hover','-hover'), (':active','-active') {
4473 &.#{$k}#{$l} { background-image: -gtk-scaled(url('assets/titlebutton-#{$k}#{$m}#{$asset_suffix}.png'),
4474 url('assets/titlebutton-#{$k}#{$m}#{$asset_suffix}@2.png')); }
4475 }
4476 }
4477
4478 .selection-mode & {
4479 @extend %button.flat.suggested-action;
4480
4481 @extend %nobg_selected_items;
4482 }
4483
4484 &:backdrop { -gtk-icon-shadow: none; }
4485 }
4486
4487 .selection-mode headerbar button.titlebutton,
4488 .selection-mode .titlebar button.titlebutton,
4489 headerbar.selection-mode button.titlebutton,
4490 .titlebar.selection-mode button.titlebutton {
4491 @include _button_text_shadow(white, $selected_bg_color);
4492
4493 &:backdrop { -gtk-icon-shadow: none; }
4494 }
4495
4496
4497 // catch all extend :)
4498
4499 %selected_items {
4500
4501 // don't differentiate between focussed and unfocussed widgets.
4502 &:focus, &{
4503 color: $selected_fg_color;
4504 background-color: $selected_bg_color;
4505 }
4506
4507 &:backdrop {
4508 color: $backdrop_selected_fg_color;
4509 background-color: $backdrop_selected_bg_color;
4510 }
4511
4512 @at-root %nobg_selected_items, & {
4513 color: $selected_fg_color;
4514
4515 @if $variant == 'light' { outline-color: transparentize($selected_fg_color, 0.7); }
4516
4517 &:disabled { color: mix($selected_fg_color, $selected_bg_color, 50%); }
4518
4519 &:backdrop {
4520 color: $backdrop_selected_fg_color;
4521 &:disabled { color: mix($backdrop_selected_fg_color, $selected_bg_color, 30%); }
4522 }
4523 }
4524 }
4525
4526 .monospace { font-family: monospace; }
4527
4528
4529 /**********************
4530 * Touch Copy & Paste *
4531 *********************/
4532 //touch selection handlebars for the Popover.osd above
4533 cursor-handle {
4534 background-color: transparent;
4535 background-image: none;
4536 box-shadow: none;
4537 border-style: none;
4538
4539 @each $s,$as in ('',''),
4540 (':hover','-hover'),
4541 (':active','-active') { //no need for insensitive and backdrop
4542 &.top#{$s}:dir(ltr), &.bottom#{$s}:dir(rtl) {
4543 $_url: 'assets/text-select-start#{$as}#{$asset_suffix}';
4544 -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
4545 url('#{$_url}@2.png'));
4546 padding-left: 10px;
4547 }
4548
4549 &.bottom#{$s}:dir(ltr), &.top#{$s}:dir(rtl) {
4550 $_url: 'assets/text-select-end#{$as}#{$asset_suffix}';
4551 -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
4552 url('#{$_url}@2.png'));
4553 padding-right: 10px;
4554 }
4555
4556 &.insertion-cursor#{$s}:dir(ltr), &.insertion-cursor#{$s}:dir(rtl) {
4557 $_url: 'assets/slider-horz-scale-has-marks-above#{$as}#{$asset_suffix}';
4558 -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
4559 url('#{$_url}@2.png'));
4560 }
4561 }
4562 }
4563
4564 .context-menu { font: initial; } // Decouple the font of context menus from their entry/textview
4565
4566 button.circular { // FIXME: aggregate to buttons
4567 border-radius: 9999px;
4568 -gtk-outline-radius: 9999px;
4569
4570 label { padding: 0; }
4571 }
4572
4573 // shortcut window keys
4574 .keycap {
4575 min-width: 20px;
4576 min-height: 25px;
4577 margin-top: 2px;
4578 padding-bottom: 3px;
4579 padding-left: 6px;
4580 padding-right: 6px;
4581
4582 color: $fg_color;
4583 background-color: $base_color;
4584 border: 1px solid;
4585 border-color: if($variant == 'light', mix($borders_color, $bg_color, 50%), $borders_color);
4586 border-radius: 5px;
4587 box-shadow: if($variant == 'light', inset 0 -3px mix($base_color, $bg_color, 20%), inset 0 -3px mix($borders_color, $base_color, 60%));
4588 font-size: smaller;
4589
4590 &:backdrop {
4591 background-color: $backdrop_base_color;
4592 color: $backdrop_fg_color;
4593 transition: $backdrop_transition;
4594 }
4595 }
4596
4597 :not(decoration):not(window):drop(active):focus,
4598 :not(decoration):not(window):drop(active) { // FIXME needs to be done widget by widget, this wildcard should really die
4599 border-color: $drop_target_color;
4600 box-shadow: inset 0 0 0 1px $drop_target_color;
4601 caret-color: $drop_target_color;
4602 }
4603
4604 stackswitcher button.text-button { min-width: 100px; } // FIXME aggregate with buttons
4605
4606 stackswitcher button.circular,
4607 stackswitcher button.text-button.circular { // FIXME aggregate with buttons
4608 min-width: 32px;
4609 min-height: 32px;
4610 padding: 0;
4611 }
4612
4613 /*************
4614 * App Icons *
4615 *************/
4616 /* Outline for low res icons */
4617 .lowres-icon {
4618 -gtk-icon-shadow: 0 -1px rgba(0,0,0,0.05),
4619 1px 0 rgba(0,0,0,0.1),
4620 0 1px rgba(0,0,0,0.3),
4621 -1px 0 rgba(0,0,0,0.1);
4622 }
4623
4624 /* Dropshadow for large icons */
4625 .icon-dropshadow {
4626 -gtk-icon-shadow: 0 1px 12px rgba(0,0,0,0.05),
4627 0 -1px rgba(0,0,0,0.05),
4628 1px 0 rgba(0,0,0,0.1),
4629 0 1px rgba(0,0,0,0.3),
4630 -1px 0 rgba(0,0,0,0.1);
4631 }
4632
4633 /*********
4634 * Emoji *
4635 ********/
4636
4637 popover.emoji-picker {
4638 padding-left: 0;
4639 padding-right: 0;
4640
4641 entry.search { margin: 3px 5px 5px 5px; }
4642 }
4643
4644 button.emoji-section {
4645 border-color: transparent;
4646 border-width: 3px;
4647 border-style: none none solid;
4648 border-radius: 0;
4649
4650 margin: 2px 4px 2px 4px;
4651 padding: 3px 0 0;
4652 min-width: 32px;
4653 min-height: 28px;
4654
4655 /* reset props inherited from the button style */
4656 background: none;
4657 box-shadow: none;
4658 text-shadow: none;
4659
4660 outline-offset: -5px;
4661
4662 &:first-child { margin-left: 7px; }
4663 &:last-child { margin-right: 7px; }
4664
4665 &:backdrop:not(:checked) { border-color: transparent; }
4666 &:hover { border-color: if($variant == 'light', $borders_color, transparentize($fg_color, .9)); }
4667 &:checked { border-color: $selected_bg_color; }
4668
4669 label {
4670 padding: 0;
4671
4672 opacity: 0.55;
4673 }
4674
4675 &:hover label { opacity: 0.775; }
4676 &:checked label { opacity: 1; }
4677 }
4678
4679 popover.emoji-picker .emoji {
4680 font-size: x-large;
4681 padding: 6px;
4682
4683 :hover {
4684 background: $selected_bg_color;
4685 border-radius: 6px;
4686 }
4687 }
4688
4689 popover.emoji-completion arrow {
4690 border: none;
4691 background: none;
4692 }
4693
4694 popover.emoji-completion contents row box {
4695 padding: 2px 10px;
4696 }
4697
4698 popover.emoji-completion .emoji:hover {
4699 background: $popover_hover_color;
4700 }