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