A fork of the Materia GTK theme.

By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 _common.scss

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