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