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