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