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