_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 { 1202padding-left: ($medium_size - 24px) / 2; 1203padding-right: ($medium_size - 24px) / 2; 1204 1205label:not(:only-child) { 1206&:first-child { margin-left: 4px; } 1207 1208&:last-child { margin-right: 4px; } 1209} 1210 1211&.slider-button { 1212padding-left: (24px - 16px) / 2; 1213padding-right: (24px - 16px) / 2; 1214} 1215 1216:not(headerbar) & { 1217@extend %flat_button; 1218 1219border-image: radial-gradient(circle closest-corner at center calc(100% - 1px), 1220$primary_color 0%, 1221transparent 0%) 12220 0 0 / 0 0 0px; 1223border-radius: 2px; 1224 1225&:checked { 1226border-image: radial-gradient(circle closest-corner at center calc(100% - 1px), 1227$primary_color 100%, 1228transparent 0%) 12290 0 2 / 0 0 2px; 1230 1231&, &:disabled { background-color: transparent; } 1232} 1233} 1234} 1235 1236 1237/************** 1238* Tree Views * 1239**************/ 1240treeview.view { 1241@at-root * { 1242-GtkTreeView-horizontal-separator: 4; 1243-GtkTreeView-grid-line-width: 1; 1244-GtkTreeView-grid-line-pattern: ''; 1245-GtkTreeView-tree-line-width: 1; 1246-GtkTreeView-tree-line-pattern: ''; 1247-GtkTreeView-expander-size: 16; 1248} 1249 1250border-left-color: $track_color; // this is actually the tree lines color, 1251border-top-color: $borders_color; // while this is the grid lines color, better then nothing 1252 1253rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props 1254 1255&:hover, &:active, &:selected { border-radius: 0; } 1256 1257&.separator { 1258min-height: 1px + 2px * 2; 1259color: $borders_color; 1260} 1261 1262&:drop(active) { 1263border-style: solid none; 1264border-width: 1px; 1265border-color: $accent_color; 1266 1267&.after { border-top-style: none; } 1268 1269&.before { border-bottom-style: none; } 1270} 1271 1272&.expander { 1273-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 1274-gtk-icon-transform: rotate(-90deg); 1275 1276&:dir(rtl) { -gtk-icon-transform: rotate(90deg); } 1277 1278&:checked { -gtk-icon-transform: unset; } 1279 1280color: $secondary_fg_color; 1281 1282&:hover, &:active { color: $fg_color; } 1283 1284&:disabled { color: $disabled_secondary_fg_color; } 1285 1286&:selected { 1287color: $secondary_inversed_fg_color; 1288 1289&:hover, &:active { color: $inversed_fg_color; } 1290 1291&:disabled { color: $disabled_secondary_inversed_fg_color; } 1292} 1293} 1294 1295&.progressbar { // progress bar in treeviews 1296border-style: none none solid; 1297border-width: $bar_size; 1298border-color: $primary_color; 1299box-shadow: none; 1300background-color: transparent; 1301 1302&:selected { border-color: currentColor; } 1303} 1304 1305&.trough { // progress bar trough in treeviews 1306border-style: none none solid; 1307border-width: $bar_size; 1308border-color: scale-alpha($primary_color, $lower_opacity); 1309box-shadow: none; 1310background-color: transparent; 1311 1312&:selected { border-color: $track_color; } 1313} 1314 1315header { 1316button { 1317@extend row.activatable; 1318 1319padding: 2px 6px; 1320border-style: none solid solid none; 1321border-width: 1px; 1322border-color: $borders_color; 1323border-radius: 0; 1324background-clip: border-box; 1325 1326&, &:hover, &:active { box-shadow: none; } 1327 1328&, &:disabled { background-color: $base_color; } 1329 1330&:last-child { border-right-style: none; } 1331} 1332} 1333 1334button.dnd, 1335header.button.dnd { // for treeview-like derive widgets 1336padding: 2px 6px; 1337border-style: none solid solid; 1338border-width: 1px; 1339border-color: $borders_color; 1340border-radius: 0; 1341box-shadow: none; 1342background-color: $base_color; 1343background-clip: border-box; 1344color: $primary_color; 1345} 1346 1347acceleditor > label { background-color: $primary_color; } // see tests/testaccel to test 1348} 1349 1350 1351/********* 1352* Menus * 1353*********/ 1354menubar, 1355.menubar { 1356-GtkWidget-window-dragging: true; 1357padding: 0; 1358// box-shadow: inset 0 -1px $borders_color; 1359background-color: $headerbar_color; 1360 1361> menuitem { 1362transition: $shorter_transition; 1363min-height: 20px; 1364padding: 4px 8px; 1365color: $secondary_inversed_fg_color; 1366 1367&:hover { //Seems like it :hover even with keyboard focus 1368transition: none; 1369background-color: $semi_track_color; 1370color: $inversed_fg_color; 1371} 1372 1373&:disabled { color: $disabled_secondary_inversed_fg_color; } 1374} 1375} 1376 1377.csd.popup { border-radius: 2px; } 1378 1379menu, 1380.menu, 1381.context-menu { 1382margin: 4px 0; 1383padding: 4px 0; 1384box-shadow: inset 0 1px $highlight_color; 1385background-color: $base_color; 1386border: 1px solid $borders_color; // adds borders in a non composited env 1387 1388.csd & { 1389border: none; // axes borders in a composited env 1390border-radius: 2px; 1391} 1392 1393menuitem { 1394transition: $shorter_transition; 1395min-height: 20px; 1396min-width: 40px; 1397padding: 4px 8px; 1398font: initial; 1399text-shadow: none; 1400 1401&:hover { 1402transition: none; 1403background-color: $semi_track_color; 1404} 1405 1406&:disabled { color: $disabled_fg_color; } 1407 1408// submenu indicators 1409arrow { 1410min-height: 16px; 1411min-width: 16px; 1412 1413&:dir(ltr) { 1414-gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); 1415margin-left: 8px; 1416} 1417 1418&:dir(rtl) { 1419-gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl'); 1420margin-right: 8px; 1421} 1422} 1423 1424// avoids labels color being overridden, see 1425// https://bugzilla.gnome.org/show_bug.cgi?id=767058 1426label { &:dir(rtl), &:dir(ltr) { color: inherit; }} 1427} 1428 1429// overflow arrows 1430> arrow { 1431min-height: 16px; 1432min-width: 16px; 1433padding: 4px; 1434border-radius: 0; 1435background-color: $base_color; 1436color: $secondary_fg_color; 1437 1438&.top { 1439margin-top: -4px; 1440border-bottom: 1px solid $borders_color; 1441-gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); 1442} 1443 1444&.bottom { 1445margin-bottom: -4px; 1446border-top: 1px solid $borders_color; 1447-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 1448} 1449 1450&:hover { 1451background-image: image($semi_track_color); 1452color: $fg_color; 1453} 1454 1455&:disabled { 1456border-color: transparent; 1457background-color: transparent; 1458color: transparent; 1459// color: $disabled_secondary_fg_color; 1460} 1461} 1462 1463separator { margin: 4px 0; } 1464} 1465 1466menuitem { 1467accelerator { color: gtkalpha(currentColor, $hint_opacity); } 1468 1469check, 1470radio { 1471&:dir(ltr) { margin-right: -8px; margin-left: -16px; } 1472&:dir(rtl) { margin-right: -16px; margin-left: -8px; } 1473} 1474} 1475 1476 1477/*************** 1478* Popovers * 1479***************/ 1480popover.background { 1481transition: $shadow_transition; 1482padding: 2px; 1483box-shadow: $z-depth-2; // TODO: this should really have a highlight 1484background-color: $lighter_bg_color; 1485 1486&:backdrop { box-shadow: $z-depth-1; } 1487 1488&, .csd & { 1489border-style: solid; 1490border-width: 1px; 1491border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.3); 1492border-radius: 2px + 1px; 1493} 1494 1495> stack { margin: -4px; } // remove extra padding from menu style popovers 1496 1497> toolbar { margin: -2px; } 1498 1499> list, 1500> .view, 1501> toolbar { 1502border-style: none; 1503box-shadow: none; 1504background-color: transparent; 1505} 1506 1507&.touch-selection, 1508&.magnifier, 1509&.osd { @extend %osd; } 1510 1511// entry { @extend %entry.flat; } 1512 1513// button.combo { @extend %combo_flat; } 1514 1515// button:not(.suggested-action):not(.destructive-action) { @extend %button_basic.flat; } 1516 1517&.menu button, 1518button.model { 1519@extend %simple_flat_button; 1520 1521min-height: 32px; 1522padding: 0 8px; 1523border-radius: 2px; 1524 1525&:checked { @extend %selected_items; } 1526} 1527 1528separator { margin: 4px 0; } 1529 1530list separator { margin: 0; } 1531} 1532 1533/************* 1534* Notebooks * 1535*************/ 1536notebook { 1537> header { 1538border-width: 1px; 1539border-color: $borders_color; 1540background-color: $bg_color; 1541background-clip: border-box; 1542 1543&.top { 1544border-bottom-style: solid; 1545> tabs { 1546margin-bottom: -1px; 1547> tab { 1548 1549&:hover { box-shadow: inset 0 -2px $track_color; } 1550 1551&:checked { box-shadow: inset 0 -2px $primary_color; } 1552} 1553} 1554} 1555 1556&.bottom { 1557border-top-style: solid; 1558> tabs { 1559margin-top: -1px; 1560> tab { 1561 1562&:hover { box-shadow: inset 0 2px $track_color; } 1563 1564&:checked { box-shadow: inset 0 2px $primary_color; } 1565} 1566} 1567} 1568 1569&.left { 1570border-right-style: solid; 1571> tabs { 1572margin-right: -1px; 1573> tab { 1574 1575&:hover { box-shadow: inset -2px 0 $track_color; } 1576 1577&:checked { box-shadow: inset -2px 0 $primary_color; } 1578} 1579} 1580} 1581 1582&.right { 1583border-left-style: solid; 1584> tabs { 1585margin-left: -1px; 1586> tab { 1587 1588&:hover { box-shadow: inset 2px 0 $track_color; } 1589 1590&:checked { box-shadow: inset 2px 0 $primary_color; } 1591} 1592} 1593} 1594 1595&.top > tabs > arrow { 1596@extend %notebook_vert_arrows; 1597 1598border-top-style: none; 1599} 1600 1601&.bottom > tabs > arrow { 1602@extend %notebook_vert_arrows; 1603 1604border-bottom-style: none; 1605} 1606 1607@at-root %notebook_vert_arrows { 1608padding-left: 4px; 1609padding-right: 4px; 1610 1611&.down { 1612margin-left: -8px; 1613-gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); 1614} 1615 1616&.up { 1617margin-right: -8px; 1618-gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); 1619} 1620} 1621 1622&.left > tabs > arrow { 1623@extend %notebook_horz_arrows; 1624 1625border-left-style: none; 1626} 1627 1628&.right > tabs > arrow { 1629@extend %notebook_horz_arrows; 1630 1631border-right-style: none; 1632} 1633 1634@at-root %notebook_horz_arrows { 1635padding-top: 4px; 1636padding-bottom: 4px; 1637 1638&.down { 1639margin-top: -8px; 1640-gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); 1641} 1642 1643&.up { 1644margin-bottom: -8px; 1645-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 1646} 1647} 1648 1649> tabs > arrow { 1650@extend %simple_flat_button; 1651 1652min-height: 16px; 1653min-width: 16px; 1654border-radius: 0; 1655} 1656 1657tab { 1658transition: $longer_transition; 1659min-height: $small_size; 1660min-width: $small_size; 1661padding: $container_padding 12px; 1662 1663outline-offset: -6px; 1664 1665border-width: 1px; // for reorderable tabs 1666border-color: transparent; // 1667 1668color: $secondary_fg_color; 1669font-weight: 500; 1670 1671&:hover { 1672color: $fg_color; 1673 1674&.reorderable-page { 1675border-color: $borders_color; 1676background-color: $alt_base_color; 1677} 1678} 1679 1680&:disabled { color: $disabled_secondary_fg_color; } 1681 1682&:checked { 1683animation: tab_ripple_effect $longer_duration * 3 $deceleration_curve; 1684color: $fg_color; 1685 1686&:disabled { color: $disabled_fg_color; } 1687 1688&.reorderable-page { 1689border-color: $borders_color; 1690background-color: $base_color; 1691} 1692} 1693 1694// colors the button like the label, overridden otherwise 1695button.flat { 1696@extend %small_button; 1697 1698&:last-child { 1699margin-left: $container_padding; 1700margin-right: $container_padding - 12px; 1701} 1702 1703&:first-child { 1704margin-left: $container_padding - 12px; 1705margin-right: $container_padding; 1706} 1707} 1708} 1709 1710&.top, 1711&.bottom { 1712tabs { 1713padding-left: 8px; 1714padding-right: 8px; 1715 1716&:not(:only-child) { 1717&:first-child { margin-left: 0; } 1718&:last-child { margin-right: 0; } 1719} 1720 1721tab { 1722&.reorderable-page { 1723margin: 0 -1px; 1724border-style: none solid; 1725} 1726} 1727} 1728} 1729 1730&.left, 1731&.right { 1732tabs { 1733padding-top: 8px; 1734padding-bottom: 8px; 1735 1736&:not(:only-child) { 1737&:first-child { margin-top: 0; } 1738&:last-child { margin-bottom: 0; } 1739} 1740 1741tab { 1742&.reorderable-page { 1743margin: -1px 0; 1744border-style: solid none; 1745} 1746} 1747} 1748} 1749} 1750 1751> stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks 1752background-color: $base_color; 1753 1754entry:not(.search), 1755spinbutton:not(.vertical) { @extend %entry.flat; } 1756 1757spinbutton:not(.vertical) entry { &, &:focus, &:disabled { @extend %spinbutton_entry; }} 1758 1759button.combo { @extend %combo_flat; } 1760} 1761} 1762 1763 1764/************** 1765* Scrollbars * 1766**************/ 1767scrollbar { 1768$_slider_min_length: 24px; 1769 1770// disable steppers 1771@at-root * { 1772-GtkScrollbar-has-backward-stepper: false; 1773-GtkScrollbar-has-forward-stepper: false; 1774} 1775 1776transition: $longer_transition; 1777background-color: $base_color; 1778background-clip: $extra_background_clip; 1779 1780// scrollbar border 1781&.top { border-bottom: 1px solid $borders_color; } 1782&.bottom { border-top: 1px solid $borders_color; } 1783&.left { border-right: 1px solid $borders_color; } 1784&.right { border-left: 1px solid $borders_color; } 1785 1786// slider 1787slider { 1788transition: $shorter_transition, margin 0, border-width 0; 1789min-width: 8px; 1790min-height: 8px; 1791border: 4px solid transparent; 1792border-radius: $circular_radius; 1793background-clip: padding-box; 1794background-color: $tertiary_fg_color; 1795 1796&:hover { background-color: $secondary_fg_color; } 1797 1798&:active { background-color: $fg_color; } 1799 1800&:disabled { background-color: $disabled_tertiary_fg_color; } 1801} 1802 1803&.fine-tune { 1804slider { 1805transition: $shorter_transition, margin 0, border-width 0, min-width 0, min-height 0; 1806min-width: 4px; 1807min-height: 4px; 1808} 1809 1810&.horizontal slider { margin: 2px 0; } 1811 1812&.vertical slider { margin: 0 2px; } 1813} 1814 1815&.overlay-indicator { 1816&:not(.dragging):not(.hovering) { 1817border-color: transparent; 1818background-color: transparent; 1819 1820slider { 1821min-width: 4px; 1822min-height: 4px; 1823margin: 4px - 1px; 1824border: 1px solid scale-alpha($base_color, $lower_opacity); 1825} 1826 1827button { 1828min-width: 4px; 1829min-height: 4px; 1830margin: 4px - 1px; 1831border: 1px solid scale-alpha($base_color, $lower_opacity); 1832border-radius: $circular_radius; 1833background-color: $tertiary_fg_color; 1834background-clip: padding-box; 1835-gtk-icon-source: none; 1836 1837&:disabled { background-color: $disabled_tertiary_fg_color; } 1838} 1839 1840&.horizontal { 1841slider { min-width: $_slider_min_length; } 1842 1843button { min-width: 8px; } 1844} 1845 1846&.vertical { 1847slider { min-height: $_slider_min_length; } 1848 1849button { min-height: 8px; } 1850} 1851} 1852 1853&.dragging, 1854&.hovering { background-color: scale-alpha($base_color, $higher_opacity); } 1855} 1856 1857&.horizontal slider { min-width: $_slider_min_length; } 1858 1859&.vertical slider { min-height: $_slider_min_length; } 1860 1861// button styling 1862button { 1863@extend %simple_flat_button; 1864 1865min-width: 16px; 1866min-height: 16px; 1867padding: 0; 1868border-radius: 0; 1869} 1870 1871// button icons 1872&.vertical { 1873button { 1874&.down { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); } 1875 1876&.up { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); } 1877} 1878} 1879 1880&.horizontal { 1881button { 1882&.down { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); } 1883 1884&.up { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); } 1885} 1886} 1887} 1888 1889 1890/********** 1891* Switch * 1892**********/ 1893switch { 1894transition: $longer_transition; 1895margin: $container_padding 0; 1896border: 4px solid transparent; 1897border-radius: $circular_radius; 1898background-color: $track_color; 1899background-clip: padding-box; 1900font-size: 0; 1901 1902&:disabled { color: gtkalpha(currentColor, $disabled_opacity); } 1903 1904&:checked { 1905background-color: scale-alpha($accent_color, 0.5); 1906 1907&:disabled { 1908background-color: scale-alpha($accent_color, 0.5 * $disabled_opacity); 1909color: $disabled_fg_color; 1910} 1911} 1912 1913slider { 1914@include entry(normal); 1915 1916transition: $longer_transition, $shadow_transition, margin 0; 1917min-width: $small_size; 1918min-height: $small_size; 1919margin: -4px 0 -4px -4px; 1920border-radius: $circular_radius; 1921-gtk-outline-radius: $circular_radius; 1922} 1923 1924&:hover slider { @include entry(focus); } 1925 1926&:checked slider { 1927transition: $longer_transition, $shadow_transition, margin 0, background-image 0, background-color 0 $longer_duration; 1928animation: needs_attention $longer_duration $deceleration_curve; 1929margin: -4px -4px -4px 0; 1930background-color: $accent_color; 1931color: $inversed_fg_color; 1932} 1933 1934&:disabled slider { @include entry(disabled); } 1935 1936&:checked:disabled slider { animation: none; } 1937 1938row:selected & { 1939} 1940} 1941 1942 1943/************************* 1944* Check and Radio items * 1945*************************/ 1946// draw regular check and radio items using our PNG assets 1947// all assets are rendered from assets.svg. never add pngs directly 1948 1949//selection-mode 1950@each $s, $as in ('', '-selectionmode'), 1951(':hover', '-hover-selectionmode'), 1952(':checked', '-checked-selectionmode'), 1953(':checked:hover', '-checked-hover-selectionmode') { 1954.view.content-view.check#{$s}:not(list) { 1955-gtk-icon-shadow: $z-depth-1; 1956-gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}#{$asset_suffix}.png"), 1957url("assets/checkbox#{$as}#{$asset_suffix}@2.png")); 1958margin: 8px; 1959background-color: transparent; 1960} 1961} 1962 1963checkbutton.text-button, 1964radiobutton.text-button { 1965// this is for a nice focus on check and radios text 1966padding: 2px; 1967outline-offset: 0; 1968 1969label:not(:only-child) { margin: 0 4px; } 1970} 1971 1972check, 1973radio { 1974min-height: 24px; 1975min-width: 24px; 1976margin: -($large_size - 24px) / 2; 1977padding: ($large_size - 24px) / 2; 1978 1979@extend %simple_flat_button; 1980 1981@extend %circular_button; 1982 1983&:checked, &:indeterminate { color: $accent_color; } 1984 1985&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_color, $disabled_opacity); } 1986 1987// &:only-child { margin: -12px; } 1988 1989row &:not(:checked):not(:indeterminate) { 1990color: gtkalpha(currentColor, $enabled_opacity); 1991 1992&:hover, &:active { color: currentColor; } 1993 1994&:disabled { color: gtkalpha(currentColor, $enabled_opacity * $disabled_opacity); } 1995} 1996 1997menu menuitem & { 1998transition: none; 1999margin: -16px; // this is a workaround for a menu check/radio size allocation issue 2000 2001&:not(:checked):not(:indeterminate) { color: gtkalpha(currentColor, $hint_opacity); } 2002 2003&, &:hover, &:disabled { 2004background-image: none; 2005// color: inherit; 2006// animation: none; 2007} 2008} 2009} 2010 2011%check, 2012check { 2013& { -gtk-icon-source: image(-gtk-recolor(url("assets/check-unchecked-symbolic.svg")), 2014-gtk-recolor(url("assets/check-unchecked-symbolic.png"))); } 2015 2016&:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/check-checked-symbolic.svg")), 2017-gtk-recolor(url("assets/check-checked-symbolic.png"))); } 2018 2019&:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/check-dash-symbolic.svg")), 2020-gtk-recolor(url("assets/check-dash-symbolic.png"))); } 2021} 2022 2023$radio_indicator: 10 / ($large_size / 1px) / 2; 2024$radio_radius_slice: #{$large_size / 2 / 1px}; 2025$radio_radius_width: #{$large_size / 2}; 2026 2027%radio, 2028radio { 2029& { -gtk-icon-source: image(-gtk-recolor(url("assets/radio-unchecked-symbolic.svg")), 2030-gtk-recolor(url("assets/radio-unchecked-symbolic.png"))); } 2031 2032// &:checked { -gtk-icon-source: image(-gtk-recolor(url("assets/radio-checked-symbolic.svg")), 2033// -gtk-recolor(url("assets/radio-checked-symbolic.png"))); } 2034 2035&:indeterminate { -gtk-icon-source: image(-gtk-recolor(url("assets/radio-dash-symbolic.svg")), 2036-gtk-recolor(url("assets/radio-dash-symbolic.png"))); } 2037 2038border-image: -gtk-gradient(radial, 2039center center, 0, 2040center center, 0.001, 2041to($accent_color), 2042to(transparent)) 2043$radio_radius_slice / $radio_radius_width; 2044 2045&:checked { 2046border-image: -gtk-gradient(radial, 2047center center, 0, 2048center center, $radio_indicator, 2049to($accent_color), 2050to(transparent)) 2051$radio_radius_slice / $radio_radius_width; 2052} 2053 2054&:checked:disabled { 2055border-image: -gtk-gradient(radial, 2056center center, 0, 2057center center, $radio_indicator, 2058to(scale-alpha($accent_color, $disabled_opacity)), 2059to(transparent)) 2060$radio_radius_slice / $radio_radius_width; 2061} 2062 2063&:indeterminate:checked { 2064border-image: -gtk-gradient(radial, 2065center center, 0, 2066center center, 0.001, 2067to($accent_color), 2068to(transparent)) 2069$radio_radius_slice / $radio_radius_width; 2070} 2071} 2072 2073// let's animate things 2074@keyframes check_check { 2075from { -gtk-icon-transform: rotate(90deg); } 2076to { -gtk-icon-transform: unset; } 2077} 2078 2079@keyframes check_radio { // FIXME: cannot animate border-image 2080from { 2081border-image: -gtk-gradient(radial, 2082center center, 0, 2083center center, 0.001, 2084to($accent_color), 2085to(transparent)) 2086$radio_radius_slice / $radio_radius_width; 2087} 2088 2089to { 2090border-image: -gtk-gradient(radial, 2091center center, 0, 2092center center, $radio_indicator, 2093to($accent_color), 2094to(transparent)) 2095$radio_radius_slice / $radio_radius_width; 2096} 2097} 2098 2099@keyframes check_indeterminate { 2100from { -gtk-icon-transform: unset; } 210150% { -gtk-icon-transform: scale(0, 1); } 2102to { -gtk-icon-transform: unset; } 2103} 2104 2105%check_checked, 2106check:not(:indeterminate):checked { animation: check_check $longer_duration $standard_curve; } 2107 2108check:not(:indeterminate):checked:active { animation: check_check $longer_duration $standard_curve, flat_ripple_effect $longer_duration $deceleration_curve forwards; } 2109 2110// %radio_checked, 2111// radio:not(:indeterminate):checked { animation: check_radio $longer_duration $standard_curve; } 2112 2113// radio:not(:indeterminate):checked:active { animation: check_radio $longer_duration $standard_curve, flat_ripple_effect $longer_duration $deceleration_curve forwards; } 2114 2115%indeterminate_checked, 2116check:indeterminate:checked, radio:indeterminate:checked { animation: check_indeterminate $longer_duration $standard_curve; } 2117 2118check:indeterminate:checked:active, radio:indeterminate:checked:active { animation: check_indeterminate $longer_duration $standard_curve, flat_ripple_effect $longer_duration $deceleration_curve forwards; } 2119 2120// no animations in menus 2121menu menuitem { 2122check:not(:indeterminate):checked, 2123radio:not(:indeterminate):checked, 2124check:indeterminate:checked, 2125radio:indeterminate:checked { animation: none; } 2126} 2127 2128treeview.view check, 2129treeview.view radio { 2130padding: 0; 2131 2132&:hover { 2133box-shadow: inset 0 0 0 9999px gtkalpha($fg_color, 0.05); 2134background-image: none; 2135 2136&:disabled { box-shadow: none; } 2137 2138&:selected { box-shadow: inset 0 0 0 9999px gtkalpha($inversed_fg_color, 0.05); } 2139} 2140 2141& { 2142color: $secondary_fg_color; 2143 2144&:hover, &:active { color: $fg_color; } 2145 2146&:disabled { color: $disabled_secondary_fg_color; } 2147 2148&:checked, &:indeterminate { color: $accent_color; } 2149 2150&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_color, $disabled_opacity); } 2151} 2152 2153&:selected { 2154color: $secondary_inversed_fg_color; 2155 2156&:hover, &:active { color: $inversed_fg_color; } 2157 2158&:disabled { color: $disabled_secondary_inversed_fg_color; } 2159 2160&:checked, &:indeterminate { color: $accent_color; } 2161 2162&:checked:disabled, &:indeterminate:disabled { color: scale-alpha($accent_color, $disabled_opacity); } 2163} 2164} 2165 2166treeview.view radio:checked { 2167-gtk-icon-source: image(-gtk-recolor(url("assets/radio-checked-symbolic.svg")), 2168-gtk-recolor(url("assets/radio-checked-symbolic.png"))); 2169border-image: none; 2170} 2171 2172 2173/************ 2174* GtkScale * 2175************/ 2176scale { 2177// sizing 2178$_marks_lenght: 8px; 2179$_marks_distance: 8px; 2180 2181$slider_size: 24px; 2182$marks_slider_size: 30px; 2183 2184$slider_margin: -($slider_size - $bar_size) / 2; 2185$marks_slider_margin: -($marks_slider_size - $bar_size) - $slider_margin; 2186 2187$color_slider_margin: -($slider_size) / 2; 2188$color_marks_slider_margin: -($marks_slider_size - 16px) - $color_slider_margin; 2189 2190min-height: $medium_size - $slider_size; 2191min-width: $medium_size - $slider_size; 2192padding: ($slider_size / 2); 2193 2194* { transition: $longer_transition; } 2195 2196// the slider is inside the trough, so to have make it bigger there's a negative margin 2197slider { 2198min-height: $slider_size; 2199min-width: $slider_size; 2200margin: $slider_margin; 2201} 2202 2203// the backing bit 2204trough { 2205outline-offset: 2px; 2206background-color: $track_color; 2207 2208&:disabled { color: $disabled_fg_color; } 2209} 2210 2211// the colored part of the backing bit 2212highlight { 2213background-color: $accent_color; 2214 2215&:disabled { background-color: transparent; } 2216} 2217 2218// this is another differently styled part of the backing bit, the most relevant use case is for example 2219// in media player to indicate how much video stream as been cached 2220fill { 2221background-color: $track_color; 2222 2223&:disabled { background-color: transparent; } 2224} 2225 2226slider { 2227transition: all $shorter_duration $standard_curve; 2228// border-radius: 100%; 2229// background-color: $accent_color; 2230background-repeat: no-repeat; 2231background-position: center; 2232 2233@each $s, $as in ('', ''), 2234(':disabled', '-insensitive') { 2235&#{$s} { 2236$_url: 'assets/slider#{$as}#{$asset_suffix}'; 2237 2238background-image: -gtk-scaled(url('#{$_url}.png'), url('#{$_url}@2.png')); 2239} 2240} 2241 2242background-size: calc(100% - 8px); 2243 2244&:hover { background-size: calc(100% - 4px); } 2245 2246&:active { background-size: calc(100% - 0px); } 2247} 2248 2249// click-and-hold the slider to activate 2250&.fine-tune { 2251// to make the slider shrink in fine-tune mode 2252slider { background-size: calc(100% - 12px); } 2253} 2254 2255value { color: gtkalpha(currentColor, $hint_opacity); } 2256 2257marks { 2258color: $track_color; 2259 2260@each $marks_class, $marks_pos, $marks_margin in (top, top, bottom), 2261(bottom, bottom, top), 2262(top, left, right), 2263(bottom, right, left) { 2264&.#{$marks_class} { 2265margin-#{$marks_margin}: $_marks_distance; 2266margin-#{$marks_pos}: -($_marks_distance + $_marks_lenght); 2267} 2268} 2269} 2270 2271&.horizontal { 2272indicator { 2273min-height: $_marks_lenght; 2274min-width: 1px; 2275} 2276} 2277 2278&.vertical { 2279indicator { 2280min-height: 1px; 2281min-width: $_marks_lenght; 2282} 2283} 2284 2285// *WARNING* scale with marks madness following 2286 2287@each $dir_class, $dir_infix in ('horizontal', 'horz'), 2288('vertical', 'vert') { 2289@each $marks_infix, $marks_class in ('scale-has-marks-above', 'marks-before:not(.marks-after)'), 2290('scale-has-marks-below', 'marks-after:not(.marks-before)') { 2291&.#{$dir_class}.#{$marks_class} { 2292slider { 2293@each $state, $state_infix in ('', ''), 2294(':disabled', '-insensitive') { 2295&#{$state} { 2296$_scale_asset: 'assets/slider-#{$dir_infix}-#{$marks_infix}#{$state_infix}#{$asset_suffix}'; 2297 2298background-image: -gtk-scaled(url('#{$_scale_asset}.png'), url('#{$_scale_asset}@2.png')); 2299} 2300} 2301 2302@if $dir_class == 'horizontal' { 2303min-height: $marks_slider_size; 2304min-width: $slider_size; 2305 2306@if $marks_infix == 'scale-has-marks-above' { 2307margin-top: $marks_slider_margin; 2308 2309background-position: center calc(100% - 4px); 2310 2311&:hover { background-position: center calc(100% - 2px); } 2312 2313&:active { background-position: center calc(100% - 0px); } 2314} 2315 2316@if $marks_infix == 'scale-has-marks-below' { 2317margin-bottom: $marks_slider_margin; 2318 2319background-position: center calc(4px); 2320 2321&:hover { background-position: center calc(2px); } 2322 2323&:active { background-position: center calc(0px); } 2324} 2325} 2326 2327@if $dir_class == 'vertical' { 2328min-height: $slider_size; 2329min-width: $marks_slider_size; 2330 2331@if $marks_infix == 'scale-has-marks-above' { 2332margin-left: $marks_slider_margin; 2333 2334background-position: calc(4px) center; 2335 2336&:hover { background-position: calc(2px) center; } 2337 2338&:active { background-position: calc(0px) center; } 2339} 2340 2341@if $marks_infix == 'scale-has-marks-below' { 2342margin-right: $marks_slider_margin; 2343 2344background-position: calc(100% - 4px) center; 2345 2346&:hover { background-position: calc(100% - 2px) center; } 2347 2348&:active { background-position: calc(100% - 0px) center; } 2349} 2350} 2351} 2352 2353&.fine-tune slider { 2354@if $dir_class == 'horizontal' { 2355@if $marks_infix == 'scale-has-marks-above' { background-position: center calc(100% - 6px); } 2356 2357@if $marks_infix == 'scale-has-marks-below' { background-position: center calc(6px); } 2358} 2359 2360@if $dir_class == 'vertical' { 2361@if $marks_infix == 'scale-has-marks-above' { background-position: calc(6px) center; } 2362 2363@if $marks_infix == 'scale-has-marks-below' { background-position: calc(100% - 6px) center; } 2364} 2365} 2366} 2367} 2368} 2369 2370&.color { 2371min-height: 0; 2372min-width: 0; 2373 2374&.horizontal { 2375padding: 0 0 12px 0; 2376 2377slider { 2378&:dir(ltr), &:dir(rtl) { // specificity bump 2379margin-bottom: $color_slider_margin; 2380margin-top: $color_marks_slider_margin; 2381} 2382} 2383} 2384 2385&.vertical { 2386&:dir(ltr) { 2387padding: 0 0 0 12px; 2388 2389slider { 2390margin-left: $color_slider_margin; 2391margin-right: $color_marks_slider_margin; 2392} 2393} 2394 2395&:dir(rtl) { 2396padding: 0 12px 0 0; 2397 2398slider { 2399margin-right: $color_slider_margin; 2400margin-left: $color_marks_slider_margin; 2401} 2402} 2403} 2404} 2405} 2406 2407 2408/***************** 2409* Progress bars * 2410*****************/ 2411progressbar { 2412// sizing 2413&.horizontal { 2414trough, 2415progress { min-height: $bar_size; } 2416} 2417 2418&.vertical { 2419trough, 2420progress { min-width: $bar_size; } 2421} 2422 2423// FIXME: insensitive state missing and some other state should be set probably 2424color: $tertiary_fg_color; 2425font-size: smaller; 2426 2427trough { background-color: scale-alpha($primary_color, $lower_opacity); } 2428 2429progress { background-color: $primary_color; } 2430 2431&.osd { // progressbar.osd used for epiphany page loading progress 2432// min-width: $bar_size; 2433// min-height: $bar_size; 2434// background-color: transparent; 2435 2436// trough { background-color: transparent; } 2437 2438progress { 2439} 2440} 2441} 2442 2443 2444/************* 2445* Level Bar * 2446*************/ 2447levelbar { 2448block { 2449min-width: $medium_size; 2450min-height: $bar_size; 2451} 2452 2453&.vertical block { 2454min-width: $bar_size; 2455min-height: $medium_size; 2456} 2457 2458trough { 2459padding: 2px; 2460border-radius: 2px; 2461 2462@include entry(normal); 2463 2464&:disabled { @include entry(disabled); } 2465} 2466 2467&.horizontal.discrete block { margin: 0 1px; } 2468 2469&.vertical.discrete block { margin: 1px 0; } 2470 2471&.horizontal.discrete trough { padding: 2px 1px; } 2472 2473&.vertical.discrete trough { padding: 1px 2px; } 2474 2475block { 2476&.low { 2477background-color: $warning_color; 2478} 2479 2480&.high, 2481&:not(.empty) { 2482background-color: $primary_color; 2483} 2484 2485&.full { 2486background-color: $success_color; 2487} 2488 2489&.empty { 2490background-color: $track_color; 2491color: $disabled_fg_color; 2492} 2493} 2494} 2495 2496 2497/**************** 2498* Print dialog * 2499*****************/ 2500printdialog { 2501paper { 2502padding: 0; 2503border: 1px solid $borders_color; 2504background: $base_color; 2505color: $fg_color; 2506} 2507 2508.dialog-action-box { margin: 12px; } 2509} 2510 2511 2512/********** 2513* Frames * 2514**********/ 2515frame > border, 2516.frame { 2517margin: 0; 2518padding: 0; 2519border: 1px solid $borders_color; 2520border-radius: 0; 2521box-shadow: none; 2522 2523&.flat { border-style: none; } 2524} 2525 2526actionbar > revealer > box { 2527padding: $container_padding; 2528border-top: 1px solid $borders_color; 2529 2530button:not(.suggested-action):not(.destructive-action):not(.server-list-button) { @extend %button_basic.flat; } 2531} 2532 2533scrolledwindow { 2534viewport.frame { // avoid double borders when viewport inside scrolled window 2535border-style: none; 2536} 2537 2538// This is used when content is touch-dragged past boundaries. 2539// draws a box on top of the content, the size changes programmatically. 2540@at-root overshoot { 2541&.top { @include overshoot(top); } 2542 2543&.bottom { @include overshoot(bottom); } 2544 2545&.left { @include overshoot(left); } 2546 2547&.right { @include overshoot(right); } 2548} 2549 2550// Overflow indication, works similarly to the overshoot, the size if fixed tho. 2551@at-root undershoot { 2552&.top { @include undershoot(top); } 2553 2554&.bottom { @include undershoot(bottom); } 2555 2556&.left { @include undershoot(left); } 2557 2558&.right { @include undershoot(right); } 2559} 2560 2561@at-root junction { // the small square between two scrollbars 2562border-style: solid none none solid; 2563border-width: 1px; 2564border-color: $borders_color; 2565background-color: $base_color; 2566 2567&:dir(rtl) { border-style: solid solid none none; } 2568} 2569} 2570 2571//vbox and hbox separators 2572separator { 2573min-width: 1px; 2574min-height: 1px; 2575background: $borders_color; 2576} 2577 2578 2579/********* 2580* Lists * 2581*********/ 2582list { 2583border-color: $borders_color; 2584background-color: $base_color; 2585 2586row { padding: 2px; } 2587} 2588 2589// FIXME 2590$row_transition: $longer_transition, background-color 0, color 0; 2591 2592row { 2593&.activatable { 2594transition: $row_transition; 2595box-shadow: inset 0 0 0 9999px $zero_track_color; 2596background-image: radial-gradient(circle farthest-corner at center, 2597$zero_track_color 100%, 2598transparent 0%), 2599image($zero_track_color); 2600 2601&:hover { 2602transition: $row_transition, box-shadow 0; 2603box-shadow: inset 0 0 0 9999px $row_track_color; 2604background-image: radial-gradient(circle farthest-corner at center, 2605$zero_track_color 100%, 2606transparent 0%), 2607image($zero_track_color); 2608} 2609 2610&.has-open-popup, // this is for indicathing which row generated a popover see https://bugzilla.gnome.org/show_bug.cgi?id=754411 2611&:active { 2612transition: $row_transition, background-image 0; 2613animation: row_ripple_effect $longer_duration $deceleration_curve forwards; 2614box-shadow: inset 0 0 0 9999px $semi_track_color; 2615} 2616} 2617 2618&:selected { @extend %selected_items; } 2619} 2620 2621 2622/********************* 2623* App Notifications * 2624*********************/ 2625.app-notification { 2626@extend %osd; 2627 2628@extend toolbar.osd; 2629 2630margin: 8px; 2631 2632button { @extend %button_basic.flat; } 2633 2634&.frame, 2635border { border-style: none; } 2636} 2637 2638 2639/************* 2640* Expanders * 2641*************/ 2642expander { 2643arrow { 2644transition: all $shorter_duration $standard_curve; 2645min-width: 16px; 2646min-height: 16px; 2647-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 2648-gtk-icon-transform: rotate(-90deg); 2649 2650&:dir(rtl) { -gtk-icon-transform: rotate(90deg); } 2651 2652&:checked { -gtk-icon-transform: unset; } 2653 2654color: $secondary_fg_color; 2655 2656&:hover, &:active { color: $fg_color; } 2657 2658&:disabled { color: $disabled_secondary_fg_color; } 2659 2660&:selected { 2661color: $secondary_inversed_fg_color; 2662 2663&:hover, &:active { color: $inversed_fg_color; } 2664 2665&:disabled { color: $disabled_secondary_inversed_fg_color; } 2666} 2667} 2668} 2669 2670 2671/************ 2672* Calendar * 2673***********/ 2674calendar { 2675padding: 1px; 2676border: 1px solid $borders_color; 2677color: $fg_color; 2678 2679&:disabled { color: $disabled_fg_color; } 2680 2681&:selected { 2682@extend %selected_items; 2683 2684border-radius: 2px + 1px; 2685} 2686 2687&.header { 2688border-style: none none solid; 2689border-radius: 0; 2690} 2691 2692&.button { @extend %simple_flat_button; } 2693 2694&.highlight { 2695color: gtkalpha(currentColor, $hint_opacity); 2696font-weight: 500; 2697} 2698 2699&:indeterminate { color: gtkalpha(currentColor, $disabled_opacity); } 2700} 2701 2702 2703/*********** 2704* Dialogs * 2705***********/ 2706messagedialog { // Message Dialog styling 2707&.background { background-color: $lighter_bg_color; } 2708 2709.titlebar { 2710min-height: $small_size; 2711border-style: none; 2712box-shadow: inset 0 1px $highlight_color; 2713background-color: $lighter_bg_color; 2714color: $fg_color; 2715 2716&:backdrop { color: $secondary_fg_color; } 2717} 2718 2719&.csd { // rounded bottom border styling for csd version 2720&.background { 2721// bigger radius for better antialiasing 2722border-bottom-left-radius: 2px; 2723border-bottom-right-radius: 2px; 2724} 2725 2726.dialog-action-area button { 2727padding: 8px 16px; 2728border-top: 1px solid $borders_color; 2729border-radius: 0; 2730 2731@extend %simple_flat_button; 2732 2733&:first-child { border-bottom-left-radius: 2px; } 2734 2735&:last-child { border-bottom-right-radius: 2px; } 2736} 2737} 2738} 2739 2740filechooser { 2741.dialog-action-box { border-top: 1px solid $borders_color; } 2742 2743#pathbarbox { 2744border-bottom: 1px solid $borders_color; 2745background-color: $bg_color; 2746} 2747} 2748 2749filechooserbutton:drop(active) { 2750box-shadow: none; 2751} 2752 2753 2754/*********** 2755* Sidebar * 2756***********/ 2757.sidebar { 2758border-style: none; 2759background-color: $lighter_bg_color; 2760 2761@at-root %sidebar_left, 2762&:dir(ltr), 2763&.left, 2764&.left:dir(rtl) { 2765border-right: 1px solid $borders_color; 2766border-left-style: none; 2767} 2768 2769@at-root %sidebar_right 2770&:dir(rtl), 2771&.right { 2772border-left: 1px solid $borders_color; 2773border-right-style: none; 2774} 2775 2776list { background-color: transparent; } 2777 2778paned & { &.left, &.right, &.left:dir(rtl), &:dir(rtl), &:dir(ltr), & { border-style: none; }} 2779} 2780 2781stacksidebar { 2782&.sidebar { 2783&:dir(ltr), 2784&.left, 2785&.left:dir(rtl) { list { @extend %sidebar_left; }} 2786 2787&:dir(rtl), 2788&.right { list { @extend %sidebar_right; }} 2789} 2790 2791row { 2792padding: 10px 4px; 2793 2794> label { 2795padding-left: 6px; 2796padding-right: 6px; 2797} 2798 2799&.needs-attention > label { @extend %needs_attention; } 2800} 2801} 2802 2803 2804/**************** 2805* File chooser * 2806****************/ 2807placessidebar { 2808> viewport.frame { border-style: none; } 2809 2810list { padding: (4px - 3px) 0 4px; } 2811 2812row { 2813// Needs overriding of the GtkListBoxRow padding 2814min-height: 32px; 2815margin: -1px 0; // Remove unknown margins 2816padding: 0; 2817 2818// Using margins/padding directly in the SidebarRow 2819// will make the animation of the new bookmark row jump 2820> revealer { padding: 0 12px; } 2821 2822&:selected { color: $inversed_fg_color; } 2823 2824&:disabled { color: $disabled_fg_color; } 2825 2826image.sidebar-icon { 2827opacity: $hint_opacity; // dim the device icons 2828 2829&:dir(ltr) { padding-right: 8px; } 2830&:dir(rtl) { padding-left: 8px; } 2831} 2832 2833label.sidebar-label { 2834&:dir(ltr) { padding-right: 2px; } 2835&:dir(rtl) { padding-left: 2px; } 2836} 2837 2838@at-root button.sidebar-button { 2839@extend %simple_flat_button; 2840 2841@extend %small_button; 2842 2843row:selected & { 2844} 2845} 2846 2847&.sidebar-placeholder-row { 2848min-height: 2px; 2849padding: 0 8px; 2850background-image: image($accent_color); 2851background-clip: content-box; 2852} 2853 2854&.sidebar-new-bookmark-row { color: $accent_color; } 2855 2856&:drop(active):not(:disabled) { 2857box-shadow: inset 0 0 0 2px $accent_color; 2858 2859&:selected { 2860// background-color: $accent_color; 2861// color: $inversed_fg_color; 2862} 2863} 2864} 2865} 2866 2867placesview { 2868.server-list-button > image { -gtk-icon-transform: rotate(0turn); } 2869 2870.server-list-button:checked > image { -gtk-icon-transform: rotate(-0.5turn); } 2871 2872// this selects the "connect to server" label 2873> actionbar > revealer > box > label { 2874padding-left: 8px; 2875padding-right: 8px; 2876} 2877} 2878 2879 2880/********* 2881* Paned * 2882*********/ 2883paned { 2884> separator { 2885min-width: 1px; 2886min-height: 1px; 2887-gtk-icon-source: none; // defeats the ugly default handle decoration 2888border-style: none; // just to be sure 2889background-color: transparent; 2890// workaround, using background istead of a border since the border will get rendered twice (?) 2891background-image: image($borders_color); 2892background-size: 1px 1px; 2893 2894&.wide { 2895min-width: 6px; 2896min-height: 6px; 2897background-color: $bg_color; 2898background-image: image($borders_color), image($borders_color); 2899background-size: 1px 1px, 1px 1px; 2900} 2901} 2902 2903&.horizontal > separator { 2904background-repeat: repeat-y; 2905 2906&:dir(ltr) { 2907margin: 0 -8px 0 0; 2908padding: 0 8px 0 0; 2909background-position: left; 2910} 2911 2912&:dir(rtl) { 2913margin: 0 0 0 -8px; 2914padding: 0 0 0 8px; 2915background-position: right; 2916} 2917 2918&.wide { 2919margin: 0; 2920padding: 0; 2921background-repeat: repeat-y, repeat-y; 2922background-position: left, right; 2923} 2924} 2925 2926&.vertical > separator { 2927margin: 0 0 -8px 0; 2928padding: 0 0 8px 0; 2929background-repeat: repeat-x; 2930background-position: top; 2931 2932&.wide { 2933margin: 0; 2934padding: 0; 2935background-repeat: repeat-x, repeat-x; 2936background-position: bottom, top; 2937} 2938} 2939} 2940 2941 2942/************** 2943* GtkInfoBar * 2944**************/ 2945infobar { 2946border-style: none; 2947 2948&.info { background-color: $info_bg_color; } 2949 2950&.question { background-color: $question_bg_color; } 2951 2952&.warning { background-color: $warning_bg_color; } 2953 2954&.error { background-color: $error_bg_color; } 2955 2956&.info, 2957&.question, 2958&.warning, 2959&.error { 2960> label, & { color: $inversed_fg_color; } 2961 2962button { @extend %button_selected; } 2963 2964selection {} 2965 2966*:link { @extend %link_selected; } 2967} 2968} 2969 2970 2971/************ 2972* Tooltips * 2973************/ 2974tooltip { 2975&.background { 2976// background-color needs to be set this way otherwise it gets drawn twice 2977// see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details. 2978box-shadow: inset 0 1px $highlight_color; 2979background-color: scale-alpha($base_color, $higher_opacity); 2980} 2981 2982// @extend %osd; 2983 2984// padding: 4px; /* not working */ 2985border-radius: 2px; 2986box-shadow: none; // otherwise it gets inherited by windowframe.csd 2987 2988&:not(.csd) { 2989border: 1px solid $borders_color; 2990border-radius: 2px + 1px; 2991background-clip: $extra_background_clip; 2992} 2993 2994// FIXME: we need a border or tooltips vanish on black background. 2995decoration { background-color: transparent; } 2996 2997label { 2998// tooltip label has already 6px margins 2999min-height: 32px - 6px * 2; 3000padding: 0 8px - 6px; 3001} 3002 3003* { 3004// workaround for Eclipse. 3005// do not include any declaration here. 3006// padding: 0; 3007// background-color: transparent; 3008// color: inherit; 3009} 3010} 3011 3012 3013/***************** 3014* Color Chooser * 3015*****************/ 3016colorswatch { 3017// This widget is made of two boxes one on top of the other, the lower box is colorswatch {} the other one 3018// is colorswatch overlay {}, colorswatch has the programmatically set background, so most of the style is 3019// applied to the overlay box. 3020 3021// base color corners rounding 3022// to avoid the artifacts caused by rounded corner anti-aliasing the base color 3023// sports a bigger radius. 3024// nth-child is needed by the custom color strip. 3025 3026&.top { 3027border-top-left-radius: $md_radius + 0.5px; 3028border-top-right-radius: $md_radius + 0.5px; 3029 3030overlay { 3031border-top-left-radius: $md_radius; 3032border-top-right-radius: $md_radius; 3033} 3034} 3035 3036&.bottom { 3037border-bottom-left-radius: $md_radius + 0.5px; 3038border-bottom-right-radius: $md_radius + 0.5px; 3039 3040overlay { 3041border-bottom-left-radius: $md_radius; 3042border-bottom-right-radius: $md_radius; 3043} 3044} 3045 3046&.left, 3047&:first-child:not(.top) { 3048border-top-left-radius: $md_radius + 0.5px; 3049border-bottom-left-radius: $md_radius + 0.5px; 3050 3051overlay { 3052border-top-left-radius: $md_radius; 3053border-bottom-left-radius: $md_radius; 3054} 3055} 3056 3057&.right, 3058&:last-child:not(.bottom) { 3059border-top-right-radius: $md_radius + 0.5px; 3060border-bottom-right-radius: $md_radius + 0.5px; 3061 3062overlay { 3063border-top-right-radius: $md_radius; 3064border-bottom-right-radius: $md_radius; 3065} 3066} 3067 3068&.dark overlay { color: $dark_contrast_color; } 3069 3070&.light overlay { color: $light_contrast_color; } 3071 3072&.dark { color: $dark_contrast_color; } // for focus ring 3073 3074&.light { color: $light_contrast_color; } // for focus ring 3075 3076&:drop(active) { 3077box-shadow: none; 3078 3079&.light overlay { 3080box-shadow: $z-depth-1, 0 0 0 2px $accent_color; 3081} 3082 3083&.dark overlay { 3084box-shadow: $z-depth-1, 0 0 0 2px $accent_color; 3085} 3086} 3087 3088overlay { 3089transition: $shadow_transition; 3090box-shadow: $z-depth-1; 3091 3092&:hover { box-shadow: $z-depth-2; } 3093} 3094 3095&#add-color-button { 3096border-radius: $md_radius $md_radius 0 0; 3097color: $dark_contrast_color; // for focus ring 3098 3099&:only-child { border-radius: $md_radius; } 3100 3101overlay { 3102background-image: linear-gradient(to right, 3103$error_bg_color 25%, 3104$warning_bg_color 25%, $warning_bg_color 50%, 3105$info_bg_color 50%, $info_bg_color 75%, 3106$question_bg_color 75%); 3107color: $dark_contrast_color; 3108} 3109} 3110 3111&:disabled { 3112opacity: $disabled_opacity; 3113 3114overlay { box-shadow: none; } 3115} 3116 3117row:selected & { 3118} 3119 3120&#editor-color-sample { 3121border-radius: $md_radius + 0.5px; 3122 3123overlay { border-radius: $md_radius; } 3124 3125// overlay:hover { box-shadow: $z-depth-1; } 3126} 3127} 3128 3129// colorscale popup 3130colorchooser .popover.osd { 3131transition: $shadow_transition; 3132border-radius: 2px; 3133box-shadow: $z-depth-2, inset 0 1px $highlight_color; 3134background-color: $base_color; 3135 3136&:backdrop { box-shadow: $z-depth-1, inset 0 1px $highlight_color; } 3137 3138spinbutton:not(.vertical) { @extend %entry.flat; } 3139} 3140 3141 3142/******** 3143* Misc * 3144********/ 3145//content view (grid/list) 3146.content-view { 3147background-color: $bg_color; 3148 3149// &:hover { -gtk-icon-effect: highlight; } 3150 3151rubberband { @extend rubberband; } 3152} 3153 3154.scale-popup { 3155.osd & { @extend %osd; } 3156 3157.osd & button.flat { //FIXME: quick hack, redo properly 3158} 3159 3160button { // +/- buttons on GtkVolumeButton popup 3161} 3162} 3163 3164 3165/********************** 3166* Window Decorations * 3167*********************/ 3168decoration { 3169transition: $shadow_transition; 3170border-radius: 2px 2px 0 0; 3171box-shadow: $z-depth-4, 0 16px 16px transparent; 3172 3173// FIXME rationalize shadows 3174 3175// this is used for the resize cursor area 3176margin: 8px; 3177 3178&:backdrop { 3179// the transparent shadow here is to enforce that the shadow extents don't 3180// change when we go to backdrop, to prevent jumping windows. 3181// The biggest shadow should be in the same order then in the active state 3182// or the jumping will happen during the transition. 3183box-shadow: $z-depth-2, 0 16px 16px transparent; 3184} 3185 3186.maximized &, 3187.fullscreen &, 3188.tiled & { border-radius: 0; } 3189 3190.popup & { box-shadow: none; } 3191 3192// server-side decorations as used by mutter 3193.ssd & { box-shadow: 0 3px 3px rgba(0, 0, 0, 0.16); } //just doing borders, wm draws actual shadows 3194 3195.csd.popup & { 3196border-radius: 2px; 3197box-shadow: $z-depth-2; 3198} 3199 3200tooltip.csd & { 3201border-radius: 2px; 3202box-shadow: $z-depth-2; 3203} 3204 3205messagedialog.csd & { 3206border-radius: 2px; 3207// box-shadow: $z-depth-4, 0 16px 16px transparent; 3208 3209// &:backdrop { box-shadow: $z-depth-2, 0 16px 16px transparent; } 3210} 3211 3212.solid-csd & { 3213margin: 0; 3214padding: 4px; 3215// border: solid 1px $borders_color; 3216// border-radius: 0; 3217box-shadow: inset 0 0 0 4px $headerbar_color; 3218// background-color: $borders_color; 3219} 3220} 3221 3222// Window Close button 3223button.titlebutton { 3224// @extend %simple_flat_button; 3225 3226@extend %circular_button; 3227 3228.selection-mode & { 3229} 3230} 3231 3232 3233// catch all extend :) 3234 3235%selected_items { 3236background-color: $primary_color; 3237 3238@at-root %nobg_selected_items, & { 3239color: $inversed_fg_color; 3240 3241&:disabled { color: $disabled_inversed_fg_color; } 3242} 3243} 3244 3245.monospace { font-family: monospace; } 3246 3247 3248/********************** 3249* Touch Copy & Paste * 3250*********************/ 3251//touch selection handlebars for the Popover.osd above 3252cursor-handle { 3253border-radius: $circular_radius; 3254background-color: $accent_color; 3255background-image: none; 3256 3257&.top:dir(ltr), &.bottom:dir(rtl) { 3258padding-left: 6px; 3259border-top-right-radius: 0; 3260} 3261 3262&.bottom:dir(ltr), &.top:dir(rtl) { 3263padding-right: 6px; 3264border-top-left-radius: 0; 3265} 3266 3267&.insertion-cursor:dir(ltr), &.insertion-cursor:dir(rtl) { 3268-GtkWidget-text-handle-width: 24; 3269-GtkWidget-text-handle-height: 30; 3270 3271$_url: 'assets/slider-horz-scale-has-marks-above#{$asset_suffix}'; 3272-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'), 3273url('#{$_url}@2.png')); 3274} 3275} 3276 3277.context-menu { font: initial; } // Decouple the font of context menus from their entry/textview 3278 3279%circular_button, 3280button.close, 3281button.circular { // FIXME: aggregate to buttons 3282border-radius: $circular_radius; 3283-gtk-outline-radius: $circular_radius; 3284 3285// label { padding: 0; } 3286} 3287 3288%small_button { 3289min-height: $small_size; 3290min-width: $small_size; 3291padding: 0; 3292border-radius: $circular_radius; 3293-gtk-outline-radius: $circular_radius; 3294} 3295 3296// shortcut window keys 3297.keycap { 3298min-width: 28px - 8px * 2; 3299min-height: 28px - 2px; 3300margin-top: 2px; 3301padding-bottom: 2px; 3302padding-left: 8px; 3303padding-right: 8px; 3304 3305border: solid 1px $borders_color; 3306border-radius: 2px + 1px; 3307box-shadow: inset 0 -2px $borders_color; 3308background-color: $base_color; 3309color: $fg_color; 3310font-size: smaller; 3311} 3312 3313*:drop(active) { // FIXME needs to be done widget by widget, this wildcard should really die 3314transition: $longer_transition; 3315box-shadow: $z-depth-1, inset 0 0 0 2px $accent_color; 3316caret-color: $accent_color; 3317} 3318 3319stackswitcher button.text-button { min-width: 100px; } // FIXME aggregate with buttons 3320 3321stackswitcher button.circular, 3322stackswitcher button.text-button.circular { // FIXME aggregate with buttons 3323min-width: $medium_size; 3324min-height: $medium_size; 3325padding: 0; 3326} 3327