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