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