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