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