_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
outline-offset: -2px;
112
padding: 4px;
113
border-radius: 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: 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
check:not(:indeterminate):checked { @extend %check_checked; }
662
663
// radio:not(:indeterminate):checked { @extend %radio_checked; }
664
665
check:indeterminate:checked, radio:indeterminate:checked { @extend %indeterminate_checked; }
666
}
667
668
modelbutton.flat arrow {
669
background: none;
670
671
&:hover { background: none; }
672
673
&.left { -gtk-icon-source: -gtk-icontheme("pan-start-symbolic"); }
674
675
&.right { -gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); }
676
}
677
678
button.color {
679
min-height: $small_size;
680
min-width: $small_size;
681
padding: $container_padding;
682
683
colorswatch:only-child {
684
// &, overlay { border-radius: 0; }
685
}
686
}
687
688
689
/*********
690
* Links *
691
*********/
692
*:link {
693
&, &:hover, &:active { color: $link_color; }
694
695
&:visited {
696
&, &:hover, &:active { color: $visited_link_color; }
697
}
698
699
@at-root %link_selected,
700
&:selected,
701
*:selected & { color: $inverse_fg_color; }
702
}
703
704
button:link,
705
button:visited {
706
@extend *:link;
707
708
> label { text-decoration-line: underline; }
709
}
710
711
/*****************
712
* GtkSpinButton *
713
*****************/
714
spinbutton {
715
&:not(.vertical) {
716
// in this horizontal configuration, the whole spinbutton
717
// behaves as the entry, so we extend the entry styling
718
// and nuke the style on the internal entry
719
@extend %entry;
720
721
padding: 0;
722
723
%spinbutton_entry,
724
entry {
725
min-width: $large_size - 8px * 2;
726
// reset all the other props since the spinbutton node is styled here
727
margin: 0;
728
border-image: none;
729
border-radius: 0;
730
box-shadow: none;
731
background-color: transparent;
732
//
733
// This will help to simplify spinbutton's code, but unfortunatelly
734
// doesn't work properly in :dir(rtl). It needs z-index property.
735
//
736
// min-width: $large_size - 8px;
737
//
738
// $spinbuttons_width: $small_size * 2 + $container_padding * 3;
739
//
740
// &:dir(ltr) {
741
// margin-right: -$spinbuttons_width;
742
// padding-right: $spinbuttons_width;
743
// }
744
//
745
// &:dir(rtl) {
746
// margin-left: -$spinbuttons_width;
747
// padding-left: $spinbuttons_width;
748
// }
749
}
750
751
button {
752
// margin: $container_padding;
753
border: solid $container_padding transparent;
754
755
@extend %simple_flat_button;
756
757
@extend %small_button;
758
759
&.up:dir(ltr),
760
&.down:dir(rtl) { margin-left: -$container_padding / 2; }
761
762
&.up:dir(rtl),
763
&.down:dir(ltr) { margin-right: -$container_padding / 2; }
764
}
765
}
766
767
// OSD horizontal
768
.osd &:not(.vertical) {
769
button {
770
}
771
}
772
773
// Vertical
774
&.vertical {
775
// in the vertical configuration, we treat the spinbutton
776
// as a box, and tweak the style of the entry in the middle
777
// so that it's linked
778
779
// FIXME: this should not be set at all, but otherwise it gets the wrong
780
// color
781
&:disabled { color: $disabled_fg_color; }
782
783
&:drop(active) {
784
box-shadow: none;
785
}
786
787
entry {
788
min-height: $medium_size;
789
min-width: $large_size;
790
padding: 0;
791
}
792
793
button {
794
min-height: $medium_size;
795
min-width: $large_size;
796
padding: 0;
797
798
@extend %simple_flat_button;
799
800
&.up { border-radius: 2px 2px 0 0; }
801
802
&.down { border-radius: 0 0 2px 2px; }
803
}
804
}
805
806
// OSD vertical
807
.osd &.vertical button:first-child {
808
}
809
810
// Misc
811
treeview &:not(.vertical) {
812
min-height: 0;
813
border-style: none;
814
border-radius: 0;
815
816
entry {
817
min-height: 0;
818
padding: 1px 2px;
819
}
820
}
821
}
822
823
824
/**************
825
* ComboBoxes *
826
**************/
827
combobox {
828
arrow {
829
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
830
min-height: 16px;
831
min-width: 16px;
832
}
833
834
button.combo:checked { transition: none; } // workaround for menuitem selection
835
836
button.combo cellview {
837
&:dir(ltr) { margin-left: 8px - ($medium_size - 16px) / 2; }
838
&:dir(rtl) { margin-right: 8px - ($medium_size - 16px) / 2; }
839
}
840
841
#gtk-combobox-popup-menu {
842
padding: 2px 0;
843
844
menuitem {
845
min-height: $medium_size - 2px * 2;
846
padding: 0 8px;
847
}
848
}
849
850
&.linked {
851
button:nth-child(2) {
852
&:dir(ltr) { @extend %linked:last-child; }
853
&:dir(rtl) { @extend %linked:first-child; }
854
}
855
}
856
857
&:drop(active) { // FIXME: untested
858
box-shadow: none;
859
860
// button.combo { @extend %button_basic:drop(active); }
861
}
862
}
863
864
.linked > combobox > box > button.combo {
865
// the combo is a composite widget so the way we do button linking doesn't
866
// work, special case needed. See
867
// https://bugzilla.gnome.org/show_bug.cgi?id=733979
868
869
&:dir(ltr),
870
&:dir(rtl) { @extend %linked_middle; } // specificity bump
871
}
872
873
.linked:not(.vertical) > combobox:first-child > box > button.combo { @extend %linked:first-child; }
874
.linked:not(.vertical) > combobox:last-child > box > button.combo { @extend %linked:last-child; }
875
.linked:not(.vertical) > combobox:only-child > box > button.combo { @extend %linked:only-child; }
876
877
.linked.vertical > combobox > box > button.combo { @extend %linked_vertical_middle; }
878
.linked.vertical > combobox:first-child > box > button.combo { @extend %linked_vertical:first-child; }
879
.linked.vertical > combobox:last-child > box > button.combo { @extend %linked_vertical:last-child; }
880
.linked.vertical > combobox:only-child > box > button.combo { @extend %linked_vertical:only-child; }
881
882
%combo_flat {
883
border-radius: 0;
884
background-image: none;
885
font-weight: inherit;
886
887
@include entry(flat-normal);
888
889
&:hover { box-shadow: inset 0 -2px $fill_color; }
890
891
&:checked {
892
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
893
$primary_color 100%,
894
transparent 0%)
895
0 0 2 / 0 0 2px;
896
}
897
898
&:disabled { color: $disabled_fg_color; }
899
}
900
901
902
/************
903
* Toolbars *
904
************/
905
toolbar {
906
-GtkWidget-window-dragging: true;
907
padding: $container_padding / 2;
908
background-color: $bg_color;
909
910
button { @extend %button_basic.flat; }
911
912
// on OSD
913
.osd & { background-color: transparent; }
914
915
// stand-alone OSD toolbars
916
&.osd {
917
transition: $shadow_transition;
918
padding: $container_padding;
919
border-radius: 2px;
920
box-shadow: $shadow_2, inset 0 1px $highlight_color;
921
background-color: $base_color;
922
923
&:backdrop { box-shadow: $shadow_1, inset 0 1px $highlight_color; }
924
925
&.left,
926
&.right,
927
&.top,
928
&.bottom { border-radius: 0; } // positional classes for `attached` osd toolbars
929
}
930
931
// toolbar separators
932
&.horizontal separator { margin: $container_padding / 2; }
933
&.vertical separator { margin: $container_padding / 2; }
934
935
&:not(.inline-toolbar):not(.osd) {
936
scale,
937
entry,
938
spinbutton,
939
button { margin: $container_padding / 2; }
940
941
.linked entry,
942
.linked spinbutton,
943
.linked button {
944
&:not(:first-child) { margin-left: 0; }
945
&:not(:last-child) { margin-right: 0; }
946
}
947
948
switch { margin: ($container_padding / 2 + $container_padding) ($container_padding / 2); }
949
}
950
}
951
952
//searchbar, location-bar & inline-toolbar
953
.inline-toolbar {
954
padding: $container_padding;
955
border-style: solid;
956
border-width: 0 1px 1px;
957
border-color: $border_color;
958
background-color: $alt_base_color;
959
}
960
961
searchbar,
962
.location-bar {
963
padding: $container_padding;
964
border-style: solid;
965
border-width: 0 0 1px;
966
border-color: $border_color;
967
background-color: $bg_color;
968
background-clip: border-box;
969
}
970
971
972
/***************
973
* Header bars *
974
***************/
975
%titlebar,
976
headerbar {
977
transition: background-color $shorter_duration $deceleration_curve;
978
min-height: $large_size;
979
padding: 0 $container_padding;
980
box-shadow: $shadow_1, inset 0 1px $titlebar_highlight_color;
981
background-color: $titlebar_bg_color;
982
color: $titlebar_fg_color;
983
984
&:disabled :not(button) > label { color: $disabled_titlebar_fg_color; }
985
986
&:backdrop {
987
color: $secondary_titlebar_fg_color;
988
989
&:disabled :not(button) > label { color: $disabled_secondary_titlebar_fg_color; }
990
}
991
992
.title {
993
transition: $longer_transition;
994
padding: 0 12px;
995
font-weight: bold;
996
}
997
998
.subtitle {
999
transition: $longer_transition;
1000
padding: 0 12px;
1001
font-size: smaller;
1002
1003
@extend .dim-label;
1004
}
1005
1006
button:not(.suggested-action):not(.destructive-action) {
1007
@extend %button_basic.flat;
1008
1009
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1010
$titlebar_indicator_color 0%,
1011
transparent 0%)
1012
0 0 0 / 0 0 0px;
1013
1014
&:checked {
1015
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1016
$titlebar_indicator_color 100%,
1017
transparent 0%)
1018
0 0 2 / 0 0 2px;
1019
1020
&, &:disabled { background-color: transparent; }
1021
}
1022
}
1023
1024
button.suggested-action, button.destructive-action {
1025
&:disabled { color: gtkalpha(currentColor, $disabled_opacity); }
1026
}
1027
1028
&.selection-mode {
1029
// FIXME: 0.00001s is workaround for transition bug of gtk+ 3.22
1030
// see https://bugzilla.gnome.org/show_bug.cgi?id=774064
1031
transition: background-color 0.00001s $longer_duration;
1032
animation: header_ripple_effect $longer_duration $deceleration_curve;
1033
box-shadow: $shadow_1, inset 0 1px $alt_highlight_color;
1034
background-color: $primary_color;
1035
color: $inverse_fg_color;
1036
1037
&:backdrop {
1038
color: $secondary_inverse_fg_color;
1039
}
1040
1041
.subtitle:link { @extend *:link:selected; }
1042
1043
button:not(.suggested-action):not(.destructive-action) {
1044
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1045
currentColor 0%,
1046
transparent 0%)
1047
0 0 0 / 0 0 0px;
1048
color: currentColor;
1049
1050
&:disabled { color: gtkalpha(currentColor, $disabled_opacity); }
1051
1052
&:checked {
1053
border-image: radial-gradient(circle closest-corner at center calc(100% - 1px),
1054
currentColor 100%,
1055
transparent 0%)
1056
0 0 2 / 0 0 2px;
1057
color: currentColor;
1058
1059
&:disabled { color: gtkalpha(currentColor, $disabled_opacity); }
1060
}
1061
}
1062
1063
.selection-menu {
1064
padding-left: 16px;
1065
padding-right: 16px;
1066
1067
GtkArrow { -GtkArrow-arrow-scaling: 1; }
1068
1069
.arrow { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
1070
}
1071
}
1072
1073
.fullscreen &,
1074
.tiled &,
1075
.maximized & {
1076
border-radius: 0; // squared corners when the window is fullscreen, maximized or tiled
1077
box-shadow: $shadow_1;
1078
}
1079
1080
&.default-decoration {
1081
min-height: $small_size;
1082
padding: $container_padding;
1083
box-shadow: inset 0 1px $titlebar_highlight_color;
1084
1085
.fullscreen &,
1086
.tiled &,
1087
.maximized & { box-shadow: none; }
1088
1089
button.titlebutton {
1090
min-height: $small_size;
1091
min-width: $small_size;
1092
margin: 0;
1093
padding: 0;
1094
}
1095
1096
// workaround for non-animatable buttons
1097
.background:not(.csd) & button.titlebutton:active { background-size: 1000% 1000%; }
1098
}
1099
1100
.solid-csd & {
1101
&:dir(rtl), &:dir(ltr) { // specificity bump
1102
margin-left: -2px;
1103
margin-right: -2px;
1104
margin-top: -2px;
1105
// border-radius: 0;
1106
box-shadow: inset 0 1px $titlebar_highlight_color;
1107
}
1108
}
1109
}
1110
1111
headerbar {
1112
// add vertical margins to common widget on the headerbar to avoid them spanning the whole height
1113
entry,
1114
spinbutton,
1115
// separator,
1116
button {
1117
margin-top: $container_padding;
1118
margin-bottom: $container_padding;
1119
}
1120
1121
switch {
1122
margin-top: $container_padding * 2;
1123
margin-bottom: $container_padding * 2;
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 { color: $accent_color; }
1988
1989
&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_color, $disabled_opacity); }
1990
1991
// &:only-child { margin: -12px; }
1992
1993
row &:not(:checked):not(:indeterminate) {
1994
color: gtkalpha(currentColor, $secondary_opacity);
1995
1996
&:hover, &:active { color: currentColor; }
1997
1998
&:disabled { color: gtkalpha(currentColor, $secondary_opacity * $disabled_opacity); }
1999
}
2000
2001
menu menuitem & {
2002
transition: none;
2003
margin: -16px; // this is a workaround for a menu check/radio size allocation issue
2004
2005
&:not(:checked):not(:indeterminate) { color: gtkalpha(currentColor, $tertiary_opacity); }
2006
2007
&, &:hover, &:disabled {
2008
box-shadow: none;
2009
// color: inherit;
2010
// animation: none;
2011
}
2012
}
2013
}
2014
2015
%check,
2016
check {
2017
& { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/checkbox-unchecked-symbolic.svg")),
2018
-gtk-recolor(url("assets/scalable/checkbox-unchecked-symbolic.png"))); }
2019
2020
&:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/checkbox-checked-symbolic.svg")),
2021
-gtk-recolor(url("assets/scalable/checkbox-checked-symbolic.png"))); }
2022
2023
&:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/checkbox-mixed-symbolic.svg")),
2024
-gtk-recolor(url("assets/scalable/checkbox-mixed-symbolic.png"))); }
2025
}
2026
2027
$radio_indicator: 10px / $large_size / 2;
2028
$radio_radius_slice: #{$large_size / 2px};
2029
$radio_radius_width: #{$large_size / 2};
2030
2031
%radio,
2032
radio {
2033
& { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/radio-unchecked-symbolic.svg")),
2034
-gtk-recolor(url("assets/scalable/radio-unchecked-symbolic.png"))); }
2035
2036
// &:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/radio-checked-symbolic.svg")),
2037
// -gtk-recolor(url("assets/scalable/radio-checked-symbolic.png"))); }
2038
2039
&:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/scalable/radio-mixed-symbolic.svg")),
2040
-gtk-recolor(url("assets/scalable/radio-mixed-symbolic.png"))); }
2041
2042
border-image: -gtk-gradient(radial,
2043
center center, 0,
2044
center center, 0.001,
2045
to($accent_color),
2046
to(transparent))
2047
$radio_radius_slice / $radio_radius_width;
2048
2049
&:checked {
2050
border-image: -gtk-gradient(radial,
2051
center center, 0,
2052
center center, $radio_indicator,
2053
to($accent_color),
2054
to(transparent))
2055
$radio_radius_slice / $radio_radius_width;
2056
}
2057
2058
&:checked:disabled {
2059
border-image: -gtk-gradient(radial,
2060
center center, 0,
2061
center center, $radio_indicator,
2062
to(scale-alpha($accent_color, $disabled_opacity)),
2063
to(transparent))
2064
$radio_radius_slice / $radio_radius_width;
2065
}
2066
2067
&:indeterminate:checked {
2068
border-image: -gtk-gradient(radial,
2069
center center, 0,
2070
center center, 0.001,
2071
to($accent_color),
2072
to(transparent))
2073
$radio_radius_slice / $radio_radius_width;
2074
}
2075
}
2076
2077
// let's animate things
2078
@keyframes check_check {
2079
from { -gtk-icon-transform: rotate(90deg); }
2080
to { -gtk-icon-transform: unset; }
2081
}
2082
2083
@keyframes check_radio { // FIXME: cannot animate border-image
2084
from {
2085
border-image: -gtk-gradient(radial,
2086
center center, 0,
2087
center center, 0.001,
2088
to($accent_color),
2089
to(transparent))
2090
$radio_radius_slice / $radio_radius_width;
2091
}
2092
2093
to {
2094
border-image: -gtk-gradient(radial,
2095
center center, 0,
2096
center center, $radio_indicator,
2097
to($accent_color),
2098
to(transparent))
2099
$radio_radius_slice / $radio_radius_width;
2100
}
2101
}
2102
2103
@keyframes check_indeterminate {
2104
from { -gtk-icon-transform: unset; }
2105
50% { -gtk-icon-transform: scale(0, 1); }
2106
to { -gtk-icon-transform: unset; }
2107
}
2108
2109
%check_checked,
2110
check:not(:indeterminate):checked { animation: check_check $longer_duration $standard_curve; }
2111
2112
check:not(:indeterminate):checked:active { animation: check_check $longer_duration $standard_curve, ripple_effect $longer_duration $deceleration_curve forwards; }
2113
2114
// %radio_checked,
2115
// radio:not(:indeterminate):checked { animation: check_radio $longer_duration $standard_curve; }
2116
2117
// radio:not(:indeterminate):checked:active { animation: check_radio $longer_duration $standard_curve, ripple_effect $longer_duration $deceleration_curve forwards; }
2118
2119
%indeterminate_checked,
2120
check:indeterminate:checked, radio:indeterminate:checked { animation: check_indeterminate $longer_duration $standard_curve; }
2121
2122
check:indeterminate:checked:active, radio:indeterminate:checked:active { animation: check_indeterminate $longer_duration $standard_curve, ripple_effect $longer_duration $deceleration_curve forwards; }
2123
2124
// no animations in menus
2125
menu menuitem {
2126
check:not(:indeterminate):checked,
2127
radio:not(:indeterminate):checked,
2128
check:indeterminate:checked,
2129
radio:indeterminate:checked { animation: none; }
2130
}
2131
2132
treeview.view check,
2133
treeview.view radio {
2134
padding: 0;
2135
2136
&:hover {
2137
box-shadow: inset 0 0 0 9999px gtkalpha($fg_color, 0.05);
2138
2139
&:disabled { box-shadow: none; }
2140
2141
&:selected { box-shadow: inset 0 0 0 9999px gtkalpha($inverse_fg_color, 0.05); }
2142
}
2143
2144
& {
2145
color: $secondary_fg_color;
2146
2147
&:hover, &:active { color: $fg_color; }
2148
2149
&:disabled { color: $disabled_secondary_fg_color; }
2150
2151
&:checked, &:indeterminate { color: $accent_color; }
2152
2153
&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_color, $disabled_opacity); }
2154
}
2155
2156
&:selected {
2157
color: $secondary_inverse_fg_color;
2158
2159
&:hover, &:active { color: $inverse_fg_color; }
2160
2161
&:disabled { color: $disabled_secondary_inverse_fg_color; }
2162
2163
&:checked, &:indeterminate { color: $accent_color; }
2164
2165
&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_color, $disabled_opacity); }
2166
}
2167
}
2168
2169
treeview.view radio:checked {
2170
-gtk-icon-source: image(-gtk-recolor(url("assets/scalable/radio-checked-symbolic.svg")),
2171
-gtk-recolor(url("assets/scalable/radio-checked-symbolic.png")));
2172
border-image: none;
2173
}
2174
2175
2176
/************
2177
* GtkScale *
2178
************/
2179
scale {
2180
// sizing
2181
$_marks_lenght: 8px;
2182
$_marks_distance: 8px;
2183
2184
$slider_size: 24px;
2185
$marks_slider_size: 30px;
2186
2187
$slider_margin: -($slider_size - $bar_size) / 2;
2188
$marks_slider_margin: -($marks_slider_size - $bar_size) - $slider_margin;
2189
2190
$color_slider_margin: -($slider_size) / 2;
2191
$color_marks_slider_margin: -($marks_slider_size - 16px) - $color_slider_margin;
2192
2193
min-height: $medium_size - $slider_size;
2194
min-width: $medium_size - $slider_size;
2195
padding: ($slider_size / 2);
2196
2197
* { transition: $longer_transition; }
2198
2199
// the slider is inside the trough, so to have make it bigger there's a negative margin
2200
slider {
2201
min-height: $slider_size;
2202
min-width: $slider_size;
2203
margin: $slider_margin;
2204
}
2205
2206
// the backing bit
2207
trough {
2208
outline-offset: 2px;
2209
background-color: $fill_color;
2210
2211
&:disabled { color: $disabled_fg_color; }
2212
}
2213
2214
// the colored part of the backing bit
2215
highlight {
2216
background-color: $accent_color;
2217
2218
&:disabled { background-color: transparent; }
2219
}
2220
2221
// this is another differently styled part of the backing bit, the most relevant use case is for example
2222
// in media player to indicate how much video stream as been cached
2223
fill {
2224
background-color: $fill_color;
2225
2226
&:disabled { background-color: transparent; }
2227
}
2228
2229
slider {
2230
transition: all $shorter_duration $standard_curve;
2231
// border-radius: 100%;
2232
// background-color: $accent_color;
2233
background-repeat: no-repeat;
2234
background-position: center;
2235
2236
@each $s, $as in ('', ''),
2237
(':disabled', '-disabled') {
2238
&#{$s} {
2239
$_url: 'assets/scale-slider#{$as}#{$asset_suffix}';
2240
2241
background-image: -gtk-scaled(url('#{$_url}.png'), url('#{$_url}@2.png'));
2242
}
2243
}
2244
2245
background-size: calc(100% - 8px);
2246
2247
&:hover { background-size: calc(100% - 4px); }
2248
2249
&:active { background-size: calc(100% - 0px); }
2250
}
2251
2252
// click-and-hold the slider to activate
2253
&.fine-tune {
2254
// to make the slider shrink in fine-tune mode
2255
slider { background-size: calc(100% - 12px); }
2256
}
2257
2258
value { color: gtkalpha(currentColor, $tertiary_opacity); }
2259
2260
marks {
2261
color: $fill_color;
2262
2263
@each $marks_class, $marks_pos, $marks_margin in (top, top, bottom),
2264
(bottom, bottom, top),
2265
(top, left, right),
2266
(bottom, right, left) {
2267
&.#{$marks_class} {
2268
margin-#{$marks_margin}: $_marks_distance;
2269
margin-#{$marks_pos}: -($_marks_distance + $_marks_lenght);
2270
}
2271
}
2272
}
2273
2274
&.horizontal {
2275
indicator {
2276
min-height: $_marks_lenght;
2277
min-width: 1px;
2278
}
2279
}
2280
2281
&.vertical {
2282
indicator {
2283
min-height: 1px;
2284
min-width: $_marks_lenght;
2285
}
2286
}
2287
2288
// *WARNING* scale with marks madness following
2289
2290
@each $dir_class, $dir_infix in ('horizontal', 'horz'),
2291
('vertical', 'vert') {
2292
@each $marks_infix, $marks_class in ('marks-before', 'marks-before:not(.marks-after)'),
2293
('marks-after', 'marks-after:not(.marks-before)') {
2294
&.#{$dir_class}.#{$marks_class} {
2295
slider {
2296
@each $state, $state_infix in ('', ''),
2297
(':disabled', '-disabled') {
2298
&#{$state} {
2299
$_scale_asset: 'assets/scale-#{$dir_infix}-#{$marks_infix}-slider#{$state_infix}#{$asset_suffix}';
2300
2301
background-image: -gtk-scaled(url('#{$_scale_asset}.png'), url('#{$_scale_asset}@2.png'));
2302
}
2303
}
2304
2305
@if $dir_class == 'horizontal' {
2306
min-height: $marks_slider_size;
2307
min-width: $slider_size;
2308
2309
@if $marks_infix == 'marks-before' {
2310
margin-top: $marks_slider_margin;
2311
2312
background-position: center calc(100% - 4px);
2313
2314
&:hover { background-position: center calc(100% - 2px); }
2315
2316
&:active { background-position: center calc(100% - 0px); }
2317
}
2318
2319
@if $marks_infix == 'marks-after' {
2320
margin-bottom: $marks_slider_margin;
2321
2322
background-position: center calc(4px);
2323
2324
&:hover { background-position: center calc(2px); }
2325
2326
&:active { background-position: center calc(0px); }
2327
}
2328
}
2329
2330
@if $dir_class == 'vertical' {
2331
min-height: $slider_size;
2332
min-width: $marks_slider_size;
2333
2334
@if $marks_infix == 'marks-before' {
2335
margin-left: $marks_slider_margin;
2336
2337
background-position: calc(4px) center;
2338
2339
&:hover { background-position: calc(2px) center; }
2340
2341
&:active { background-position: calc(0px) center; }
2342
}
2343
2344
@if $marks_infix == 'marks-after' {
2345
margin-right: $marks_slider_margin;
2346
2347
background-position: calc(100% - 4px) center;
2348
2349
&:hover { background-position: calc(100% - 2px) center; }
2350
2351
&:active { background-position: calc(100% - 0px) center; }
2352
}
2353
}
2354
}
2355
2356
&.fine-tune slider {
2357
@if $dir_class == 'horizontal' {
2358
@if $marks_infix == 'marks-before' { background-position: center calc(100% - 6px); }
2359
2360
@if $marks_infix == 'marks-after' { background-position: center calc(6px); }
2361
}
2362
2363
@if $dir_class == 'vertical' {
2364
@if $marks_infix == 'marks-before' { background-position: calc(6px) center; }
2365
2366
@if $marks_infix == 'marks-after' { background-position: calc(100% - 6px) center; }
2367
}
2368
}
2369
}
2370
}
2371
}
2372
2373
&.color {
2374
min-height: 0;
2375
min-width: 0;
2376
2377
&.horizontal {
2378
padding: 0 0 12px 0;
2379
2380
slider {
2381
&:dir(ltr), &:dir(rtl) { // specificity bump
2382
margin-bottom: $color_slider_margin;
2383
margin-top: $color_marks_slider_margin;
2384
}
2385
}
2386
}
2387
2388
&.vertical {
2389
&:dir(ltr) {
2390
padding: 0 0 0 12px;
2391
2392
slider {
2393
margin-left: $color_slider_margin;
2394
margin-right: $color_marks_slider_margin;
2395
}
2396
}
2397
2398
&:dir(rtl) {
2399
padding: 0 12px 0 0;
2400
2401
slider {
2402
margin-right: $color_slider_margin;
2403
margin-left: $color_marks_slider_margin;
2404
}
2405
}
2406
}
2407
}
2408
}
2409
2410
2411
/*****************
2412
* Progress bars *
2413
*****************/
2414
progressbar {
2415
// sizing
2416
&.horizontal {
2417
trough,
2418
progress { min-height: $bar_size; }
2419
}
2420
2421
&.vertical {
2422
trough,
2423
progress { min-width: $bar_size; }
2424
}
2425
2426
// FIXME: insensitive state missing and some other state should be set probably
2427
color: $tertiary_fg_color;
2428
font-size: smaller;
2429
2430
trough { background-color: scale-alpha($primary_color, $lower_opacity); }
2431
2432
progress { background-color: $primary_color; }
2433
2434
&.osd { // progressbar.osd used for epiphany page loading progress
2435
// min-width: $bar_size;
2436
// min-height: $bar_size;
2437
// background-color: transparent;
2438
2439
// trough { background-color: transparent; }
2440
2441
progress {
2442
}
2443
}
2444
2445
trough.empty progress { all: unset; } // makes the progress indicator disappear, when the fraction is 0
2446
}
2447
2448
2449
/*************
2450
* Level Bar *
2451
*************/
2452
levelbar {
2453
block {
2454
min-width: $medium_size;
2455
min-height: $bar_size;
2456
}
2457
2458
&.vertical block {
2459
min-width: $bar_size;
2460
min-height: $medium_size;
2461
}
2462
2463
trough {
2464
padding: 2px;
2465
border-radius: 2px;
2466
2467
@include entry(normal);
2468
2469
&:disabled { @include entry(disabled); }
2470
}
2471
2472
&.horizontal.discrete block { margin: 0 1px; }
2473
2474
&.vertical.discrete block { margin: 1px 0; }
2475
2476
&.horizontal.discrete trough { padding: 2px 1px; }
2477
2478
&.vertical.discrete trough { padding: 1px 2px; }
2479
2480
block {
2481
&.low {
2482
background-color: $warning_color;
2483
}
2484
2485
&.high,
2486
&:not(.empty) {
2487
background-color: $primary_color;
2488
}
2489
2490
&.full {
2491
background-color: $success_color;
2492
}
2493
2494
&.empty {
2495
background-color: $fill_color;
2496
color: $disabled_fg_color;
2497
}
2498
}
2499
}
2500
2501
2502
/****************
2503
* Print dialog *
2504
*****************/
2505
printdialog {
2506
paper {
2507
padding: 0;
2508
border: 1px solid $border_color;
2509
background: $base_color;
2510
color: $fg_color;
2511
}
2512
2513
.dialog-action-box { margin: 12px; }
2514
}
2515
2516
2517
/**********
2518
* Frames *
2519
**********/
2520
frame > border,
2521
.frame {
2522
margin: 0;
2523
padding: 0;
2524
border: 1px solid $border_color;
2525
border-radius: 0;
2526
box-shadow: none;
2527
2528
&.flat { border-style: none; }
2529
}
2530
2531
actionbar > revealer > box {
2532
padding: $container_padding;
2533
border-top: 1px solid $border_color;
2534
2535
button:not(.suggested-action):not(.destructive-action):not(.server-list-button) { @extend %button_basic.flat; }
2536
}
2537
2538
scrolledwindow {
2539
viewport.frame { // avoid double borders when viewport inside scrolled window
2540
border-style: none;
2541
}
2542
2543
// This is used when content is touch-dragged past boundaries.
2544
// draws a box on top of the content, the size changes programmatically.
2545
@at-root overshoot {
2546
&.top { @include overshoot(top); }
2547
2548
&.bottom { @include overshoot(bottom); }
2549
2550
&.left { @include overshoot(left); }
2551
2552
&.right { @include overshoot(right); }
2553
}
2554
2555
// Overflow indication, works similarly to the overshoot, the size if fixed tho.
2556
@at-root undershoot {
2557
&.top { @include undershoot(top); }
2558
2559
&.bottom { @include undershoot(bottom); }
2560
2561
&.left { @include undershoot(left); }
2562
2563
&.right { @include undershoot(right); }
2564
}
2565
2566
@at-root junction { // the small square between two scrollbars
2567
border-style: solid none none solid;
2568
border-width: 1px;
2569
border-color: $border_color;
2570
background-color: $base_color;
2571
2572
&:dir(rtl) { border-style: solid solid none none; }
2573
}
2574
}
2575
2576
//vbox and hbox separators
2577
separator {
2578
min-width: 1px;
2579
min-height: 1px;
2580
background: $border_color;
2581
}
2582
2583
2584
/*********
2585
* Lists *
2586
*********/
2587
list {
2588
border-color: $border_color;
2589
background-color: $base_color;
2590
2591
row { padding: 2px; }
2592
}
2593
2594
// FIXME
2595
$row_transition: $longer_transition, background-color 0, color 0;
2596
2597
row {
2598
&.activatable {
2599
transition: $row_transition,
2600
background-size $ripple_duration $deceleration_curve,
2601
background-image $ripple_duration * 2 $deceleration_curve;
2602
box-shadow: inset 0 0 0 9999px transparent;
2603
background-image: radial-gradient(circle farthest-corner at center,
2604
transparent 10%,
2605
transparent 0%);
2606
background-repeat: no-repeat;
2607
background-position: center;
2608
background-size: 1000% 1000%;
2609
2610
&:hover {
2611
transition: $row_transition,
2612
box-shadow 0,
2613
background-size $ripple_duration $deceleration_curve,
2614
background-image $ripple_duration * 2 $deceleration_curve;
2615
box-shadow: inset 0 0 0 9999px $row_fill_color;
2616
}
2617
2618
&.has-open-popup, // this is for indicathing which row generated a popover see https://bugzilla.gnome.org/show_bug.cgi?id=754411
2619
&:active {
2620
transition: $row_transition,
2621
background-size 0,
2622
background-image 0;
2623
animation: ripple_effect $longer_duration $deceleration_curve forwards;
2624
box-shadow: inset 0 0 0 9999px $semi_fill_color;
2625
background-image: radial-gradient(circle farthest-corner at center,
2626
$semi_fill_color 10%,
2627
transparent 0%);
2628
background-size: 0% 0%;
2629
}
2630
}
2631
2632
&:selected { @extend %selected_items; }
2633
}
2634
2635
2636
/*********************
2637
* App Notifications *
2638
*********************/
2639
.app-notification {
2640
@extend %osd;
2641
2642
@extend toolbar.osd;
2643
2644
margin: 8px;
2645
2646
button { @extend %button_basic.flat; }
2647
2648
&.frame,
2649
border { border-style: none; }
2650
}
2651
2652
2653
/*************
2654
* Expanders *
2655
*************/
2656
expander {
2657
arrow {
2658
transition: all $shorter_duration $standard_curve;
2659
min-width: 16px;
2660
min-height: 16px;
2661
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
2662
-gtk-icon-transform: rotate(-90deg);
2663
2664
&:dir(rtl) { -gtk-icon-transform: rotate(90deg); }
2665
2666
&:checked { -gtk-icon-transform: unset; }
2667
2668
color: $secondary_fg_color;
2669
2670
&:hover, &:active { color: $fg_color; }
2671
2672
&:disabled { color: $disabled_secondary_fg_color; }
2673
2674
&:selected {
2675
color: $secondary_inverse_fg_color;
2676
2677
&:hover, &:active { color: $inverse_fg_color; }
2678
2679
&:disabled { color: $disabled_secondary_inverse_fg_color; }
2680
}
2681
}
2682
}
2683
2684
2685
/************
2686
* Calendar *
2687
***********/
2688
calendar {
2689
padding: 1px;
2690
border: 1px solid $border_color;
2691
color: $fg_color;
2692
2693
&:disabled { color: $disabled_fg_color; }
2694
2695
&:selected {
2696
@extend %selected_items;
2697
2698
border-radius: 2px + 1px;
2699
}
2700
2701
&.header {
2702
border-style: none none solid;
2703
border-radius: 0;
2704
}
2705
2706
&.button { @extend %simple_flat_button; }
2707
2708
&.highlight {
2709
color: gtkalpha(currentColor, $tertiary_opacity);
2710
font-weight: 500;
2711
}
2712
2713
&:indeterminate { color: gtkalpha(currentColor, $disabled_opacity); }
2714
}
2715
2716
2717
/***********
2718
* Dialogs *
2719
***********/
2720
messagedialog { // Message Dialog styling
2721
&.background { background-color: $lighter_bg_color; }
2722
2723
.titlebar {
2724
min-height: $small_size;
2725
border-style: none;
2726
box-shadow: inset 0 1px $highlight_color;
2727
background-color: $lighter_bg_color;
2728
color: $fg_color;
2729
2730
&:backdrop { color: $secondary_fg_color; }
2731
}
2732
2733
&.csd { // rounded bottom border styling for csd version
2734
&.background {
2735
// bigger radius for better antialiasing
2736
border-bottom-left-radius: 2px;
2737
border-bottom-right-radius: 2px;
2738
}
2739
2740
.dialog-action-area button {
2741
padding: 8px 16px;
2742
border-top: 1px solid $border_color;
2743
border-radius: 0;
2744
2745
@extend %simple_flat_button;
2746
2747
&:first-child { border-bottom-left-radius: 2px; }
2748
2749
&:last-child { border-bottom-right-radius: 2px; }
2750
}
2751
}
2752
}
2753
2754
filechooser {
2755
.dialog-action-box { border-top: 1px solid $border_color; }
2756
2757
#pathbarbox {
2758
border-bottom: 1px solid $border_color;
2759
background-color: $bg_color;
2760
}
2761
}
2762
2763
filechooserbutton:drop(active) {
2764
box-shadow: none;
2765
}
2766
2767
2768
/***********
2769
* Sidebar *
2770
***********/
2771
.sidebar {
2772
border-style: none;
2773
background-color: $lighter_bg_color;
2774
2775
@at-root %sidebar_left,
2776
&:dir(ltr),
2777
&.left,
2778
&.left:dir(rtl) {
2779
border-right: 1px solid $border_color;
2780
border-left-style: none;
2781
}
2782
2783
@at-root %sidebar_right
2784
&:dir(rtl),
2785
&.right {
2786
border-left: 1px solid $border_color;
2787
border-right-style: none;
2788
}
2789
2790
list { background-color: transparent; }
2791
2792
paned & { &.left, &.right, &.left:dir(rtl), &:dir(rtl), &:dir(ltr), & { border-style: none; }}
2793
}
2794
2795
stacksidebar {
2796
&.sidebar {
2797
&:dir(ltr),
2798
&.left,
2799
&.left:dir(rtl) { list { @extend %sidebar_left; }}
2800
2801
&:dir(rtl),
2802
&.right { list { @extend %sidebar_right; }}
2803
}
2804
2805
row {
2806
padding: 10px 4px;
2807
2808
> label {
2809
padding-left: 6px;
2810
padding-right: 6px;
2811
}
2812
2813
&.needs-attention > label { @extend %needs_attention; }
2814
}
2815
}
2816
2817
2818
/****************
2819
* File chooser *
2820
****************/
2821
placessidebar {
2822
> viewport.frame { border-style: none; }
2823
2824
list { padding: (4px - 3px) 0 4px; }
2825
2826
row {
2827
// Needs overriding of the GtkListBoxRow padding
2828
min-height: 32px;
2829
margin: -1px 0; // Remove unknown margins
2830
padding: 0;
2831
2832
// Using margins/padding directly in the SidebarRow
2833
// will make the animation of the new bookmark row jump
2834
> revealer { padding: 0 12px; }
2835
2836
&:selected { color: $inverse_fg_color; }
2837
2838
&:disabled { color: $disabled_fg_color; }
2839
2840
image.sidebar-icon {
2841
opacity: $tertiary_opacity; // dim the device icons
2842
2843
&:dir(ltr) { padding-right: 8px; }
2844
&:dir(rtl) { padding-left: 8px; }
2845
}
2846
2847
label.sidebar-label {
2848
&:dir(ltr) { padding-right: 2px; }
2849
&:dir(rtl) { padding-left: 2px; }
2850
}
2851
2852
@at-root button.sidebar-button {
2853
@extend %simple_flat_button;
2854
2855
@extend %small_button;
2856
2857
row:selected & {
2858
}
2859
}
2860
2861
&.sidebar-placeholder-row {
2862
min-height: 2px;
2863
padding: 0 8px;
2864
background-image: image($accent_color);
2865
background-clip: content-box;
2866
}
2867
2868
&.sidebar-new-bookmark-row { color: $accent_color; }
2869
2870
&:drop(active):not(:disabled) {
2871
box-shadow: inset 0 0 0 2px $accent_color;
2872
2873
&:selected {
2874
// background-color: $accent_color;
2875
// color: $inverse_fg_color;
2876
}
2877
}
2878
}
2879
}
2880
2881
placesview {
2882
.server-list-button > image { -gtk-icon-transform: rotate(0turn); }
2883
2884
.server-list-button:checked > image { -gtk-icon-transform: rotate(-0.5turn); }
2885
2886
// this selects the "connect to server" label
2887
> actionbar > revealer > box > label {
2888
padding-left: 8px;
2889
padding-right: 8px;
2890
}
2891
}
2892
2893
2894
/*********
2895
* Paned *
2896
*********/
2897
paned {
2898
> separator {
2899
min-width: 1px;
2900
min-height: 1px;
2901
-gtk-icon-source: none; // defeats the ugly default handle decoration
2902
border-style: none; // just to be sure
2903
background-color: transparent;
2904
// workaround, using background istead of a border since the border will get rendered twice (?)
2905
background-image: image($border_color);
2906
background-size: 1px 1px;
2907
background-clip: content-box; // avoids borders image being rendered twice (?)
2908
2909
&.wide {
2910
min-width: 6px;
2911
min-height: 6px;
2912
background-color: $bg_color;
2913
background-image: image($border_color), image($border_color);
2914
background-size: 1px 1px, 1px 1px;
2915
}
2916
}
2917
2918
&.horizontal > separator {
2919
background-repeat: repeat-y;
2920
2921
&:dir(ltr) {
2922
margin: 0 -8px 0 0;
2923
padding: 0 8px 0 0;
2924
background-position: left;
2925
}
2926
2927
&:dir(rtl) {
2928
margin: 0 0 0 -8px;
2929
padding: 0 0 0 8px;
2930
background-position: right;
2931
}
2932
2933
&.wide {
2934
margin: 0;
2935
padding: 0;
2936
background-repeat: repeat-y, repeat-y;
2937
background-position: left, right;
2938
}
2939
}
2940
2941
&.vertical > separator {
2942
margin: 0 0 -8px 0;
2943
padding: 0 0 8px 0;
2944
background-repeat: repeat-x;
2945
background-position: top;
2946
2947
&.wide {
2948
margin: 0;
2949
padding: 0;
2950
background-repeat: repeat-x, repeat-x;
2951
background-position: bottom, top;
2952
}
2953
}
2954
}
2955
2956
2957
/**************
2958
* GtkInfoBar *
2959
**************/
2960
infobar {
2961
border-style: none;
2962
2963
&.info { background-color: $info_bg_color; }
2964
2965
&.question { background-color: $question_bg_color; }
2966
2967
&.warning { background-color: $warning_bg_color; }
2968
2969
&.error { background-color: $error_bg_color; }
2970
2971
&.info,
2972
&.question,
2973
&.warning,
2974
&.error {
2975
> label, & { color: $inverse_fg_color; }
2976
2977
button { @extend %button_selected; }
2978
2979
selection {}
2980
2981
*:link { @extend %link_selected; }
2982
}
2983
}
2984
2985
2986
/************
2987
* Tooltips *
2988
************/
2989
tooltip {
2990
&.background {
2991
// background-color needs to be set this way otherwise it gets drawn twice
2992
// see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details.
2993
box-shadow: inset 0 1px $highlight_color;
2994
background-color: scale-alpha($base_color, $higher_opacity);
2995
}
2996
2997
// @extend %osd;
2998
2999
// padding: 4px; /* not working */
3000
border-radius: 2px;
3001
box-shadow: none; // otherwise it gets inherited by windowframe.csd
3002
3003
&:not(.csd) {
3004
border: 1px solid $border_color;
3005
border-radius: 2px + 1px;
3006
background-clip: $extra_background_clip;
3007
}
3008
3009
// FIXME: we need a border or tooltips vanish on black background.
3010
decoration { background-color: transparent; }
3011
3012
label {
3013
// tooltip label has already 6px margins
3014
min-height: 32px - 6px * 2;
3015
padding: 0 8px - 6px;
3016
}
3017
3018
* {
3019
// workaround for Eclipse.
3020
// do not include any declaration here.
3021
// padding: 0;
3022
// background-color: transparent;
3023
// color: inherit;
3024
}
3025
}
3026
3027
3028
/*****************
3029
* Color Chooser *
3030
*****************/
3031
colorswatch {
3032
// This widget is made of two boxes one on top of the other, the lower box is colorswatch {} the other one
3033
// is colorswatch overlay {}, colorswatch has the programmatically set background, so most of the style is
3034
// applied to the overlay box.
3035
3036
// base color corners rounding
3037
// to avoid the artifacts caused by rounded corner anti-aliasing the base color
3038
// sports a bigger radius.
3039
// nth-child is needed by the custom color strip.
3040
3041
&.top {
3042
border-top-left-radius: $material_radius + 0.5px;
3043
border-top-right-radius: $material_radius + 0.5px;
3044
3045
overlay {
3046
border-top-left-radius: $material_radius;
3047
border-top-right-radius: $material_radius;
3048
}
3049
}
3050
3051
&.bottom {
3052
border-bottom-left-radius: $material_radius + 0.5px;
3053
border-bottom-right-radius: $material_radius + 0.5px;
3054
3055
overlay {
3056
border-bottom-left-radius: $material_radius;
3057
border-bottom-right-radius: $material_radius;
3058
}
3059
}
3060
3061
&.left,
3062
&:first-child:not(.top) {
3063
border-top-left-radius: $material_radius + 0.5px;
3064
border-bottom-left-radius: $material_radius + 0.5px;
3065
3066
overlay {
3067
border-top-left-radius: $material_radius;
3068
border-bottom-left-radius: $material_radius;
3069
}
3070
}
3071
3072
&.right,
3073
&:last-child:not(.bottom) {
3074
border-top-right-radius: $material_radius + 0.5px;
3075
border-bottom-right-radius: $material_radius + 0.5px;
3076
3077
overlay {
3078
border-top-right-radius: $material_radius;
3079
border-bottom-right-radius: $material_radius;
3080
}
3081
}
3082
3083
&.dark overlay { color: $light_fg_color; }
3084
3085
&.light overlay { color: $dark_fg_color; }
3086
3087
&.dark { color: $light_fg_color; } // for focus ring
3088
3089
&.light { color: $dark_fg_color; } // for focus ring
3090
3091
&:drop(active) {
3092
box-shadow: none;
3093
3094
&.light overlay {
3095
box-shadow: $shadow_1, 0 0 0 2px $accent_color;
3096
}
3097
3098
&.dark overlay {
3099
box-shadow: $shadow_1, 0 0 0 2px $accent_color;
3100
}
3101
}
3102
3103
overlay {
3104
transition: $shadow_transition;
3105
box-shadow: $shadow_1;
3106
3107
&:hover { box-shadow: $shadow_2; }
3108
}
3109
3110
&#add-color-button {
3111
border-radius: $material_radius $material_radius 0 0;
3112
color: $light_fg_color; // for focus ring
3113
3114
&:only-child { border-radius: $material_radius; }
3115
3116
overlay {
3117
background-image: linear-gradient(to right,
3118
$error_bg_color 25%,
3119
$warning_bg_color 25%, $warning_bg_color 50%,
3120
$info_bg_color 50%, $info_bg_color 75%,
3121
$question_bg_color 75%);
3122
color: $light_fg_color;
3123
}
3124
}
3125
3126
&:disabled {
3127
opacity: $disabled_opacity;
3128
3129
overlay { box-shadow: none; }
3130
}
3131
3132
row:selected & {
3133
}
3134
3135
&#editor-color-sample {
3136
border-radius: $material_radius + 0.5px;
3137
3138
overlay { border-radius: $material_radius; }
3139
3140
// overlay:hover { box-shadow: $shadow_1; }
3141
}
3142
}
3143
3144
// colorscale popup
3145
colorchooser .popover.osd {
3146
transition: $shadow_transition;
3147
border-radius: 2px;
3148
box-shadow: $shadow_2, inset 0 1px $highlight_color;
3149
background-color: $base_color;
3150
3151
&:backdrop { box-shadow: $shadow_1, inset 0 1px $highlight_color; }
3152
3153
spinbutton:not(.vertical) { @extend %entry.flat; }
3154
}
3155
3156
3157
/********
3158
* Misc *
3159
********/
3160
//content view (grid/list)
3161
.content-view {
3162
background-color: $bg_color;
3163
3164
// &:hover { -gtk-icon-effect: highlight; }
3165
3166
rubberband, .rubberband { @extend rubberband; }
3167
}
3168
3169
.scale-popup {
3170
.osd & { @extend %osd; }
3171
3172
.osd & button.flat { //FIXME: quick hack, redo properly
3173
}
3174
3175
button { // +/- buttons on GtkVolumeButton popup
3176
}
3177
}
3178
3179
3180
/**********************
3181
* Window Decorations *
3182
*********************/
3183
decoration {
3184
transition: $shadow_transition;
3185
border-radius: 2px 2px 0 0;
3186
box-shadow: $shadow_4, 0 16px 16px transparent;
3187
3188
// FIXME rationalize shadows
3189
3190
// this is used for the resize cursor area
3191
margin: 8px;
3192
3193
&:backdrop {
3194
// the transparent shadow here is to enforce that the shadow extents don't
3195
// change when we go to backdrop, to prevent jumping windows.
3196
// The biggest shadow should be in the same order then in the active state
3197
// or the jumping will happen during the transition.
3198
box-shadow: $shadow_2, 0 16px 16px transparent;
3199
}
3200
3201
.maximized &,
3202
.fullscreen &,
3203
.tiled & { border-radius: 0; }
3204
3205
.popup & { box-shadow: none; }
3206
3207
// server-side decorations as used by mutter
3208
.ssd & { box-shadow: 0 3px 3px rgba(0, 0, 0, 0.16); } //just doing borders, wm draws actual shadows
3209
3210
.csd.popup & {
3211
border-radius: 2px;
3212
box-shadow: $shadow_2;
3213
}
3214
3215
tooltip.csd & {
3216
border-radius: 2px;
3217
box-shadow: $shadow_2;
3218
}
3219
3220
messagedialog.csd & {
3221
border-radius: 2px;
3222
// box-shadow: $shadow_4, 0 16px 16px transparent;
3223
3224
// &:backdrop { box-shadow: $shadow_2, 0 16px 16px transparent; }
3225
}
3226
3227
.solid-csd & {
3228
margin: 0;
3229
padding: 4px;
3230
// border: solid 1px $border_color;
3231
// border-radius: 0;
3232
box-shadow: inset 0 0 0 4px $titlebar_bg_color;
3233
// background-color: $border_color;
3234
}
3235
}
3236
3237
// Window Close button
3238
button.titlebutton {
3239
// @extend %simple_flat_button;
3240
3241
@extend %circular_button;
3242
3243
.selection-mode & {
3244
}
3245
}
3246
3247
3248
// catch all extend :)
3249
3250
%selected_items {
3251
background-color: $primary_color;
3252
3253
@at-root %nobg_selected_items, & {
3254
color: $inverse_fg_color;
3255
3256
&:disabled { color: $disabled_inverse_fg_color; }
3257
}
3258
}
3259
3260
.monospace { font-family: monospace; }
3261
3262
3263
/**********************
3264
* Touch Copy & Paste *
3265
*********************/
3266
//touch selection handlebars for the Popover.osd above
3267
cursor-handle {
3268
border-radius: $circular_radius;
3269
background-color: $accent_color;
3270
background-image: none;
3271
3272
&.top:dir(ltr), &.bottom:dir(rtl) {
3273
padding-left: 6px;
3274
border-top-right-radius: 0;
3275
}
3276
3277
&.bottom:dir(ltr), &.top:dir(rtl) {
3278
padding-right: 6px;
3279
border-top-left-radius: 0;
3280
}
3281
3282
&.insertion-cursor:dir(ltr), &.insertion-cursor:dir(rtl) {
3283
-GtkWidget-text-handle-width: 24;
3284
-GtkWidget-text-handle-height: 30;
3285
3286
$_url: 'assets/scale-horz-marks-before-slider#{$asset_suffix}';
3287
-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'),
3288
url('#{$_url}@2.png'));
3289
}
3290
}
3291
3292
.context-menu { font: initial; } // Decouple the font of context menus from their entry/textview
3293
3294
// shortcut window keys
3295
.keycap {
3296
min-width: 28px - 8px * 2;
3297
min-height: 28px - 2px;
3298
margin-top: 2px;
3299
padding-bottom: 2px;
3300
padding-left: 8px;
3301
padding-right: 8px;
3302
3303
border: solid 1px $border_color;
3304
border-radius: 2px + 1px;
3305
box-shadow: inset 0 -2px $border_color;
3306
background-color: $base_color;
3307
color: $fg_color;
3308
font-size: smaller;
3309
}
3310
3311
:not(decoration):not(window):drop(active) { // FIXME needs to be done widget by widget, this wildcard should really die
3312
transition: $longer_transition;
3313
box-shadow: $shadow_1, inset 0 0 0 2px $accent_color;
3314
caret-color: $accent_color;
3315
}
3316
3317
stackswitcher button.text-button { min-width: 100px; } // FIXME aggregate with buttons
3318
3319
stackswitcher button.circular,
3320
stackswitcher button.text-button.circular { // FIXME aggregate with buttons
3321
min-width: $medium_size;
3322
min-height: $medium_size;
3323
padding: 0;
3324
}
3325