A fork of the Materia GTK theme.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 _common.scss

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