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