_common.scss
ASCII text
1
* {
2
padding: 0;
3
background-clip: padding-box;
4
5
-GtkToolButton-icon-spacing: 4;
6
-GtkTextView-error-underline-color: $error_color;
7
8
// The size for scrollbars. The slider is 2px smaller, but we keep it
9
// up so that the whole area is sensitive to button presses for the
10
// slider. The stepper button is larger in both directions, the slider
11
// only in the width
12
13
-GtkScrolledWindow-scrollbar-spacing: 0;
14
15
-GtkToolItemGroup-expander-size: 11;
16
17
-GtkWidget-text-handle-width: 24;
18
-GtkWidget-text-handle-height: 24;
19
20
-GtkDialog-button-spacing: 4;
21
-GtkDialog-action-area-border: 0;
22
23
// We use the outline properties to signal the focus properties
24
// to the adwaita engine: using real CSS properties is faster,
25
// and we don't use any outlines for now.
26
27
outline-style: solid;
28
outline-width: 2px;
29
outline-color: $fill_color;
30
outline-offset: -4px;
31
-gtk-outline-radius: 2px;
32
33
-gtk-secondary-caret-color: $primary_color;
34
}
35
36
37
/***************
38
* Base States *
39
***************/
40
.background {
41
background-color: $bg_color;
42
color: $fg_color;
43
}
44
45
/*
46
These wildcard seems unavoidable, need to investigate.
47
Wildcards are bad and troublesome, use them with care,
48
or better, just don't.
49
Everytime a wildcard is used a kitten dies, painfully.
50
*/
51
52
*:disabled { -gtk-icon-effect: dim; }
53
54
.gtkstyle-fallback {
55
background-color: $bg_color;
56
color: $fg_color;
57
58
&:hover {
59
background-color: darken($bg_color, 5%);
60
color: $fg_color;
61
}
62
63
&:active {
64
background-color: darken($bg_color, 10%);
65
color: $fg_color;
66
}
67
68
&:disabled {
69
background-color: $bg_color;
70
color: $disabled_fg_color;
71
}
72
73
&:selected {
74
background-color: $primary_color;
75
color: $inverse_fg_color;
76
}
77
}
78
79
.view {
80
@extend row.activatable;
81
82
background-color: $base_color;
83
color: $fg_color;
84
85
&:disabled { color: $disabled_fg_color; }
86
87
selection,
88
&:selected { @extend %selected_items; }
89
}
90
91
textview {
92
// FIXME: we need to override background-color to ensure text rendering
93
text { background-color: $base_color; }
94
95
// FIXME: we cannot specify text color for the border node
96
border { background-color: $alt_base_color; }
97
}
98
99
iconview { border-radius: 2px; }
100
101
.rubberband,
102
rubberband {
103
border: 1px solid $alt_primary_color;
104
background-color: scale-alpha($alt_primary_color, $lower_opacity);
105
}
106
107
flowbox {
108
rubberband { @extend rubberband; }
109
110
flowboxchild {
111
padding: 4px;
112
border-radius: 2px;
113
outline-offset: -2px;
114
115
&:selected { @extend %selected_items; }
116
}
117
}
118
119
label {
120
caret-color: currentColor; // this shouldn't be needed.
121
122
&.separator {
123
@extend .dim-label;
124
125
color: $fg_color;
126
}
127
128
row:selected &,
129
&:selected { @extend %nobg_selected_items; }
130
131
selection {
132
background-color: $primary_color;
133
color: $inverse_fg_color;
134
}
135
136
&:disabled {
137
color: $disabled_fg_color;
138
139
selection { @extend %selected_items:disabled; }
140
141
tab &,
142
button & { color: inherit; }
143
}
144
}
145
146
.dim-label { opacity: $tertiary_opacity; }
147
148
assistant {
149
.sidebar {
150
padding: 4px 0;
151
// background-color: $base_color;
152
// border-top: 1px solid $border_color;
153
}
154
155
// &.csd .sidebar { border-top-style: none; }
156
157
.sidebar label {
158
min-height: $medium_size;
159
padding: 0 12px;
160
color: $tertiary_fg_color;
161
font-weight: 500;
162
163
&.highlight { color: $fg_color; }
164
}
165
}
166
167
%osd, .osd { opacity: $higher_opacity; }
168
169
170
/*********************
171
* Spinner Animation *
172
*********************/
173
@keyframes spin {
174
to { -gtk-icon-transform: rotate(1turn); }
175
}
176
177
@keyframes spin_colors {
178
1% { color: $info_bg_color; } 25% { color: $info_bg_color; }
179
26% { color: $question_bg_color; } 50% { color: $question_bg_color; }
180
51% { color: $warning_bg_color; } 75% { color: $warning_bg_color; }
181
76% { color: $error_bg_color; } 100% { color: $error_bg_color; }
182
}
183
184
spinner {
185
background: none;
186
opacity: 0; // non spinning spinner makes no sense
187
-gtk-icon-source: -gtk-icontheme('process-working-symbolic');
188
189
&:checked {
190
opacity: 1;
191
animation: spin 1s linear infinite, spin_colors 4s linear infinite;
192
193
&:disabled { opacity: $disabled_opacity; }
194
}
195
}
196
197
198
/****************
199
* Text Entries *
200
****************/
201
%entry,
202
entry {
203
%entry_basic, & {
204
min-height: $medium_size;
205
padding: 0 8px;
206
border-radius: 2px;
207
208
@include entry(normal);
209
210
&:focus { @include entry(focus); }
211
212
&:disabled { @include entry(disabled); }
213
214
&.flat {
215
border-radius: 0;
216
217
@include entry(flat-normal);
218
219
&:focus { @include entry(flat-focus); }
220
221
&:disabled { @include entry(flat-disabled); }
222
}
223
224
image { // icons inside the entry
225
// @extend %simple_flat_button;
226
227
// min-height: $small_size;
228
// min-width: $small_size;
229
// border-radius: $circular_radius;
230
// -gtk-outline-radius: $circular_radius;
231
color: gtkalpha(currentColor, $secondary_opacity);
232
233
&:hover, &:active { color: currentColor; }
234
235
&:disabled { color: gtkalpha(currentColor, $tertiary_opacity); }
236
237
&.left { margin-left: 2px; margin-right: 6px; }
238
239
&.right { margin-left: 6px; margin-right: 2px; }
240
}
241
242
undershoot {
243
&.left { @include undershoot(left); }
244
245
&.right { @include undershoot(right); }
246
}
247
248
selection { @extend %selected_items; }
249
250
// entry error and warning style
251
@each $e_type, $e_color in (error, $error_color),
252
(warning, $warning_color) {
253
&.#{$e_type} {
254
@include entry(normal, $e_color);
255
256
&:focus { @include entry(focus, $e_color); }
257
258
&:disabled { @include entry(disabled, $e_color); }
259
260
&.flat {
261
@include entry(flat-normal, $e_color);
262
263
&:focus { @include entry(flat-focus, $e_color); }
264
265
&:disabled { @include entry(flat-disabled, $e_color); }
266
}
267
}
268
}
269
270
&:drop(active) {
271
// box-shadow: inset 0 0 0 2px $accent_color;
272
}
273
274
.osd & {
275
}
276
}
277
278
progress {
279
margin: 2px (2px - 8px);
280
border-style: none none solid;
281
border-width: 2px;
282
border-color: $primary_color;
283
// border-radius: 0;
284
// box-shadow: none;
285
background-color: transparent;
286
// background-image: none;
287
}
288
289
// linked entries
290
.linked:not(.vertical) > & { @extend %linked; }
291
292
// Vertically linked entries
293
.linked.vertical > & { @extend %linked_vertical; }
294
295
.linked:not(.vertical) > &.flat,
296
.linked.vertical > &.flat { border-radius: 0; }
297
}
298
299
treeview entry {
300
&.flat, & {
301
min-height: 0;
302
padding: 2px;
303
border-radius: 0;
304
background-color: $base_color;
305
306
&, &:focus {
307
border-image: none;
308
box-shadow: none;
309
}
310
}
311
}
312
313
314
/***********
315
* Buttons *
316
***********/
317
// stuff for .needs-attention
318
@keyframes needs_attention {
319
from {
320
background-image: -gtk-gradient(radial,
321
center center, 0,
322
center center, 0.001,
323
to($accent_color),
324
to(transparent));
325
}
326
327
to {
328
background-image: -gtk-gradient(radial,
329
center center, 0,
330
center center, 0.5,
331
to($accent_color),
332
to(transparent));
333
}
334
}
335
336
%button,
337
button {
338
@at-root %button_basic, & {
339
min-height: 24px;
340
min-width: 16px;
341
padding: ($medium_size - 24px) / 2 ($medium_size - 16px) / 2;
342
border-radius: 2px;
343
font-weight: 500;
344
345
@include button(normal);
346
347
&:hover { @include button(hover); }
348
349
&:active { @include button(active); }
350
351
&:disabled { @include button(disabled); }
352
353
&:checked { @include button(checked); }
354
355
&:checked:disabled { @include button(checked-disabled); }
356
357
@at-root %flat_button, &.flat {
358
@at-root %simple_flat_button, & {
359
@include button(flat-normal);
360
361
&:hover { @include button(flat-hover); }
362
363
&:active { @include button(flat-active); }
364
365
&:disabled { @include button(flat-disabled); }
366
}
367
368
&:checked { @include button(flat-checked); }
369
370
&:checked:disabled { @include button(flat-checked-disabled); }
371
}
372
373
&.text-button {
374
padding-left: 16px;
375
padding-right: 16px;
376
}
377
378
&.image-button {
379
min-width: 24px;
380
padding: ($medium_size - 24px) / 2;
381
border-radius: $circular_radius;
382
-gtk-outline-radius: $circular_radius;
383
}
384
385
&.text-button.image-button {
386
border-radius: 2px;
387
-gtk-outline-radius: 2px;
388
389
label {
390
&:first-child {
391
margin-left: 16px - ($medium_size - 24px) / 2;
392
margin-right: 2px;
393
}
394
395
&:last-child {
396
margin-left: 2px;
397
margin-right: 16px - ($medium_size - 24px) / 2;
398
}
399
400
&:only-child {
401
margin-left: 16px - ($medium_size - 24px) / 2;
402
margin-right: 16px - ($medium_size - 24px) / 2;
403
}
404
}
405
406
image:not(:only-child) {
407
&:first-child { margin-left: (24px - 16px) / 2; }
408
409
&:last-child { margin-right: (24px - 16px) / 2; }
410
}
411
}
412
413
.linked > & { @extend %linked; }
414
415
.linked.vertical > & { @extend %linked_vertical; }
416
417
.linked > &.flat,
418
.linked.vertical > &.flat {
419
border-radius: 2px;
420
421
&.image-button {
422
border-radius: $circular_radius;
423
-gtk-outline-radius: $circular_radius;
424
}
425
426
&.text-button.image-button {
427
border-radius: 2px;
428
-gtk-outline-radius: 2px;
429
}
430
}
431
432
&:drop(active) {
433
// box-shadow: inset 0 0 0 2px $accent_color;
434
}
435
}
436
437
@at-root %button_selected, row:selected & {
438
&:disabled { color: $disabled_secondary_inverse_fg_color; }
439
}
440
441
// big standalone buttons like in Documents pager
442
&.osd {
443
padding: ($large_size - 24px) / 2 ($large_size - 16px) / 2;
444
445
&.image-button { padding: ($large_size - 24px) / 2; }
446
447
&:disabled { opacity: 0; }
448
}
449
450
// overlay / OSD style
451
@at-root %osd_button,
452
.osd & {
453
}
454
455
// Suggested and Destructive Action buttons
456
@each $b_type, $b_color in (suggested-action, $suggested_color),
457
(destructive-action, $destructive_color) {
458
&.#{$b_type} {
459
background-color: $b_color;
460
color: $inverse_fg_color;
461
462
&:disabled { @include button(disabled, $b_color); }
463
464
&:checked { background-color: mix($inverse_fg_color, $b_color, percentage($lower_opacity)); }
465
466
&.flat {
467
background-color: transparent;
468
color: $b_color;
469
470
&:disabled { @include button(flat-disabled, $b_color); }
471
472
&:checked { background-color: $fill_color; }
473
}
474
475
.osd & {
476
}
477
}
478
}
479
480
.stack-switcher > & {
481
// to position the needs attention dot, padding is added to the button
482
// child, a label needs just lateral padding while an icon needs vertical
483
// padding added too.
484
485
outline-offset: -4px; // needs to be set or it gets overriden by GtkRadioButton outline-offset
486
487
> label {
488
padding-left: 6px; // label padding
489
padding-right: 6px; //
490
}
491
492
> image {
493
padding-left: 6px; // image padding
494
padding-right: 6px; //
495
padding-top: 3px; //
496
padding-bottom: 3px; //
497
}
498
499
&.text-button {
500
// compensate text-button paddings
501
padding-left: 16px - 6px;
502
padding-right: 16px - 6px;
503
}
504
505
&.image-button {
506
// we want image buttons to have a 1:1 aspect ratio, so compensation
507
// of the padding added to the GtkImage is needed
508
padding-left: ($medium_size - 16px) / 2 - 6px;
509
padding-right: ($medium_size - 16px) / 2 - 6px;
510
}
511
512
&.needs-attention {
513
> label,
514
> image { @extend %needs_attention; }
515
516
&:checked {
517
> label,
518
> image {
519
animation: none;
520
background-image: none;
521
}
522
}
523
}
524
}
525
526
// hide separators
527
separator {
528
min-width: 0;
529
min-height: 0;
530
background-color: transparent;
531
}
532
533
// &.font,
534
// &.file { separator { background-color: transparent; }}
535
536
// &.font { > box > box > label { font-weight: bold; }}
537
538
// inline-toolbar buttons
539
.inline-toolbar & {
540
// @extend %button_basic.flat;
541
542
&:not(.text-button) { @extend %circular_button; }
543
}
544
545
.primary-toolbar & { -gtk-icon-shadow: none; } // tango icons don't need shadows
546
547
@at-root %circular_button,
548
&.close,
549
&.circular { // The Bloody Circul Button
550
border-radius: $circular_radius;
551
-gtk-outline-radius: $circular_radius;
552
553
// label { padding: 0; }
554
}
555
556
@at-root %small_button {
557
min-height: $small_size;
558
min-width: $small_size;
559
padding: 0;
560
border-radius: $circular_radius;
561
-gtk-outline-radius: $circular_radius;
562
}
563
}
564
565
%needs_attention {
566
animation: needs_attention $longer_duration $deceleration_curve forwards;
567
background-repeat: no-repeat;
568
background-position: right 3px;
569
background-size: 6px 6px;
570
571
&:dir(rtl) { background-position: left 3px; }
572
}
573
574
// all the following is for the +|- buttons on inline toolbars, that way
575
// should really be deprecated...
576
.inline-toolbar toolbutton > button { // redefining the button look is
577
// needed since those are flat...
578
}
579
580
// More inline toolbar buttons
581
toolbar.inline-toolbar toolbutton {
582
// > button.flat { @extend %linked_middle; }
583
584
// &:first-child > button.flat { @extend %linked:first-child; }
585
586
// &:last-child > button.flat { @extend %linked:last-child; }
587
588
// &:only-child > button.flat { @extend %linked:only-child; }
589
}
590
591
%linked_middle {
592
border-radius: 0;
593
-gtk-outline-radius: 2px;
594
}
595
596
%linked {
597
@extend %linked_middle;
598
599
&:first-child {
600
border-top-left-radius: 2px;
601
border-bottom-left-radius: 2px;
602
}
603
604
&:last-child {
605
border-top-right-radius: 2px;
606
border-bottom-right-radius: 2px;
607
}
608
609
&:only-child {
610
border-radius: 2px;
611
}
612
}
613
614
%linked_vertical_middle {
615
border-radius: 0;
616
-gtk-outline-radius: 2px;
617
}
618
619
%linked_vertical{
620
@extend %linked_vertical_middle;
621
622
&:first-child {
623
border-top-left-radius: 2px;
624
border-top-right-radius: 2px;
625
}
626
627
&:last-child {
628
border-bottom-left-radius: 2px;
629
border-bottom-right-radius: 2px;
630
}
631
632
&:only-child {
633
border-radius: 2px;
634
}
635
}
636
637
/* menu buttons */
638
modelbutton.flat,
639
.menuitem.button.flat {
640
min-height: $menuitem_size;
641
padding: 0 8px;
642
border-radius: 2px;
643
color: inherit;
644
645
@extend %simple_flat_button;
646
647
&:selected { @extend %selected_items; }
648
649
check,
650
radio {
651
box-shadow: none;
652
background-image: none;
653
654
&:not(:checked):not(:indeterminate) { color: gtkalpha(currentColor, $tertiary_opacity); }
655
656
&:last-child { margin-left: -8px; margin-right: -16px; }
657
658
&:first-child { margin-left: -16px; margin-right: -8px; }
659
}
660
}
661
662
modelbutton.flat arrow {
663
background: none;
664
665
&:hover { background: none; }
666
667
&.left { -gtk-icon-source: -gtk-icontheme("pan-start-symbolic"); }
668
669
&.right { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
670
}
671
672
button.color {
673
min-height: $small_size;
674
min-width: $small_size;
675
padding: $container_padding;
676
677
colorswatch:only-child {
678
// &, overlay { border-radius: 0; }
679
}
680
}
681
682
683
/*********
684
* Links *
685
*********/
686
*:link {
687
&, &:hover, &:active { color: $link_color; }
688
689
&:visited {
690
&, &:hover, &:active { color: $visited_link_color; }
691
}
692
693
@at-root %link_selected,
694
&:selected,
695
*:selected & { color: $inverse_fg_color; }
696
}
697
698
button:link,
699
button:visited {
700
@extend *:link;
701
702
> label { text-decoration-line: underline; }
703
}
704
705
/*****************
706
* GtkSpinButton *
707
*****************/
708
spinbutton {
709
&:not(.vertical) {
710
// in this horizontal configuration, the whole spinbutton
711
// behaves as the entry, so we extend the entry styling
712
// and nuke the style on the internal entry
713
@extend %entry;
714
715
padding: 0;
716
717
%spinbutton_entry,
718
entry {
719
min-width: $large_size - 8px * 2;
720
// reset all the other props since the spinbutton node is styled here
721
margin: 0;
722
border-image: none;
723
border-radius: 0;
724
box-shadow: none;
725
background-color: transparent;
726
//
727
// This will help to simplify spinbutton's code, but unfortunatelly
728
// doesn't work properly in :dir(rtl). It needs z-index property.
729
//
730
// min-width: $large_size - 8px;
731
//
732
// $spinbuttons_width: $small_size * 2 + $container_padding * 3;
733
//
734
// &:dir(ltr) {
735
// margin-right: -$spinbuttons_width;
736
// padding-right: $spinbuttons_width;
737
// }
738
//
739
// &:dir(rtl) {
740
// margin-left: -$spinbuttons_width;
741
// padding-left: $spinbuttons_width;
742
// }
743
}
744
745
button {
746
// margin: $container_padding;
747
border: solid $container_padding transparent;
748
749
@extend %simple_flat_button;
750
751
@extend %small_button;
752
753
&.up:dir(ltr),
754
&.down:dir(rtl) { margin-left: -$container_padding / 2; }
755
756
&.up:dir(rtl),
757
&.down:dir(ltr) { margin-right: -$container_padding / 2; }
758
}
759
}
760
761
// OSD horizontal
762
.osd &:not(.vertical) {
763
button {
764
}
765
}
766
767
// Vertical
768
&.vertical {
769
// in the vertical configuration, we treat the spinbutton
770
// as a box, and tweak the style of the entry in the middle
771
// so that it's linked
772
773
// FIXME: this should not be set at all, but otherwise it gets the wrong
774
// color
775
&:disabled { color: $disabled_fg_color; }
776
777
&:drop(active) {
778
box-shadow: none;
779
}
780
781
entry {
782
min-height: $medium_size;
783
min-width: $large_size;
784
padding: 0;
785
}
786
787
button {
788
min-height: $medium_size;
789
min-width: $large_size;
790
padding: 0;
791
792
@extend %simple_flat_button;
793
794
&.up { border-radius: 2px 2px 0 0; }
795
796
&.down { border-radius: 0 0 2px 2px; }
797
}
798
}
799
800
// OSD vertical
801
.osd &.vertical button:first-child {
802
}
803
804
// Misc
805
treeview &:not(.vertical) {
806
min-height: 0;
807
border-style: none;
808
border-radius: 0;
809
810
entry {
811
min-height: 0;
812
padding: 1px 2px;
813
}
814
}
815
}
816
817
818
/**************
819
* ComboBoxes *
820
**************/
821
combobox {
822
arrow {
823
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
824
min-height: 16px;
825
min-width: 16px;
826
}
827
828
button.combo:checked { transition: none; } // workaround for menuitem selection
829
830
button.combo cellview {
831
&:dir(ltr) { margin-left: 8px - ($medium_size - 16px) / 2; }
832
&:dir(rtl) { margin-right: 8px - ($medium_size - 16px) / 2; }
833
}
834
835
#gtk-combobox-popup-menu {
836
padding: 2px 0;
837
838
menuitem {
839
min-height: $medium_size - 2px * 2;
840
padding: 0 8px;
841
}
842
}
843
844
&.linked {
845
button:nth-child(2) {
846
&:dir(ltr) { @extend %linked:last-child; }
847
&:dir(rtl) { @extend %linked:first-child; }
848
}
849
}
850
851
&:drop(active) { // FIXME: untested
852
box-shadow: none;
853
854
// button.combo { @extend %button_basic:drop(active); }
855
}
856
}
857
858
.linked > combobox > box > button.combo {
859
// the combo is a composite widget so the way we do button linking doesn't
860
// work, special case needed. See
861
// https://bugzilla.gnome.org/show_bug.cgi?id=733979
862
863
&:dir(ltr),
864
&:dir(rtl) { @extend %linked_middle; } // specificity bump
865
}
866
867
.linked:not(.vertical) > combobox:first-child > box > button.combo { @extend %linked:first-child; }
868
.linked:not(.vertical) > combobox:last-child > box > button.combo { @extend %linked:last-child; }
869
.linked:not(.vertical) > combobox:only-child > box > button.combo { @extend %linked:only-child; }
870
871
.linked.vertical > combobox > box > button.combo { @extend %linked_vertical_middle; }
872
.linked.vertical > combobox:first-child > box > button.combo { @extend %linked_vertical:first-child; }
873
.linked.vertical > combobox:last-child > box > button.combo { @extend %linked_vertical:last-child; }
874
.linked.vertical > combobox:only-child > box > button.combo { @extend %linked_vertical:only-child; }
875
876
%combo_flat {
877
border-radius: 0;
878
background-image: none;
879
font-weight: inherit;
880
881
@include entry(flat-normal);
882
883
&:hover { box-shadow: inset 0 -2px $fill_color; }
884
885
&:checked {
886
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
887
$primary_color 100%,
888
transparent 0%)
889
0 0 2 / 0 0 2px;
890
}
891
892
&:disabled { color: $disabled_fg_color; }
893
}
894
895
896
/************
897
* Toolbars *
898
************/
899
toolbar {
900
-GtkWidget-window-dragging: true;
901
padding: $container_padding / 2;
902
background-color: $bg_color;
903
904
button { @extend %button_basic.flat; }
905
906
// on OSD
907
.osd & { background-color: transparent; }
908
909
// stand-alone OSD toolbars
910
&.osd {
911
transition: $shadow_transition;
912
padding: $container_padding;
913
border-radius: 2px;
914
box-shadow: $shadow_2, inset 0 1px $highlight_color;
915
background-color: $base_color;
916
917
&:backdrop { box-shadow: $shadow_1, inset 0 1px $highlight_color; }
918
919
&.left,
920
&.right,
921
&.top,
922
&.bottom { border-radius: 0; } // positional classes for `attached` osd toolbars
923
}
924
925
// toolbar separators
926
&.horizontal separator { margin: $container_padding / 2; }
927
&.vertical separator { margin: $container_padding / 2; }
928
929
&:not(.inline-toolbar):not(.osd) {
930
scale,
931
entry,
932
spinbutton,
933
button { margin: $container_padding / 2; }
934
935
.linked entry,
936
.linked spinbutton,
937
.linked button {
938
&:not(:first-child) { margin-left: 0; }
939
&:not(:last-child) { margin-right: 0; }
940
}
941
942
switch { margin: ($container_padding / 2 + $container_padding) ($container_padding / 2); }
943
}
944
}
945
946
// searchbar, location-bar & inline-toolbar
947
.inline-toolbar {
948
padding: $container_padding;
949
border-style: solid;
950
border-width: 0 1px 1px;
951
border-color: $border_color;
952
background-color: $alt_base_color;
953
}
954
955
searchbar,
956
.location-bar {
957
padding: $container_padding;
958
border-style: solid;
959
border-width: 0 0 1px;
960
border-color: $border_color;
961
background-color: $bg_color;
962
background-clip: border-box;
963
}
964
965
966
/***************
967
* Header bars *
968
***************/
969
%titlebar,
970
headerbar {
971
transition: background-color $shorter_duration $deceleration_curve;
972
min-height: $large_size;
973
padding: 0 $container_padding;
974
box-shadow: $shadow_1, inset 0 1px $titlebar_highlight_color;
975
background-color: $titlebar_bg_color;
976
color: $titlebar_fg_color;
977
978
&:disabled :not(button) > label { color: $disabled_titlebar_fg_color; }
979
980
&:backdrop {
981
color: $secondary_titlebar_fg_color;
982
983
&:disabled :not(button) > label { color: $disabled_secondary_titlebar_fg_color; }
984
}
985
986
.title {
987
transition: $longer_transition;
988
padding: 0 12px;
989
font-weight: bold;
990
}
991
992
.subtitle {
993
transition: $longer_transition;
994
padding: 0 12px;
995
font-size: smaller;
996
997
@extend .dim-label;
998
}
999
1000
button:not(.suggested-action):not(.destructive-action) {
1001
@extend %button_basic.flat;
1002
1003
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1004
$titlebar_indicator_color 0%,
1005
transparent 0%)
1006
0 0 0 / 0 0 0px;
1007
1008
&:checked {
1009
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1010
$titlebar_indicator_color 100%,
1011
transparent 0%)
1012
0 0 2 / 0 0 2px;
1013
1014
&, &:disabled { background-color: transparent; }
1015
}
1016
}
1017
1018
button.suggested-action, button.destructive-action {
1019
&:disabled { color: gtkalpha(currentColor, $disabled_opacity); }
1020
}
1021
1022
&.selection-mode {
1023
// FIXME: 0.00001s is workaround for transition bug of gtk+ 3.22
1024
// see https://bugzilla.gnome.org/show_bug.cgi?id=774064
1025
transition: background-color 0.00001s $longer_duration;
1026
animation: header_ripple_effect $longer_duration $deceleration_curve;
1027
box-shadow: $shadow_1, inset 0 1px $alt_highlight_color;
1028
background-color: $primary_color;
1029
color: $inverse_fg_color;
1030
1031
&:backdrop {
1032
color: $secondary_inverse_fg_color;
1033
}
1034
1035
.subtitle:link { @extend *:link:selected; }
1036
1037
button:not(.suggested-action):not(.destructive-action) {
1038
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1039
currentColor 0%,
1040
transparent 0%)
1041
0 0 0 / 0 0 0px;
1042
color: currentColor;
1043
1044
&:disabled { color: gtkalpha(currentColor, $disabled_opacity); }
1045
1046
&:checked {
1047
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1048
currentColor 100%,
1049
transparent 0%)
1050
0 0 2 / 0 0 2px;
1051
color: currentColor;
1052
1053
&:disabled { color: gtkalpha(currentColor, $disabled_opacity); }
1054
}
1055
}
1056
1057
.selection-menu {
1058
padding-left: 16px;
1059
padding-right: 16px;
1060
1061
GtkArrow { -GtkArrow-arrow-scaling: 1; }
1062
1063
.arrow { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
1064
}
1065
}
1066
1067
.fullscreen &,
1068
.tiled &,
1069
.maximized & {
1070
border-radius: 0; // squared corners when the window is fullscreen, maximized or tiled
1071
box-shadow: $shadow_1;
1072
}
1073
1074
&.default-decoration {
1075
min-height: $small_size;
1076
padding: $container_padding;
1077
box-shadow: inset 0 1px $titlebar_highlight_color;
1078
1079
.fullscreen &,
1080
.tiled &,
1081
.maximized & { box-shadow: none; }
1082
1083
button.titlebutton {
1084
min-height: $small_size;
1085
min-width: $small_size;
1086
margin: 0;
1087
padding: 0;
1088
}
1089
1090
// workaround for non-animatable buttons
1091
.background:not(.csd) & button.titlebutton:active { background-size: 1000% 1000%; }
1092
}
1093
1094
.solid-csd & {
1095
&:dir(rtl), &:dir(ltr) { // specificity bump
1096
// margin-left: -2px;
1097
// margin-right: -2px;
1098
// margin-top: -2px;
1099
// border-radius: 0;
1100
// box-shadow: inset 0 1px $titlebar_highlight_color;
1101
}
1102
}
1103
}
1104
1105
headerbar {
1106
// add vertical margins to common widget on the headerbar to avoid them spanning the whole height
1107
entry,
1108
spinbutton,
1109
// separator,
1110
button {
1111
margin-top: $container_padding;
1112
margin-bottom: $container_padding;
1113
}
1114
1115
switch {
1116
margin-top: $container_padding * 2;
1117
margin-bottom: $container_padding * 2;
1118
}
1119
1120
// reset button margins of the spinbutton
1121
spinbutton button {
1122
margin-top: 0;
1123
margin-bottom: 0;
1124
}
1125
}
1126
1127
.background:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) .titlebar {
1128
border-top-left-radius: 2px;
1129
border-top-right-radius: 2px;
1130
}
1131
1132
headerbar { // headerbar border rounding
1133
window:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) separator:first-child + &, // tackles the paned container case
1134
window:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) &:first-child { border-top-left-radius: 2px; }
1135
1136
window:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) &:last-child { border-top-right-radius: 2px; }
1137
1138
window:not(.tiled):not(.maximized):not(.fullscreen):not(.solid-csd) stack & { // tackles the stacked headerbars case
1139
&:first-child, &:last-child {
1140
border-top-left-radius: 2px;
1141
border-top-right-radius: 2px;
1142
}
1143
}
1144
}
1145
1146
.titlebar:not(headerbar) {
1147
window.csd > & {
1148
// in csd we assume every titlebar is a headerbar so reset anything, this is needed for split toolbars cases
1149
padding: 0;
1150
background-color: transparent;
1151
background-image: none;
1152
border-style: none;
1153
box-shadow: none;
1154
}
1155
1156
> separator {
1157
background-color: $titlebar_bg_color;
1158
background-image: image($border_color);
1159
}
1160
1161
@extend %titlebar;
1162
}
1163
1164
1165
/************
1166
* Pathbars *
1167
************/
1168
%pathbar_button,
1169
.path-bar button {
1170
padding-left: ($medium_size - 24px) / 2;
1171
padding-right: ($medium_size - 24px) / 2;
1172
1173
label:not(:only-child) {
1174
&:first-child { margin-left: 4px; }
1175
1176
&:last-child { margin-right: 4px; }
1177
}
1178
1179
&.slider-button {
1180
padding-left: (24px - 16px) / 2;
1181
padding-right: (24px - 16px) / 2;
1182
}
1183
1184
:not(headerbar) & {
1185
@extend %flat_button;
1186
1187
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1188
$primary_color 0%,
1189
transparent 0%)
1190
0 0 0 / 0 0 0px;
1191
border-radius: 2px;
1192
1193
&:checked {
1194
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1195
$primary_color 100%,
1196
transparent 0%)
1197
0 0 2 / 0 0 2px;
1198
1199
&, &:disabled { background-color: transparent; }
1200
}
1201
}
1202
}
1203
1204
1205
/**************
1206
* Tree Views *
1207
**************/
1208
treeview.view {
1209
@at-root * {
1210
-GtkTreeView-horizontal-separator: 4;
1211
-GtkTreeView-grid-line-width: 1;
1212
-GtkTreeView-grid-line-pattern: '';
1213
-GtkTreeView-tree-line-width: 1;
1214
-GtkTreeView-tree-line-pattern: '';
1215
-GtkTreeView-expander-size: 16;
1216
}
1217
1218
border-left-color: $fill_color; // this is actually the tree lines color,
1219
border-top-color: $border_color; // while this is the grid lines color, better then nothing
1220
1221
rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props
1222
1223
&.separator {
1224
min-height: 1px + 2px * 2;
1225
color: $border_color;
1226
}
1227
1228
&:drop(active) {
1229
border-style: solid none;
1230
border-width: 1px;
1231
border-color: $accent_color;
1232
1233
&.after { border-top-style: none; }
1234
1235
&.before { border-bottom-style: none; }
1236
}
1237
1238
&.expander {
1239
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
1240
-gtk-icon-transform: rotate(-90deg);
1241
1242
&:dir(rtl) { -gtk-icon-transform: rotate(90deg); }
1243
1244
&:checked { -gtk-icon-transform: unset; }
1245
1246
color: $secondary_fg_color;
1247
1248
&:hover, &:active { color: $fg_color; }
1249
1250
&:disabled { color: $disabled_secondary_fg_color; }
1251
1252
&:selected {
1253
color: $secondary_inverse_fg_color;
1254
1255
&:hover, &:active { color: $inverse_fg_color; }
1256
1257
&:disabled { color: $disabled_secondary_inverse_fg_color; }
1258
}
1259
}
1260
1261
&.progressbar { // progress bar in treeviews
1262
border-style: none none solid;
1263
border-width: $bar_size;
1264
border-color: $primary_color;
1265
box-shadow: none;
1266
background-color: transparent;
1267
1268
&:selected { border-color: currentColor; }
1269
}
1270
1271
&.trough { // progress bar trough in treeviews
1272
border-style: none none solid;
1273
border-width: $bar_size;
1274
border-color: scale-alpha($primary_color, $lower_opacity);
1275
box-shadow: none;
1276
background-color: transparent;
1277
1278
&:selected { border-color: $fill_color; }
1279
}
1280
1281
header {
1282
button {
1283
@extend row.activatable;
1284
1285
padding: 2px 6px;
1286
border-style: none solid solid none;
1287
border-width: 1px;
1288
border-color: $border_color;
1289
border-radius: 0;
1290
background-clip: border-box;
1291
1292
&, &:hover, &:active { box-shadow: none; }
1293
1294
&, &:disabled { background-color: $base_color; }
1295
1296
&:last-child { border-right-style: none; }
1297
}
1298
}
1299
1300
button.dnd,
1301
header.button.dnd { // for treeview-like derive widgets
1302
padding: 2px 6px;
1303
border-style: none solid solid;
1304
border-width: 1px;
1305
border-color: $border_color;
1306
border-radius: 0;
1307
box-shadow: none;
1308
background-color: $base_color;
1309
background-clip: border-box;
1310
color: $primary_color;
1311
}
1312
1313
acceleditor > label { background-color: $primary_color; } // see tests/testaccel to test
1314
}
1315
1316
1317
/*********
1318
* Menus *
1319
*********/
1320
menubar,
1321
.menubar {
1322
-GtkWidget-window-dragging: true;
1323
padding: 0;
1324
// box-shadow: inset 0 -1px $border_color;
1325
background-color: $titlebar_bg_color;
1326
1327
> menuitem {
1328
transition: $shorter_transition;
1329
min-height: 20px;
1330
padding: 4px 8px;
1331
color: $secondary_titlebar_fg_color;
1332
1333
&:hover { // Seems like it :hover even with keyboard focus
1334
transition: none;
1335
background-color: $semi_fill_color;
1336
color: $titlebar_fg_color;
1337
}
1338
1339
&:disabled { color: $disabled_secondary_titlebar_fg_color; }
1340
}
1341
}
1342
1343
.csd.popup { border-radius: 2px; }
1344
1345
menu,
1346
.menu,
1347
.context-menu {
1348
margin: 4px 0;
1349
padding: 4px 0;
1350
box-shadow: inset 0 1px $highlight_color;
1351
background-color: $base_color;
1352
border: 1px solid $border_color; // adds borders in a non composited env
1353
1354
.csd & {
1355
border: none; // axes borders in a composited env
1356
border-radius: 2px;
1357
}
1358
1359
menuitem {
1360
transition: $shorter_transition;
1361
min-height: 20px;
1362
min-width: 40px;
1363
padding: 4px 8px;
1364
font: initial;
1365
text-shadow: none;
1366
1367
&:hover {
1368
transition: none;
1369
background-color: $semi_fill_color;
1370
}
1371
1372
&:disabled { color: $disabled_fg_color; }
1373
1374
// submenu indicators
1375
arrow {
1376
min-height: 16px;
1377
min-width: 16px;
1378
1379
&:dir(ltr) {
1380
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
1381
margin-left: 8px;
1382
}
1383
1384
&:dir(rtl) {
1385
-gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl');
1386
margin-right: 8px;
1387
}
1388
}
1389
1390
// avoids labels color being overridden, see
1391
// https://bugzilla.gnome.org/show_bug.cgi?id=767058
1392
label { &:dir(rtl), &:dir(ltr) { color: inherit; }}
1393
}
1394
1395
// overflow arrows
1396
> arrow {
1397
min-height: 16px;
1398
min-width: 16px;
1399
padding: 4px;
1400
border-radius: 0;
1401
background-color: $base_color;
1402
color: $secondary_fg_color;
1403
1404
&.top {
1405
margin-top: -4px;
1406
border-bottom: 1px solid $border_color;
1407
-gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
1408
}
1409
1410
&.bottom {
1411
margin-bottom: -4px;
1412
border-top: 1px solid $border_color;
1413
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
1414
}
1415
1416
&:hover {
1417
background-image: image($semi_fill_color);
1418
color: $fg_color;
1419
}
1420
1421
&:disabled {
1422
border-color: transparent;
1423
background-color: transparent;
1424
color: transparent;
1425
// color: $disabled_secondary_fg_color;
1426
}
1427
}
1428
1429
separator { margin: 4px 0; }
1430
}
1431
1432
menuitem {
1433
accelerator { color: gtkalpha(currentColor, $tertiary_opacity); }
1434
1435
check,
1436
radio {
1437
&:dir(ltr) { margin-right: -8px; margin-left: -16px; }
1438
&:dir(rtl) { margin-right: -16px; margin-left: -8px; }
1439
}
1440
}
1441
1442
// FIXME: THIS IS A REALLY UGLY WORKAROUND!
1443
// Electron/Atom render all translucent colors in opaque colors.
1444
// It's a very critical issue for this theme and should be fixed by upstream...
1445
.popup:not(.csd) menu {
1446
$opaque_fg_color: if($variant == 'light', mix($black, $base_color, percentage(0.8)), $white);
1447
$opaque_semi_fill_color: mix($opaque_fg_color, $base_color, percentage($lower_opacity / 2));
1448
$opaque_disabled_fg_color: mix($opaque_fg_color, $base_color, percentage($disabled_opacity));
1449
$opaque_tertiary_fg_color: mix($opaque_fg_color, $base_color, percentage($tertiary_opacity));
1450
1451
menuitem {
1452
color: $opaque_fg_color;
1453
1454
&:hover { background-color: $opaque_semi_fill_color; }
1455
1456
&:disabled { color: $opaque_disabled_fg_color; } // separator/border also use this color.
1457
}
1458
1459
// TODO: not working this, where/how i can set the accelerators?
1460
accelerator { color: $opaque_tertiary_fg_color; }
1461
}
1462
1463
1464
/************
1465
* Popovers *
1466
************/
1467
popover.background {
1468
transition: $shadow_transition;
1469
padding: 2px;
1470
box-shadow: $shadow_2; // TODO: this should really have a highlight
1471
background-color: $lighter_bg_color;
1472
1473
&:backdrop { box-shadow: $shadow_1; }
1474
1475
&, .csd & {
1476
border-style: solid;
1477
border-width: 1px;
1478
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.3);
1479
border-radius: 2px + 1px;
1480
}
1481
1482
> stack { margin: -4px; } // remove extra padding from menu style popovers
1483
1484
> toolbar { margin: -2px; }
1485
1486
> list,
1487
> .view,
1488
> toolbar {
1489
border-style: none;
1490
box-shadow: none;
1491
background-color: transparent;
1492
}
1493
1494
&.touch-selection,
1495
&.magnifier,
1496
&.osd { @extend %osd; }
1497
1498
// entry { @extend %entry.flat; }
1499
1500
// button.combo { @extend %combo_flat; }
1501
1502
// button:not(.suggested-action):not(.destructive-action) { @extend %button_basic.flat; }
1503
1504
&.menu button,
1505
button.model {
1506
@extend %simple_flat_button;
1507
1508
min-height: 32px;
1509
padding: 0 8px;
1510
border-radius: 2px;
1511
1512
&:checked { @extend %selected_items; }
1513
}
1514
1515
separator { margin: 4px 0; }
1516
1517
list separator { margin: 0; }
1518
}
1519
1520
/*************
1521
* Notebooks *
1522
*************/
1523
notebook {
1524
> header {
1525
border-width: 1px;
1526
border-color: $border_color;
1527
background-color: $bg_color;
1528
background-clip: border-box;
1529
1530
&.top {
1531
border-bottom-style: solid;
1532
> tabs {
1533
margin-bottom: -1px;
1534
> tab {
1535
1536
&:hover { box-shadow: inset 0 -2px $fill_color; }
1537
1538
&:checked { box-shadow: inset 0 -2px $primary_color; }
1539
}
1540
}
1541
}
1542
1543
&.bottom {
1544
border-top-style: solid;
1545
> tabs {
1546
margin-top: -1px;
1547
> tab {
1548
1549
&:hover { box-shadow: inset 0 2px $fill_color; }
1550
1551
&:checked { box-shadow: inset 0 2px $primary_color; }
1552
}
1553
}
1554
}
1555
1556
&.left {
1557
border-right-style: solid;
1558
> tabs {
1559
margin-right: -1px;
1560
> tab {
1561
1562
&:hover { box-shadow: inset -2px 0 $fill_color; }
1563
1564
&:checked { box-shadow: inset -2px 0 $primary_color; }
1565
}
1566
}
1567
}
1568
1569
&.right {
1570
border-left-style: solid;
1571
> tabs {
1572
margin-left: -1px;
1573
> tab {
1574
1575
&:hover { box-shadow: inset 2px 0 $fill_color; }
1576
1577
&:checked { box-shadow: inset 2px 0 $primary_color; }
1578
}
1579
}
1580
}
1581
1582
&.top > tabs > arrow {
1583
@extend %notebook_vert_arrows;
1584
1585
border-top-style: none;
1586
}
1587
1588
&.bottom > tabs > arrow {
1589
@extend %notebook_vert_arrows;
1590
1591
border-bottom-style: none;
1592
}
1593
1594
@at-root %notebook_vert_arrows {
1595
padding-left: 4px;
1596
padding-right: 4px;
1597
1598
&.down {
1599
margin-left: -8px;
1600
-gtk-icon-source: -gtk-icontheme('pan-start-symbolic');
1601
}
1602
1603
&.up {
1604
margin-right: -8px;
1605
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
1606
}
1607
}
1608
1609
&.left > tabs > arrow {
1610
@extend %notebook_horz_arrows;
1611
1612
border-left-style: none;
1613
}
1614
1615
&.right > tabs > arrow {
1616
@extend %notebook_horz_arrows;
1617
1618
border-right-style: none;
1619
}
1620
1621
@at-root %notebook_horz_arrows {
1622
padding-top: 4px;
1623
padding-bottom: 4px;
1624
1625
&.down {
1626
margin-top: -8px;
1627
-gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
1628
}
1629
1630
&.up {
1631
margin-bottom: -8px;
1632
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
1633
}
1634
}
1635
1636
> tabs > arrow {
1637
@extend %simple_flat_button;
1638
1639
min-height: 16px;
1640
min-width: 16px;
1641
border-radius: 0;
1642
}
1643
1644
tab {
1645
transition: $longer_transition,
1646
background-size 0,
1647
background-image 0;
1648
min-height: $small_size;
1649
min-width: $small_size;
1650
padding: $container_padding 12px;
1651
1652
outline-offset: -6px;
1653
1654
border-width: 1px; // for reorderable tabs
1655
border-color: transparent; //
1656
1657
background-image: radial-gradient(circle farthest-corner at center,
1658
$primary_color 10%,
1659
transparent 0%);
1660
background-repeat: no-repeat;
1661
background-position: center;
1662
background-size: 0% 0%;
1663
1664
color: $secondary_fg_color;
1665
font-weight: 500;
1666
1667
&:hover {
1668
color: $fg_color;
1669
1670
&.reorderable-page {
1671
border-color: $border_color;
1672
background-color: $alt_base_color;
1673
}
1674
}
1675
1676
&:disabled { color: $disabled_secondary_fg_color; }
1677
1678
&:checked {
1679
transition: $longer_transition,
1680
background-size $longer_duration $deceleration_curve,
1681
background-image $longer_duration + $ripple_duration $deceleration_curve;
1682
background-image: radial-gradient(circle farthest-corner at center,
1683
transparent 10%,
1684
transparent 0%);
1685
background-size: 1000% 1000%;
1686
color: $fg_color;
1687
1688
&:disabled { color: $disabled_fg_color; }
1689
1690
&.reorderable-page {
1691
border-color: $border_color;
1692
background-color: $base_color;
1693
}
1694
}
1695
1696
// colors the button like the label, overridden otherwise
1697
button.flat {
1698
@extend %small_button;
1699
1700
&:last-child {
1701
margin-left: $container_padding;
1702
margin-right: $container_padding - 12px;
1703
}
1704
1705
&:first-child {
1706
margin-left: $container_padding - 12px;
1707
margin-right: $container_padding;
1708
}
1709
}
1710
}
1711
1712
&.top,
1713
&.bottom {
1714
tabs {
1715
padding-left: 8px;
1716
padding-right: 8px;
1717
1718
&:not(:only-child) {
1719
&:first-child { margin-left: 0; }
1720
&:last-child { margin-right: 0; }
1721
}
1722
1723
tab {
1724
&.reorderable-page {
1725
margin: 0 -1px;
1726
border-style: none solid;
1727
}
1728
}
1729
}
1730
}
1731
1732
&.left,
1733
&.right {
1734
tabs {
1735
padding-top: 8px;
1736
padding-bottom: 8px;
1737
1738
&:not(:only-child) {
1739
&:first-child { margin-top: 0; }
1740
&:last-child { margin-bottom: 0; }
1741
}
1742
1743
tab {
1744
&.reorderable-page {
1745
margin: -1px 0;
1746
border-style: solid none;
1747
}
1748
}
1749
}
1750
}
1751
}
1752
1753
> stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks
1754
background-color: $base_color;
1755
1756
entry:not(.search),
1757
spinbutton:not(.vertical) { @extend %entry.flat; }
1758
1759
spinbutton:not(.vertical) entry { &, &:focus, &:disabled { @extend %spinbutton_entry; }}
1760
1761
button.combo { @extend %combo_flat; }
1762
}
1763
}
1764
1765
1766
/**************
1767
* Scrollbars *
1768
**************/
1769
scrollbar {
1770
$_slider_min_length: 24px;
1771
1772
// disable steppers
1773
@at-root * {
1774
-GtkScrollbar-has-backward-stepper: false;
1775
-GtkScrollbar-has-forward-stepper: false;
1776
}
1777
1778
transition: $longer_transition;
1779
background-color: $base_color;
1780
background-clip: $extra_background_clip;
1781
1782
// scrollbar border
1783
&.top { border-bottom: 1px solid $border_color; }
1784
&.bottom { border-top: 1px solid $border_color; }
1785
&.left { border-right: 1px solid $border_color; }
1786
&.right { border-left: 1px solid $border_color; }
1787
1788
// slider
1789
slider {
1790
transition: $shorter_transition, margin 0, border-width 0;
1791
min-width: 8px;
1792
min-height: 8px;
1793
border: 4px solid transparent;
1794
border-radius: $circular_radius;
1795
background-clip: padding-box;
1796
background-color: $tertiary_fg_color;
1797
1798
&:hover { background-color: $secondary_fg_color; }
1799
1800
&:active { background-color: $fg_color; }
1801
1802
&:disabled { background-color: $disabled_tertiary_fg_color; }
1803
}
1804
1805
&.fine-tune {
1806
slider {
1807
transition: $shorter_transition, margin 0, border-width 0, min-width 0, min-height 0;
1808
min-width: 4px;
1809
min-height: 4px;
1810
}
1811
1812
&.horizontal slider { margin: 2px 0; }
1813
1814
&.vertical slider { margin: 0 2px; }
1815
}
1816
1817
&.overlay-indicator {
1818
&:not(.dragging):not(.hovering) {
1819
border-color: transparent;
1820
background-color: transparent;
1821
1822
slider {
1823
min-width: 4px;
1824
min-height: 4px;
1825
margin: 4px - 1px;
1826
border: 1px solid scale-alpha($base_color, $lower_opacity);
1827
}
1828
1829
button {
1830
min-width: 4px;
1831
min-height: 4px;
1832
margin: 4px - 1px;
1833
border: 1px solid scale-alpha($base_color, $lower_opacity);
1834
border-radius: $circular_radius;
1835
background-color: $tertiary_fg_color;
1836
background-clip: padding-box;
1837
-gtk-icon-source: none;
1838
1839
&:disabled { background-color: $disabled_tertiary_fg_color; }
1840
}
1841
1842
&.horizontal {
1843
slider { min-width: $_slider_min_length; }
1844
1845
button { min-width: 8px; }
1846
}
1847
1848
&.vertical {
1849
slider { min-height: $_slider_min_length; }
1850
1851
button { min-height: 8px; }
1852
}
1853
}
1854
1855
&.dragging,
1856
&.hovering { background-color: scale-alpha($base_color, $higher_opacity); }
1857
}
1858
1859
&.horizontal slider { min-width: $_slider_min_length; }
1860
1861
&.vertical slider { min-height: $_slider_min_length; }
1862
1863
// button styling
1864
button {
1865
@extend %simple_flat_button;
1866
1867
min-width: 16px;
1868
min-height: 16px;
1869
padding: 0;
1870
border-radius: 0;
1871
}
1872
1873
// button icons
1874
&.vertical {
1875
button {
1876
&.down { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
1877
1878
&.up { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
1879
}
1880
}
1881
1882
&.horizontal {
1883
button {
1884
&.down { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); }
1885
1886
&.up { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); }
1887
}
1888
}
1889
}
1890
1891
1892
/**********
1893
* Switch *
1894
**********/
1895
switch {
1896
transition: $longer_transition;
1897
margin: $container_padding 0;
1898
border: 4px solid transparent;
1899
border-radius: $circular_radius;
1900
background-color: $fill_color;
1901
background-clip: padding-box;
1902
font-size: 0;
1903
1904
&:disabled { color: gtkalpha(currentColor, $disabled_opacity); }
1905
1906
&:checked {
1907
background-color: scale-alpha($accent_color, 0.5);
1908
1909
&:disabled {
1910
background-color: scale-alpha($accent_color, 0.5 * $disabled_opacity);
1911
color: $disabled_fg_color;
1912
}
1913
}
1914
1915
slider {
1916
@include entry(normal);
1917
1918
transition: $longer_transition, $shadow_transition, margin 0;
1919
min-width: $small_size;
1920
min-height: $small_size;
1921
margin: -4px 0 -4px -4px;
1922
border-radius: $circular_radius;
1923
-gtk-outline-radius: $circular_radius;
1924
}
1925
1926
&:hover slider { @include entry(focus); }
1927
1928
&:checked slider {
1929
transition: $longer_transition, $shadow_transition, margin 0, background-image 0, background-color 0.00001s $longer_duration;
1930
animation: needs_attention $longer_duration $deceleration_curve;
1931
margin: -4px -4px -4px 0;
1932
background-color: $accent_color;
1933
color: $inverse_fg_color;
1934
}
1935
1936
&:disabled slider { @include entry(disabled); }
1937
1938
&:checked:disabled slider { animation: none; }
1939
1940
row:selected & {
1941
}
1942
}
1943
1944
1945
/*************************
1946
* Check and Radio items *
1947
*************************/
1948
// draw regular check and radio items using our PNG assets
1949
// all assets are rendered from assets.svg. never add pngs directly
1950
1951
// selection-mode
1952
@each $s, $as in ('', '-unchecked'),
1953
(':checked', '-checked') {
1954
.view.content-view.check#{$s}:not(list) {
1955
margin: 8px;
1956
box-shadow: none;
1957
background-color: transparent;
1958
background-image: none;
1959
-gtk-icon-source: -gtk-scaled(url("assets/selectionmode-checkbox#{$as}#{$asset_suffix}.png"),
1960
url("assets/selectionmode-checkbox#{$as}#{$asset_suffix}@2.png"));
1961
-gtk-icon-shadow: $shadow_1;
1962
1963
&:hover, &:active { -gtk-icon-shadow: $shadow_2; }
1964
}
1965
}
1966
1967
checkbutton.text-button,
1968
radiobutton.text-button {
1969
// this is for a nice focus on check and radios text
1970
padding: 2px;
1971
outline-offset: 0;
1972
1973
label:not(:only-child) { margin: 0 4px; }
1974
}
1975
1976
check,
1977
radio {
1978
min-height: 24px;
1979
min-width: 24px;
1980
margin: -($large_size - 24px) / 2;
1981
padding: ($large_size - 24px) / 2;
1982
1983
@extend %simple_flat_button;
1984
1985
@extend %circular_button;
1986
1987
&:checked, &:indeterminate {
1988
color: $accent_color;
1989
1990
&:disabled { color: scale-alpha($accent_color, $disabled_opacity); }
1991
}
1992
1993
// &:only-child { margin: -12px; }
1994
1995
row &:not(:checked):not(:indeterminate) {
1996
color: gtkalpha(currentColor, $secondary_opacity);
1997
1998
&:hover, &:active { color: currentColor; }
1999
2000
&:disabled { color: gtkalpha(currentColor, $secondary_opacity * $disabled_opacity); }
2001
}
2002
2003
menu menuitem & {
2004
transition: none;
2005
margin: -16px; // this is a workaround for a menu check/radio size allocation issue
2006
2007
&:not(:checked):not(:indeterminate) { color: gtkalpha(currentColor, $tertiary_opacity); }
2008
2009
&, &:hover, &:disabled {
2010
box-shadow: none;
2011
// color: inherit;
2012
}
2013
}
2014
}
2015
2016
%check,
2017
check {
2018
& { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/checkbox-unchecked-symbolic.svg")),
2019
-gtk-recolor(url("assets/scalable/checkbox-unchecked-symbolic.symbolic.png"))); }
2020
2021
&:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/checkbox-checked-symbolic.svg")),
2022
-gtk-recolor(url("assets/scalable/checkbox-checked-symbolic.symbolic.png"))); }
2023
2024
&:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/checkbox-mixed-symbolic.svg")),
2025
-gtk-recolor(url("assets/scalable/checkbox-mixed-symbolic.symbolic.png"))); }
2026
}
2027
2028
%radio,
2029
radio {
2030
& { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/radio-unchecked-symbolic.svg")),
2031
-gtk-recolor(url("assets/scalable/radio-unchecked-symbolic.symbolic.png"))); }
2032
2033
// &:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/radio-checked-symbolic.svg")),
2034
// -gtk-recolor(url("assets/scalable/radio-checked-symbolic.symbolic.png"))); }
2035
2036
&:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/radio-mixed-symbolic.svg")),
2037
-gtk-recolor(url("assets/scalable/radio-mixed-symbolic.symbolic.png"))); }
2038
2039
border-image-slice: $large_size / 2px;
2040
border-image-width: $large_size / 2;
2041
2042
$radio_indicator: 10px / $large_size / 2;
2043
2044
& {
2045
border-image-source: -gtk-gradient(radial,
2046
center center, 0,
2047
center center, 0.001,
2048
to($accent_color),
2049
to(transparent));
2050
}
2051
2052
&:checked:not(:indeterminate) {
2053
border-image-source: -gtk-gradient(radial,
2054
center center, 0,
2055
center center, $radio_indicator,
2056
to($accent_color),
2057
to(transparent));
2058
}
2059
2060
&:checked:not(:indeterminate):disabled {
2061
border-image-source: -gtk-gradient(radial,
2062
center center, 0,
2063
center center, $radio_indicator,
2064
to(scale-alpha($accent_color, $disabled_opacity)),
2065
to(transparent));
2066
}
2067
}
2068
2069
// ANIMATION:
2070
// this is made with those pretty convoluted transitions, since checks and radios have to animate only on state changes,
2071
// the transformation is set on the active state and it get reset on the checked state.
2072
check:not(:checked):active { -gtk-icon-transform: rotate(90deg); }
2073
2074
// radio:not(:checked):active { -gtk-icon-transform: scale(0); }
2075
2076
check:not(:checked):indeterminate:active,
2077
radio:not(:checked):indeterminate:active { -gtk-icon-transform: scaleX(-1); } // instead of rotateY(180deg)
2078
2079
check:not(:checked),
2080
radio:not(:checked) {
2081
& {
2082
transition: $longer_transition,
2083
background-size $ripple_duration $deceleration_curve,
2084
background-image $ripple_duration * 2 $deceleration_curve,
2085
-gtk-icon-transform 0;
2086
}
2087
2088
&:active {
2089
transition: $longer_transition,
2090
background-size 0,
2091
background-image 0,
2092
-gtk-icon-transform 0;
2093
}
2094
}
2095
2096
menu menuitem {
2097
check,
2098
radio {
2099
&:checked, &:indeterminate { transition: none; }
2100
}
2101
}
2102
2103
treeview.view check,
2104
treeview.view radio {
2105
padding: 0;
2106
2107
&:hover {
2108
box-shadow: inset 0 0 0 9999px gtkalpha($fg_color, 0.05);
2109
2110
&:disabled { box-shadow: none; }
2111
2112
&:selected { box-shadow: inset 0 0 0 9999px gtkalpha($inverse_fg_color, 0.05); }
2113
}
2114
2115
& {
2116
color: $secondary_fg_color;
2117
2118
&:hover, &:active { color: $fg_color; }
2119
2120
&:disabled { color: $disabled_secondary_fg_color; }
2121
2122
&:checked, &:indeterminate { color: $accent_color; }
2123
2124
&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_color, $disabled_opacity); }
2125
}
2126
2127
&:selected {
2128
color: $secondary_inverse_fg_color;
2129
2130
&:hover, &:active { color: $inverse_fg_color; }
2131
2132
&:disabled { color: $disabled_secondary_inverse_fg_color; }
2133
2134
&:checked, &:indeterminate { color: $accent_color; }
2135
2136
&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_color, $disabled_opacity); }
2137
}
2138
}
2139
2140
treeview.view radio:checked {
2141
-gtk-icon-source: image(-gtk-recolor(url("assets/scalable/radio-checked-symbolic.svg")),
2142
-gtk-recolor(url("assets/scalable/radio-checked-symbolic.symbolic.png")));
2143
border-image: none;
2144
}
2145
2146
2147
/************
2148
* GtkScale *
2149
************/
2150
scale {
2151
// sizing
2152
$_marks_lenght: 8px;
2153
$_marks_distance: 8px;
2154
2155
$slider_size: 24px;
2156
$marks_slider_size: 30px;
2157
2158
$slider_margin: -($slider_size - $bar_size) / 2;
2159
$marks_slider_margin: -($marks_slider_size - $bar_size) - $slider_margin;
2160
2161
$color_slider_margin: -($slider_size) / 2;
2162
$color_marks_slider_margin: -($marks_slider_size - 16px) - $color_slider_margin;
2163
2164
min-height: $medium_size - $slider_size;
2165
min-width: $medium_size - $slider_size;
2166
padding: ($slider_size / 2);
2167
2168
* { transition: $longer_transition; }
2169
2170
// the slider is inside the trough, so to have make it bigger there's a negative margin
2171
slider {
2172
min-height: $slider_size;
2173
min-width: $slider_size;
2174
margin: $slider_margin;
2175
}
2176
2177
// the backing bit
2178
trough {
2179
outline-offset: 2px;
2180
background-color: $fill_color;
2181
2182
&:disabled { color: $disabled_fg_color; }
2183
}
2184
2185
// the colored part of the backing bit
2186
highlight {
2187
background-color: $accent_color;
2188
2189
&:disabled { background-color: transparent; }
2190
}
2191
2192
// this is another differently styled part of the backing bit, the most relevant use case is for example
2193
// in media player to indicate how much video stream as been cached
2194
fill {
2195
background-color: $fill_color;
2196
2197
&:disabled { background-color: transparent; }
2198
}
2199
2200
slider {
2201
transition: all $shorter_duration $standard_curve;
2202
// border-radius: 100%;
2203
// background-color: $accent_color;
2204
background-repeat: no-repeat;
2205
background-position: center;
2206
2207
@each $s, $as in ('', ''),
2208
(':disabled', '-disabled') {
2209
&#{$s} {
2210
$_url: 'assets/scale-slider#{$as}#{$asset_suffix}';
2211
2212
background-image: -gtk-scaled(url('#{$_url}.png'), url('#{$_url}@2.png'));
2213
}
2214
}
2215
2216
background-size: calc(100% - 8px);
2217
2218
&:hover { background-size: calc(100% - 4px); }
2219
2220
&:active { background-size: calc(100% - 0px); }
2221
}
2222
2223
// click-and-hold the slider to activate
2224
&.fine-tune {
2225
// to make the slider shrink in fine-tune mode
2226
slider { background-size: calc(100% - 12px); }
2227
}
2228
2229
value { color: gtkalpha(currentColor, $tertiary_opacity); }
2230
2231
marks {
2232
color: $fill_color;
2233
2234
@each $marks_class, $marks_pos, $marks_margin in (top, top, bottom),
2235
(bottom, bottom, top),
2236
(top, left, right),
2237
(bottom, right, left) {
2238
&.#{$marks_class} {
2239
margin-#{$marks_margin}: $_marks_distance;
2240
margin-#{$marks_pos}: -($_marks_distance + $_marks_lenght);
2241
}
2242
}
2243
}
2244
2245
&.horizontal {
2246
indicator {
2247
min-height: $_marks_lenght;
2248
min-width: 1px;
2249
}
2250
}
2251
2252
&.vertical {
2253
indicator {
2254
min-height: 1px;
2255
min-width: $_marks_lenght;
2256
}
2257
}
2258
2259
// *WARNING* scale with marks madness following
2260
2261
@each $dir_class, $dir_infix in ('horizontal', 'horz'),
2262
('vertical', 'vert') {
2263
@each $marks_infix, $marks_class in ('marks-before', 'marks-before:not(.marks-after)'),
2264
('marks-after', 'marks-after:not(.marks-before)') {
2265
&.#{$dir_class}.#{$marks_class} {
2266
slider {
2267
@each $state, $state_infix in ('', ''),
2268
(':disabled', '-disabled') {
2269
&#{$state} {
2270
$_scale_asset: 'assets/scale-#{$dir_infix}-#{$marks_infix}-slider#{$state_infix}#{$asset_suffix}';
2271
2272
background-image: -gtk-scaled(url('#{$_scale_asset}.png'), url('#{$_scale_asset}@2.png'));
2273
}
2274
}
2275
2276
@if $dir_class == 'horizontal' {
2277
min-height: $marks_slider_size;
2278
min-width: $slider_size;
2279
2280
@if $marks_infix == 'marks-before' {
2281
margin-top: $marks_slider_margin;
2282
2283
background-position: center calc(100% - 4px);
2284
2285
&:hover { background-position: center calc(100% - 2px); }
2286
2287
&:active { background-position: center calc(100% - 0px); }
2288
}
2289
2290
@if $marks_infix == 'marks-after' {
2291
margin-bottom: $marks_slider_margin;
2292
2293
background-position: center calc(4px);
2294
2295
&:hover { background-position: center calc(2px); }
2296
2297
&:active { background-position: center calc(0px); }
2298
}
2299
}
2300
2301
@if $dir_class == 'vertical' {
2302
min-height: $slider_size;
2303
min-width: $marks_slider_size;
2304
2305
@if $marks_infix == 'marks-before' {
2306
margin-left: $marks_slider_margin;
2307
2308
background-position: calc(4px) center;
2309
2310
&:hover { background-position: calc(2px) center; }
2311
2312
&:active { background-position: calc(0px) center; }
2313
}
2314
2315
@if $marks_infix == 'marks-after' {
2316
margin-right: $marks_slider_margin;
2317
2318
background-position: calc(100% - 4px) center;
2319
2320
&:hover { background-position: calc(100% - 2px) center; }
2321
2322
&:active { background-position: calc(100% - 0px) center; }
2323
}
2324
}
2325
}
2326
2327
&.fine-tune slider {
2328
@if $dir_class == 'horizontal' {
2329
@if $marks_infix == 'marks-before' { background-position: center calc(100% - 6px); }
2330
2331
@if $marks_infix == 'marks-after' { background-position: center calc(6px); }
2332
}
2333
2334
@if $dir_class == 'vertical' {
2335
@if $marks_infix == 'marks-before' { background-position: calc(6px) center; }
2336
2337
@if $marks_infix == 'marks-after' { background-position: calc(100% - 6px) center; }
2338
}
2339
}
2340
}
2341
}
2342
}
2343
2344
&.color {
2345
min-height: 0;
2346
min-width: 0;
2347
2348
&.horizontal {
2349
padding: 0 0 12px 0;
2350
2351
slider {
2352
&:dir(ltr), &:dir(rtl) { // specificity bump
2353
margin-bottom: $color_slider_margin;
2354
margin-top: $color_marks_slider_margin;
2355
}
2356
}
2357
}
2358
2359
&.vertical {
2360
&:dir(ltr) {
2361
padding: 0 0 0 12px;
2362
2363
slider {
2364
margin-left: $color_slider_margin;
2365
margin-right: $color_marks_slider_margin;
2366
}
2367
}
2368
2369
&:dir(rtl) {
2370
padding: 0 12px 0 0;
2371
2372
slider {
2373
margin-right: $color_slider_margin;
2374
margin-left: $color_marks_slider_margin;
2375
}
2376
}
2377
}
2378
}
2379
}
2380
2381
2382
/*****************
2383
* Progress bars *
2384
*****************/
2385
progressbar {
2386
// sizing
2387
&.horizontal {
2388
trough,
2389
progress { min-height: $bar_size; }
2390
}
2391
2392
&.vertical {
2393
trough,
2394
progress { min-width: $bar_size; }
2395
}
2396
2397
// FIXME: insensitive state missing and some other state should be set probably
2398
color: $tertiary_fg_color;
2399
font-size: smaller;
2400
2401
trough { background-color: scale-alpha($primary_color, $lower_opacity); }
2402
2403
progress { background-color: $primary_color; }
2404
2405
&.osd { // progressbar.osd used for epiphany page loading progress
2406
// min-width: $bar_size;
2407
// min-height: $bar_size;
2408
// background-color: transparent;
2409
2410
// trough { background-color: transparent; }
2411
2412
progress {
2413
}
2414
}
2415
2416
trough.empty progress { all: unset; } // makes the progress indicator disappear, when the fraction is 0
2417
}
2418
2419
2420
/*************
2421
* Level Bar *
2422
*************/
2423
levelbar {
2424
block {
2425
min-width: $medium_size;
2426
min-height: $bar_size;
2427
}
2428
2429
&.vertical block {
2430
min-width: $bar_size;
2431
min-height: $medium_size;
2432
}
2433
2434
trough {
2435
padding: 2px;
2436
border-radius: 2px;
2437
2438
@include entry(normal);
2439
2440
&:disabled { @include entry(disabled); }
2441
}
2442
2443
&.horizontal.discrete block { margin: 0 1px; }
2444
2445
&.vertical.discrete block { margin: 1px 0; }
2446
2447
&.horizontal.discrete trough { padding: 2px 1px; }
2448
2449
&.vertical.discrete trough { padding: 1px 2px; }
2450
2451
block {
2452
&.low {
2453
background-color: $warning_color;
2454
}
2455
2456
&.high,
2457
&:not(.empty) {
2458
background-color: $primary_color;
2459
}
2460
2461
&.full {
2462
background-color: $success_color;
2463
}
2464
2465
&.empty {
2466
background-color: $fill_color;
2467
color: $disabled_fg_color;
2468
}
2469
}
2470
}
2471
2472
2473
/****************
2474
* Print dialog *
2475
*****************/
2476
printdialog {
2477
paper {
2478
padding: 0;
2479
border: 1px solid $border_color;
2480
background-color: $base_color;
2481
color: $fg_color;
2482
}
2483
2484
.dialog-action-box { margin: 12px; }
2485
}
2486
2487
2488
/**********
2489
* Frames *
2490
**********/
2491
frame > border,
2492
.frame {
2493
margin: 0;
2494
padding: 0;
2495
border: 1px solid $border_color;
2496
border-radius: 0;
2497
box-shadow: none;
2498
2499
&.flat { border-style: none; }
2500
}
2501
2502
frame.flat > border { @extend .frame.flat; } // for backporting
2503
2504
actionbar > revealer > box {
2505
padding: $container_padding;
2506
border-top: 1px solid $border_color;
2507
2508
button:not(.suggested-action):not(.destructive-action):not(.server-list-button) { @extend %button_basic.flat; }
2509
}
2510
2511
scrolledwindow {
2512
viewport.frame { // avoid double borders when viewport inside scrolled window
2513
border-style: none;
2514
}
2515
2516
// This is used when content is touch-dragged past boundaries.
2517
// draws a box on top of the content, the size changes programmatically.
2518
@at-root overshoot {
2519
&.top { @include overshoot(top); }
2520
2521
&.bottom { @include overshoot(bottom); }
2522
2523
&.left { @include overshoot(left); }
2524
2525
&.right { @include overshoot(right); }
2526
}
2527
2528
// Overflow indication, works similarly to the overshoot, the size if fixed tho.
2529
@at-root undershoot {
2530
&.top { @include undershoot(top); }
2531
2532
&.bottom { @include undershoot(bottom); }
2533
2534
&.left { @include undershoot(left); }
2535
2536
&.right { @include undershoot(right); }
2537
}
2538
2539
@at-root junction { // the small square between two scrollbars
2540
border-style: solid none none solid;
2541
border-width: 1px;
2542
border-color: $border_color;
2543
background-color: $base_color;
2544
2545
&:dir(rtl) { border-style: solid solid none none; }
2546
}
2547
}
2548
2549
// vbox and hbox separators
2550
separator {
2551
min-width: 1px;
2552
min-height: 1px;
2553
background-color: $border_color;
2554
}
2555
2556
2557
/*********
2558
* Lists *
2559
*********/
2560
list {
2561
border-color: $border_color;
2562
background-color: $base_color;
2563
2564
row { padding: 2px; }
2565
}
2566
2567
// FIXME
2568
$row_transition: $longer_transition, background-color 0, color 0;
2569
2570
row {
2571
&.activatable {
2572
transition: $row_transition,
2573
background-size $ripple_duration $deceleration_curve,
2574
background-image $ripple_duration * 2 $deceleration_curve;
2575
box-shadow: inset 0 0 0 9999px transparent;
2576
background-image: radial-gradient(circle farthest-corner at center,
2577
transparent 10%,
2578
transparent 0%);
2579
background-repeat: no-repeat;
2580
background-position: center;
2581
background-size: 1000% 1000%;
2582
2583
&:hover {
2584
transition: $row_transition,
2585
box-shadow 0,
2586
background-size $ripple_duration $deceleration_curve,
2587
background-image $ripple_duration * 2 $deceleration_curve;
2588
box-shadow: inset 0 0 0 9999px $row_fill_color;
2589
}
2590
2591
&.has-open-popup, // this is for indicathing which row generated a popover see https://bugzilla.gnome.org/show_bug.cgi?id=754411
2592
&:active {
2593
transition: $row_transition,
2594
background-size 0,
2595
background-image 0;
2596
animation: ripple_effect $longer_duration $deceleration_curve forwards;
2597
box-shadow: inset 0 0 0 9999px $semi_fill_color;
2598
background-image: radial-gradient(circle farthest-corner at center,
2599
$semi_fill_color 10%,
2600
transparent 0%);
2601
background-size: 0% 0%;
2602
}
2603
}
2604
2605
&:selected { @extend %selected_items; }
2606
}
2607
2608
2609
/*********************
2610
* App Notifications *
2611
*********************/
2612
.app-notification {
2613
@extend %osd;
2614
2615
@extend toolbar.osd;
2616
2617
margin: 8px;
2618
2619
button { @extend %button_basic.flat; }
2620
2621
&.frame,
2622
border { border-style: none; }
2623
}
2624
2625
2626
/*************
2627
* Expanders *
2628
*************/
2629
expander {
2630
arrow {
2631
transition: all $shorter_duration $standard_curve;
2632
min-width: 16px;
2633
min-height: 16px;
2634
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
2635
-gtk-icon-transform: rotate(-90deg);
2636
2637
&:dir(rtl) { -gtk-icon-transform: rotate(90deg); }
2638
2639
&:checked { -gtk-icon-transform: unset; }
2640
2641
color: $secondary_fg_color;
2642
2643
&:hover, &:active { color: $fg_color; }
2644
2645
&:disabled { color: $disabled_secondary_fg_color; }
2646
2647
&:selected {
2648
color: $secondary_inverse_fg_color;
2649
2650
&:hover, &:active { color: $inverse_fg_color; }
2651
2652
&:disabled { color: $disabled_secondary_inverse_fg_color; }
2653
}
2654
}
2655
}
2656
2657
2658
/************
2659
* Calendar *
2660
***********/
2661
calendar {
2662
padding: 1px;
2663
border: 1px solid $border_color;
2664
color: $fg_color;
2665
2666
&:disabled { color: $disabled_fg_color; }
2667
2668
&:selected {
2669
@extend %selected_items;
2670
2671
border-radius: 2px + 1px;
2672
}
2673
2674
&.header {
2675
border-style: none none solid;
2676
border-radius: 0;
2677
}
2678
2679
&.button { @extend %simple_flat_button; }
2680
2681
&.highlight {
2682
color: gtkalpha(currentColor, $tertiary_opacity);
2683
font-weight: 500;
2684
}
2685
2686
&:indeterminate { color: gtkalpha(currentColor, $disabled_opacity); }
2687
}
2688
2689
2690
/***********
2691
* Dialogs *
2692
***********/
2693
messagedialog { // Message Dialog styling
2694
&.background { background-color: $lighter_bg_color; }
2695
2696
.titlebar {
2697
min-height: $small_size;
2698
border-style: none;
2699
box-shadow: inset 0 1px $highlight_color;
2700
background-color: $lighter_bg_color;
2701
color: $fg_color;
2702
2703
&:backdrop { color: $secondary_fg_color; }
2704
}
2705
2706
&.csd { // rounded bottom border styling for csd version
2707
&.background {
2708
// bigger radius for better antialiasing
2709
border-bottom-left-radius: 2px;
2710
border-bottom-right-radius: 2px;
2711
}
2712
2713
.dialog-action-area button {
2714
padding: 8px 16px;
2715
border-top: 1px solid $border_color;
2716
border-radius: 0;
2717
2718
@extend %simple_flat_button;
2719
2720
&:first-child { border-bottom-left-radius: 2px; }
2721
2722
&:last-child { border-bottom-right-radius: 2px; }
2723
}
2724
}
2725
}
2726
2727
filechooser {
2728
.dialog-action-box { border-top: 1px solid $border_color; }
2729
2730
#pathbarbox {
2731
border-bottom: 1px solid $border_color;
2732
background-color: $bg_color;
2733
}
2734
}
2735
2736
filechooserbutton:drop(active) {
2737
box-shadow: none;
2738
}
2739
2740
2741
/***********
2742
* Sidebar *
2743
***********/
2744
.sidebar {
2745
border-style: none;
2746
background-color: $lighter_bg_color;
2747
2748
@at-root %sidebar_left,
2749
&:dir(ltr),
2750
&.left,
2751
&.left:dir(rtl) {
2752
border-right: 1px solid $border_color;
2753
border-left-style: none;
2754
}
2755
2756
@at-root %sidebar_right,
2757
&:dir(rtl),
2758
&.right {
2759
border-left: 1px solid $border_color;
2760
border-right-style: none;
2761
}
2762
2763
list { background-color: transparent; }
2764
2765
paned & { &.left, &.right, &.left:dir(rtl), &:dir(rtl), &:dir(ltr), & { border-style: none; }}
2766
}
2767
2768
stacksidebar {
2769
&.sidebar {
2770
&:dir(ltr),
2771
&.left,
2772
&.left:dir(rtl) { list { @extend %sidebar_left; }}
2773
2774
&:dir(rtl),
2775
&.right { list { @extend %sidebar_right; }}
2776
}
2777
2778
row {
2779
padding: 10px 4px;
2780
2781
> label {
2782
padding-left: 6px;
2783
padding-right: 6px;
2784
}
2785
2786
&.needs-attention > label { @extend %needs_attention; }
2787
}
2788
}
2789
2790
2791
/****************
2792
* File chooser *
2793
****************/
2794
placessidebar {
2795
> viewport.frame { border-style: none; }
2796
2797
list { padding: (4px - 3px) 0 4px; }
2798
2799
row {
2800
// Needs overriding of the GtkListBoxRow padding
2801
min-height: 32px;
2802
margin: -1px 0; // Remove unknown margins
2803
padding: 0;
2804
2805
// Using margins/padding directly in the SidebarRow
2806
// will make the animation of the new bookmark row jump
2807
> revealer { padding: 0 12px; }
2808
2809
&:selected { color: $inverse_fg_color; }
2810
2811
&:disabled { color: $disabled_fg_color; }
2812
2813
image.sidebar-icon {
2814
opacity: $tertiary_opacity; // dim the device icons
2815
2816
&:dir(ltr) { padding-right: 8px; }
2817
&:dir(rtl) { padding-left: 8px; }
2818
}
2819
2820
label.sidebar-label {
2821
&:dir(ltr) { padding-right: 2px; }
2822
&:dir(rtl) { padding-left: 2px; }
2823
}
2824
2825
@at-root button.sidebar-button {
2826
@extend %simple_flat_button;
2827
2828
@extend %small_button;
2829
2830
row:selected & {
2831
}
2832
}
2833
2834
&.sidebar-placeholder-row {
2835
min-height: 2px;
2836
padding: 0 8px;
2837
background-image: image($accent_color);
2838
background-clip: content-box;
2839
}
2840
2841
&.sidebar-new-bookmark-row { color: $accent_color; }
2842
2843
&:drop(active):not(:disabled) {
2844
box-shadow: inset 0 0 0 2px $accent_color;
2845
2846
&:selected {
2847
// background-color: $accent_color;
2848
// color: $inverse_fg_color;
2849
}
2850
}
2851
}
2852
}
2853
2854
placesview {
2855
.server-list-button > image { -gtk-icon-transform: rotate(0turn); }
2856
2857
.server-list-button:checked > image { -gtk-icon-transform: rotate(-0.5turn); }
2858
2859
// this selects the "connect to server" label
2860
> actionbar > revealer > box > label {
2861
padding-left: 8px;
2862
padding-right: 8px;
2863
}
2864
}
2865
2866
2867
/*********
2868
* Paned *
2869
*********/
2870
paned {
2871
> separator {
2872
min-width: 1px;
2873
min-height: 1px;
2874
-gtk-icon-source: none; // defeats the ugly default handle decoration
2875
border-style: none; // just to be sure
2876
background-color: transparent;
2877
// workaround, using background istead of a border since the border will get rendered twice (?)
2878
background-image: image($border_color);
2879
background-size: 1px 1px;
2880
background-clip: content-box; // avoids borders image being rendered twice (?)
2881
2882
&.wide {
2883
min-width: 6px;
2884
min-height: 6px;
2885
background-color: $bg_color;
2886
background-image: image($border_color), image($border_color);
2887
background-size: 1px 1px, 1px 1px;
2888
}
2889
}
2890
2891
&.horizontal > separator {
2892
background-repeat: repeat-y;
2893
2894
&:dir(ltr) {
2895
margin: 0 -8px 0 0;
2896
padding: 0 8px 0 0;
2897
background-position: left;
2898
}
2899
2900
&:dir(rtl) {
2901
margin: 0 0 0 -8px;
2902
padding: 0 0 0 8px;
2903
background-position: right;
2904
}
2905
2906
&.wide {
2907
margin: 0;
2908
padding: 0;
2909
background-repeat: repeat-y, repeat-y;
2910
background-position: left, right;
2911
}
2912
}
2913
2914
&.vertical > separator {
2915
margin: 0 0 -8px 0;
2916
padding: 0 0 8px 0;
2917
background-repeat: repeat-x;
2918
background-position: top;
2919
2920
&.wide {
2921
margin: 0;
2922
padding: 0;
2923
background-repeat: repeat-x, repeat-x;
2924
background-position: bottom, top;
2925
}
2926
}
2927
}
2928
2929
2930
/**************
2931
* GtkInfoBar *
2932
**************/
2933
infobar {
2934
border-style: none;
2935
2936
&.info { background-color: $info_bg_color; }
2937
2938
&.question { background-color: $question_bg_color; }
2939
2940
&.warning { background-color: $warning_bg_color; }
2941
2942
&.error { background-color: $error_bg_color; }
2943
2944
&.info,
2945
&.question,
2946
&.warning,
2947
&.error {
2948
> label, & { color: $inverse_fg_color; }
2949
2950
button { @extend %button_selected; }
2951
2952
selection {}
2953
2954
*:link { @extend %link_selected; }
2955
}
2956
}
2957
2958
2959
/************
2960
* Tooltips *
2961
************/
2962
tooltip {
2963
&.background {
2964
// background-color needs to be set this way otherwise it gets drawn twice
2965
// see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details.
2966
box-shadow: inset 0 1px $highlight_color;
2967
background-color: scale-alpha($base_color, $higher_opacity);
2968
}
2969
2970
// @extend %osd;
2971
2972
// padding: 4px; /* not working */
2973
border-radius: 2px;
2974
box-shadow: none; // otherwise it gets inherited by windowframe.csd
2975
2976
&:not(.csd) {
2977
border: 1px solid $border_color;
2978
border-radius: 2px + 1px;
2979
background-clip: $extra_background_clip;
2980
}
2981
2982
// FIXME: we need a border or tooltips vanish on black background.
2983
decoration { background-color: transparent; }
2984
2985
label {
2986
// tooltip label has already 6px margins
2987
min-height: 32px - 6px * 2;
2988
padding: 0 8px - 6px;
2989
}
2990
2991
* {
2992
// workaround for Eclipse.
2993
// do not include any declaration here.
2994
// padding: 0;
2995
// background-color: transparent;
2996
// color: inherit;
2997
}
2998
}
2999
3000
3001
/*****************
3002
* Color Chooser *
3003
*****************/
3004
colorswatch {
3005
// This widget is made of two boxes one on top of the other, the lower box is colorswatch {} the other one
3006
// is colorswatch overlay {}, colorswatch has the programmatically set background, so most of the style is
3007
// applied to the overlay box.
3008
3009
// base color corners rounding
3010
// to avoid the artifacts caused by rounded corner anti-aliasing the base color
3011
// sports a bigger radius.
3012
// nth-child is needed by the custom color strip.
3013
3014
&.top {
3015
border-top-left-radius: $material_radius + 0.5px;
3016
border-top-right-radius: $material_radius + 0.5px;
3017
3018
overlay {
3019
border-top-left-radius: $material_radius;
3020
border-top-right-radius: $material_radius;
3021
}
3022
}
3023
3024
&.bottom {
3025
border-bottom-left-radius: $material_radius + 0.5px;
3026
border-bottom-right-radius: $material_radius + 0.5px;
3027
3028
overlay {
3029
border-bottom-left-radius: $material_radius;
3030
border-bottom-right-radius: $material_radius;
3031
}
3032
}
3033
3034
&.left,
3035
&:first-child:not(.top) {
3036
border-top-left-radius: $material_radius + 0.5px;
3037
border-bottom-left-radius: $material_radius + 0.5px;
3038
3039
overlay {
3040
border-top-left-radius: $material_radius;
3041
border-bottom-left-radius: $material_radius;
3042
}
3043
}
3044
3045
&.right,
3046
&:last-child:not(.bottom) {
3047
border-top-right-radius: $material_radius + 0.5px;
3048
border-bottom-right-radius: $material_radius + 0.5px;
3049
3050
overlay {
3051
border-top-right-radius: $material_radius;
3052
border-bottom-right-radius: $material_radius;
3053
}
3054
}
3055
3056
&.dark overlay { color: $light_fg_color; }
3057
3058
&.light overlay { color: $dark_fg_color; }
3059
3060
&.dark { color: $light_fg_color; } // for focus ring
3061
3062
&.light { color: $dark_fg_color; } // for focus ring
3063
3064
&:drop(active) {
3065
box-shadow: none;
3066
3067
&.light overlay {
3068
box-shadow: $shadow_1, 0 0 0 2px $accent_color;
3069
}
3070
3071
&.dark overlay {
3072
box-shadow: $shadow_1, 0 0 0 2px $accent_color;
3073
}
3074
}
3075
3076
overlay {
3077
transition: $shadow_transition;
3078
box-shadow: $shadow_1;
3079
3080
&:hover { box-shadow: $shadow_2; }
3081
}
3082
3083
&#add-color-button {
3084
border-radius: $material_radius $material_radius 0 0;
3085
color: $light_fg_color; // for focus ring
3086
3087
&:only-child { border-radius: $material_radius; }
3088
3089
overlay {
3090
background-image: linear-gradient(to right,
3091
$error_bg_color 25%,
3092
$warning_bg_color 25%, $warning_bg_color 50%,
3093
$info_bg_color 50%, $info_bg_color 75%,
3094
$question_bg_color 75%);
3095
color: $light_fg_color;
3096
}
3097
}
3098
3099
&:disabled {
3100
opacity: $disabled_opacity;
3101
3102
overlay { box-shadow: none; }
3103
}
3104
3105
row:selected & {
3106
}
3107
3108
&#editor-color-sample {
3109
border-radius: $material_radius + 0.5px;
3110
3111
overlay { border-radius: $material_radius; }
3112
3113
// overlay:hover { box-shadow: $shadow_1; }
3114
}
3115
}
3116
3117
// colorscale popup
3118
colorchooser .popover.osd {
3119
transition: $shadow_transition;
3120
border-radius: 2px;
3121
box-shadow: $shadow_2, inset 0 1px $highlight_color;
3122
background-color: $base_color;
3123
3124
&:backdrop { box-shadow: $shadow_1, inset 0 1px $highlight_color; }
3125
3126
spinbutton:not(.vertical) { @extend %entry.flat; }
3127
}
3128
3129
3130
/********
3131
* Misc *
3132
********/
3133
// content view (grid/list)
3134
.content-view {
3135
background-color: $bg_color;
3136
3137
// &:hover { -gtk-icon-effect: highlight; }
3138
3139
rubberband, .rubberband { @extend rubberband; }
3140
}
3141
3142
.scale-popup {
3143
.osd & { @extend %osd; }
3144
3145
.osd & button.flat { // FIXME: quick hack, redo properly
3146
}
3147
3148
button { // +/- buttons on GtkVolumeButton popup
3149
}
3150
}
3151
3152
3153
/**********************
3154
* Window Decorations *
3155
*********************/
3156
decoration {
3157
transition: $shadow_transition;
3158
border-radius: 2px 2px 0 0;
3159
box-shadow: $shadow_4, 0 16px 16px transparent;
3160
3161
// FIXME rationalize shadows
3162
3163
// this is used for the resize cursor area
3164
margin: 8px;
3165
3166
&:backdrop {
3167
// the transparent shadow here is to enforce that the shadow extents don't
3168
// change when we go to backdrop, to prevent jumping windows.
3169
// The biggest shadow should be in the same order then in the active state
3170
// or the jumping will happen during the transition.
3171
box-shadow: $shadow_2, 0 16px 16px transparent;
3172
}
3173
3174
.maximized &,
3175
.fullscreen &,
3176
.tiled & { border-radius: 0; }
3177
3178
.popup & { box-shadow: none; }
3179
3180
// server-side decorations as used by mutter
3181
.ssd & { box-shadow: 0 3px 3px rgba(0, 0, 0, 0.16); } // just doing borders, wm draws actual shadows
3182
3183
.csd.popup & {
3184
border-radius: 2px;
3185
box-shadow: $shadow_2;
3186
}
3187
3188
tooltip.csd & {
3189
border-radius: 2px;
3190
box-shadow: $shadow_2;
3191
}
3192
3193
messagedialog.csd & {
3194
border-radius: 2px;
3195
// box-shadow: $shadow_4, 0 16px 16px transparent;
3196
3197
// &:backdrop { box-shadow: $shadow_2, 0 16px 16px transparent; }
3198
}
3199
3200
.solid-csd & {
3201
margin: 0;
3202
// padding: 4px;
3203
border-radius: 0;
3204
box-shadow: none;
3205
// box-shadow: inset 0 0 0 4px $titlebar_bg_color;
3206
background-color: $titlebar_bg_color;
3207
}
3208
}
3209
3210
// Window Close button
3211
button.titlebutton {
3212
// @extend %simple_flat_button;
3213
3214
@extend %circular_button;
3215
3216
.selection-mode & {
3217
}
3218
}
3219
3220
3221
// catch all extend :)
3222
3223
%selected_items {
3224
background-color: $primary_color;
3225
3226
@at-root %nobg_selected_items, & {
3227
color: $inverse_fg_color;
3228
3229
&:disabled { color: $disabled_inverse_fg_color; }
3230
}
3231
}
3232
3233
.monospace { font-family: monospace; }
3234
3235
3236
/**********************
3237
* Touch Copy & Paste *
3238
*********************/
3239
// touch selection handlebars for the Popover.osd above
3240
cursor-handle {
3241
border-radius: $circular_radius;
3242
background-color: $accent_color;
3243
background-image: none;
3244
3245
&.top:dir(ltr), &.bottom:dir(rtl) {
3246
padding-left: 6px;
3247
border-top-right-radius: 0;
3248
}
3249
3250
&.bottom:dir(ltr), &.top:dir(rtl) {
3251
padding-right: 6px;
3252
border-top-left-radius: 0;
3253
}
3254
3255
&.insertion-cursor:dir(ltr), &.insertion-cursor:dir(rtl) {
3256
-GtkWidget-text-handle-width: 24;
3257
-GtkWidget-text-handle-height: 30;
3258
3259
$_url: 'assets/scale-horz-marks-before-slider#{$asset_suffix}';
3260
-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
3261
url('#{$_url}@2.png'));
3262
}
3263
}
3264
3265
.context-menu { font: initial; } // Decouple the font of context menus from their entry/textview
3266
3267
// shortcut window keys
3268
.keycap {
3269
min-width: 28px - 8px * 2;
3270
min-height: 28px - 2px;
3271
margin-top: 2px;
3272
padding-bottom: 2px;
3273
padding-left: 8px;
3274
padding-right: 8px;
3275
3276
border: solid 1px $border_color;
3277
border-radius: 2px + 1px;
3278
box-shadow: inset 0 -2px $border_color;
3279
background-color: $base_color;
3280
color: $fg_color;
3281
font-size: smaller;
3282
}
3283
3284
:not(decoration):not(window):drop(active) { // FIXME needs to be done widget by widget, this wildcard should really die
3285
transition: $longer_transition;
3286
box-shadow: $shadow_1, inset 0 0 0 2px $accent_color;
3287
caret-color: $accent_color;
3288
}
3289
3290
stackswitcher button.text-button { min-width: 100px; } // FIXME aggregate with buttons
3291
3292
stackswitcher button.circular,
3293
stackswitcher button.text-button.circular { // FIXME aggregate with buttons
3294
min-width: $medium_size;
3295
min-height: $medium_size;
3296
padding: 0;
3297
}
3298