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