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