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