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