_common-3.20.scss
ASCII text
1* { 2// padding: 0; 3 4-GtkToolButton-icon-spacing: 0; 5-GtkTextView-error-underline-color: $error; 6 7// The size for scrollbars. The slider is 2px smaller, but we keep it 8// up so that the whole area is sensitive to button presses for the 9// slider. The stepper button is larger in both directions, the slider 10// only in the width 11 12-GtkScrolledWindow-scrollbar-spacing: 0; 13 14-GtkToolItemGroup-expander-size: 11; 15 16-GtkWidget-text-handle-width: 24; 17-GtkWidget-text-handle-height: 24; 18 19-GtkDialog-button-spacing: $container-padding / 1px; 20-GtkDialog-action-area-border: $container-padding / 1px; 21 22-gtk-secondary-caret-color: $primary; 23 24// We use the outline properties to signal the focus properties 25// to the adwaita engine: using real CSS properties is faster, 26// and we don't use any outlines for now. 27 28outline: 2px solid transparent; 29outline-offset: -4px; 30-gtk-outline-radius: $corner-radius; 31 32&:focus { 33outline-color: overlay("focus", $on-surface); 34} 35} 36 37/** 38* Base States 39*/ 40 41.background { 42background-color: $surface-z0; 43color: $on-surface; 44} 45 46/* 47These wildcard seems unavoidable, need to investigate. 48Wildcards are bad and troublesome, use them with care, 49or better, just don't. 50Everytime a wildcard is used a kitten dies, painfully. 51*/ 52 53*:disabled { 54-gtk-icon-effect: dim; 55} 56 57.gtkstyle-fallback { 58background-color: $surface-z0; 59color: $on-surface; 60 61&:hover { 62background-color: darken($surface-z0, 5%); 63} 64 65&:active { 66background-color: darken($surface-z0, 10%); 67} 68 69&:disabled { 70color: disabled($on-surface); 71} 72 73&:selected { 74background-color: $primary; 75color: $on-primary; 76} 77} 78 79.view { 80// background-color: $surface-z0; 81// color: $on-surface; 82 83&:hover { 84background-color: overlay("hover-alt", $on-surface); 85} 86 87&:selected:hover { 88background-color: overlay("hover-alt", $primary, $on: $overlay-selected); 89} 90 91&:disabled { 92color: disabled($on-surface); 93} 94 95&:hover, 96&:selected { 97border-radius: $corner-radius; 98} 99 100selection, 101&:selected { 102background-color: $overlay-selected; 103} 104} 105 106textview { 107// FIXME: we need to override background-color to ensure text rendering 108text { 109background-color: $surface-z0; 110caret-color: $primary; 111} 112 113border { 114// background-color: $surface-z0; 115color: hint($on-surface); // FIXME: not working 116} 117} 118 119iconview { 120// @extend .view; 121} 122 123%iconview-desktop { 124// background-color: $scrim; 125color: $on-dark; 126text-shadow: $text-shadow; 127 128.rubberband, 129rubberband { 130border: 1px solid primary($on-dark); 131background-color: rgba(primary($on-dark), .3); 132} 133} 134 135%rubberband, 136.rubberband, 137rubberband { 138border: 1px solid $primary; 139background-color: rgba($primary, .24); 140} 141 142flowbox { 143rubberband { 144@extend %rubberband; 145} 146 147flowboxchild { 148padding: 4px; 149border-radius: $corner-radius; 150 151&:selected { 152background-color: $overlay-selected; 153} 154} 155} 156 157.content-view .tile { 158// margin: 2px; 159// padding: 0; 160// border-radius: 0; 161// background-color: black; 162 163&:selected { 164background-color: transparent; 165} 166} 167 168label { 169caret-color: $primary; // this shouldn't be needed. 170 171&.separator { 172color: hint($on-surface); 173} 174 175&.error { 176color: $error; 177} 178 179selection { 180background-color: $overlay-selected; 181} 182 183&:disabled { 184color: disabled($on-surface); 185 186headerbar &, 187menuitem &, 188tab &, 189button & { 190color: inherit; 191} 192} 193 194&.osd { 195border-radius: $corner-radius; 196background-color: $tooltip; 197color: $on-tooltip; 198} 199} 200 201.dim-label { 202color: hint($on-surface); 203} 204 205assistant { 206.sidebar { 207padding: 4px 0; 208} 209 210.sidebar label { 211min-height: $medium-size; 212margin: 0 4px; 213padding: 0 8px; 214border-radius: $corner-radius; 215color: disabled($on-surface); 216font-weight: 500; 217 218&.highlight { 219background-color: overlay("activated", $primary); 220color: $primary; 221} 222} 223} 224 225%osd, 226.osd { 227// opacity: .9; 228} 229 230/** 231* Spinner Animation 232*/ 233 234@keyframes spin { 235to { 236-gtk-icon-transform: rotate(1turn); 237} 238} 239 240spinner { 241background: none; 242opacity: 0; // non spinning spinner makes no sense 243color: $primary; 244-gtk-icon-source: -gtk-icontheme('process-working-symbolic'); 245transition: opacity $duration * 4 $ease-out; 246animation: spin 1s linear infinite; 247 248&:checked { 249opacity: 1; 250} 251 252&:disabled { 253color: disabled-hint($on-surface); 254} 255} 256 257/** 258* General Typography 259*/ 260 261@function pt($size: $font-size) { 262@return ($size * .75 / 1px) * 1pt; 263} 264 265.large-title { 266font-weight: 400; 267font-size: pt(48px); 268} 269 270.title-1 { 271font-weight: 400; 272font-size: pt(34px); 273letter-spacing: pt(.25px); 274} 275 276.title-2 { 277font-weight: 400; 278font-size: pt(24px); 279} 280 281.title-3 { 282font-weight: 500; 283font-size: pt(20px); 284letter-spacing: pt(.15px); 285} 286 287.title-4 { 288font-weight: 400; 289font-size: pt(16px); 290letter-spacing: pt(.5px); 291} 292 293.heading { 294font-weight: 500; 295font-size: 1em; 296} 297 298.body { 299font-weight: 400; 300font-size: 1em; 301} 302 303.caption-heading { 304font-weight: 500; 305font-size: pt(12px); 306letter-spacing: pt(1.5px); 307} 308 309.caption { 310font-weight: 400; 311font-size: pt(12px); 312letter-spacing: pt(.4px); 313} 314 315/** 316* Text Entries 317*/ 318 319%entry, 320entry { 321min-height: $medium-size; 322padding: 0 8px; 323border-radius: $corner-radius $corner-radius 0 0; 324 325@include entry(normal); 326 327&:focus { 328@include entry(checked); 329} 330 331&:drop(active) { 332@include entry(hover); 333} 334 335&:disabled { 336@include entry(disabled); 337} 338 339&.flat { 340min-height: 0; 341padding: 2px; 342border-radius: 0; 343background-color: transparent; 344} 345 346// icons inside the entry 347image { 348color: hint($on-surface); 349 350&:hover, 351&:active { 352color: $on-surface; 353} 354 355&:disabled { 356color: disabled($on-surface); 357} 358 359&.left { 360margin-left: ($medium-size - 16px) / 2 - 8px; 361margin-right: 6px; 362} 363 364&.right { 365margin-left: 6px; 366margin-right: ($medium-size - 16px) / 2 - 8px; 367} 368} 369 370undershoot { 371&.left { 372// @include undershoot(left); 373} 374 375&.right { 376// @include undershoot(right); 377} 378} 379 380selection { 381background-color: $overlay-selected; 382} 383 384// entry error and warning style 385@each $class, $color in (".error": $error, ".warning": $warning) { 386&#{$class} { 387@include entry(normal, $color); 388 389&:focus { 390@include entry(checked, $color); 391} 392 393&:disabled { 394@include entry(disabled, $color); 395} 396} 397} 398 399.osd & { 400} 401 402progress { 403margin: 0 -8px -4px; 404border-bottom: 2px solid $primary; 405background-color: transparent; 406} 407 408// linked entries 409.linked:not(.vertical) > & { 410@extend %linked; 411} 412 413// Vertically linked entries 414.linked.vertical > & { 415@extend %linked-vertical; 416} 417} 418 419%entry_raised { 420border-radius: $corner-radius; 421 422@include entry(raised-normal); 423 424&:focus { 425@include entry(raised-focus); 426} 427 428&:drop(active) { 429@include entry(raised-hover); 430} 431 432&:disabled { 433@include entry(raised-disabled); 434} 435 436// entry error and warning style 437@each $class, $color in (".error": $error, ".warning": $warning) { 438&#{$class} { 439@include entry(raised-normal, $color); 440 441&:focus { 442@include entry(raised-focus, $color); 443} 444 445&:disabled { 446@include entry(raised-disabled, $color); 447} 448 449image { 450color: hint(on($color)); 451 452&:hover, 453&:active { 454color: on($color); 455} 456 457&:disabled { 458color: disabled(on($color)); 459} 460} 461} 462} 463} 464 465treeview entry { 466&, 467&.flat { 468background-color: $surface-z1; 469 470&, 471&:focus { 472border-image: none; 473box-shadow: none; 474} 475} 476} 477 478.entry-tag { 479margin: 2px; 480border-radius: $circular-radius; 481box-shadow: none; 482background-color: fill($on-surface); 483color: $on-surface; 484 485&:hover { 486background-image: image(overlay("hover", $on-surface)); 487} 488 489// side margins: compensate the entry padding with a negative margin 490// then the negative margin itself 491:dir(ltr) & { 492margin-left: 4px; 493margin-right: 0; 494padding-left: 12px; 495padding-right: 8px; 496} 497 498:dir(rtl) & { 499margin-left: 0; 500margin-right: 4px; 501padding-left: 8px; 502padding-right: 12px; 503} 504 505// seems any sizing doesn't work 506&.button { 507box-shadow: none; 508background-color: transparent; 509color: hint($on-surface); 510} 511} 512 513/** 514* Buttons 515*/ 516 517// stuff for .needs-attention 518@keyframes needs-attention { 519from { 520background-image: 521-gtk-gradient( 522radial, 523center center, 0, 524center center, .001, 525to($primary), 526to(transparent) 527); 528} 529 530to { 531background-image: 532-gtk-gradient( 533radial, 534center center, 0, 535center center, .5, 536to($primary), 537to(transparent) 538); 539} 540} 541 542%button, 543button { 544min-height: 24px; 545min-width: 16px; 546padding: ($medium-size - 24px) / 2 ($medium-size - 16px) / 2; 547border-radius: $corner-radius; 548color: $on-surface; 549font-weight: 500; 550 551@extend %ripple; 552@include ink-color($on-surface, $button-style: "raised", $on: $surface-z8); 553 554&:disabled { 555box-shadow: none; 556background-color: fill($on-surface); 557color: disabled($on-surface); 558} 559 560&:checked { 561$background-color: overlay("activated", $primary, $on: $surface-z8); 562color: $primary; 563@include ink-color($primary, $button-style: "raised", $on: $background-color); 564 565&:disabled { 566box-shadow: none; 567background-color: overlay("activated", $on-surface, $on: fill($on-surface)); 568color: disabled($on-surface); 569} 570} 571 572&.text-button { 573min-width: 64px - 16px * 2; 574padding-left: 16px; 575padding-right: 16px; 576} 577 578&.image-button { 579min-width: 24px; 580padding: ($medium-size - 24px) / 2; 581border-radius: $circular-radius; 582} 583 584// NOTE: Some image-only buttons use this as well 585&.text-button.image-button { 586min-width: 24px; 587padding: ($medium-size - 24px) / 2; 588border-radius: $corner-radius; 589 590label { 591&:first-child { 592margin-left: 16px - ($medium-size - 24px) / 2; 593} 594 595&:last-child { 596margin-right: 16px - ($medium-size - 24px) / 2; 597} 598} 599 600image:not(:only-child) { 601margin: 0 (24px - 16px) / 2; 602} 603} 604 605.linked:not(.vertical) > & { 606@extend %linked; 607 608&.image-button:not(.text-button) { 609@extend %linked-image-button; 610} 611} 612 613.linked.vertical > & { 614@extend %linked-vertical; 615 616&.image-button:not(.text-button) { 617@extend %linked-vertical-image-button; 618} 619} 620} 621 622%button-flat-basic { 623color: hint($on-surface); 624@include ink-color($on-surface, $button-style: "flat"); 625 626&:disabled { 627background-color: transparent; 628color: disabled-hint($on-surface); 629} 630} 631 632%button-flat-activatable { 633@extend %button-flat-basic; 634 635&:checked { 636$background-color: overlay("activated", $primary); 637color: $primary; 638@include ink-color($primary, $button-style: "flat", $on: $background-color); 639 640&:disabled { 641color: disabled($on-surface); 642} 643} 644} 645 646%button-flat, 647button.flat { 648@extend %button-flat-activatable; 649 650&.text-button { 651min-width: 64px - 8px * 2; 652padding-left: 8px; 653padding-right: 8px; 654} 655 656&.text-button.image-button { 657min-width: 24px; 658padding: ($medium-size - 24px) / 2; 659 660label { 661&:first-child { 662margin-left: 12px - ($medium-size - 24px) / 2; 663} 664 665&:last-child { 666margin-right: 12px - ($medium-size - 24px) / 2; 667} 668} 669} 670 671.linked:not(.vertical) > &, 672.linked.vertical > & { 673&:not(:only-child) { // specificity bump 674border-radius: $corner-radius; 675 676&.image-button:not(.text-button) { 677border-radius: $circular-radius; 678} 679} 680} 681} 682 683button { 684// big standalone buttons like in Documents pager 685&.osd { 686padding: ($large-size - 24px) / 2 ($large-size - 16px) / 2; 687 688&.image-button { 689padding: ($large-size - 24px) / 2; 690} 691 692&:disabled { 693opacity: 0; 694} 695} 696 697// overlay / OSD style 698@at-root %osd_button, 699.osd & { 700} 701 702// Suggested and Destructive Action buttons 703@each $class, $color in (".suggested-action": $primary, ".destructive-action": $error) { 704&#{$class} { 705color: on($color); 706@include ink-color(on($color), $button-style: "raised", $on: $color); 707 708&:disabled { 709box-shadow: none; 710background-color: fill($on-surface); 711color: disabled($on-surface); 712} 713 714&:checked { 715$background-color: overlay("activated", on($color), $on: $color); 716@include ink-color(on($color), $button-style: "raised", $on: $background-color); 717} 718 719&.flat { 720color: $color; 721@include ink-color($color, $button-style: "flat"); 722 723&:disabled { 724box-shadow: none; 725background-color: transparent; 726color: disabled-hint($on-surface); 727} 728 729&:checked { 730$background-color: overlay("activated", $color); 731@include ink-color($color, $button-style: "flat", $on: $background-color); 732} 733} 734 735.osd & { 736} 737} 738} 739 740.stack-switcher > & { 741// to position the needs attention dot, padding is added to the button 742// child, a label needs just lateral padding while an icon needs vertical 743// padding added too. 744 745> label { 746margin: 0 -6px; 747padding: 0 6px; 748} 749 750> image { 751margin: -3px -6px; 752padding: 3px 6px; 753} 754 755&.needs-attention { 756> label, 757> image { 758@extend %needs-attention; 759} 760 761&:checked { 762> label, 763> image { 764animation: none; 765background-image: none; 766} 767} 768} 769} 770 771// hide separators 772&.font, 773&.file { 774separator { 775@extend %hide_separators; 776} 777} 778 779&.font { 780> box > box > label { 781// font-weight: bold; 782} 783} 784 785// inline-toolbar buttons 786.inline-toolbar & { 787// @extend %button-flat; 788 789&:not(.text-button) { 790border-radius: $circular-radius; 791} 792} 793 794.primary-toolbar & { 795-gtk-icon-shadow: none; // tango icons don't need shadows 796} 797 798&.close, 799&.circular { // The Bloody Circul Button 800border-radius: $circular-radius; 801 802label { 803// padding: 0; 804} 805} 806} 807 808%button-small { 809min-height: $small-size; 810min-width: $small-size; 811padding: 0; 812border-radius: $circular-radius; 813} 814 815%needs-attention { 816animation: needs-attention $ripple-fade-in-duration $ease-out forwards; 817background-repeat: no-repeat; 818background-position: right 3px; 819background-size: 6px 6px; 820 821&:dir(rtl) { 822background-position: left 3px; 823} 824} 825 826// all the following is for the +|- buttons on inline toolbars, that way 827// should really be deprecated... 828.inline-toolbar toolbutton > button { 829} 830 831// More inline toolbar buttons 832toolbar.inline-toolbar toolbutton { 833&:not(:first-child) > button.flat { 834// @extend %linked-not-first-child; 835} 836 837&:not(:last-child) > button.flat { 838// @extend %linked-not-last-child; 839} 840} 841 842%linked-not-first-child { 843border-top-left-radius: 0; 844border-bottom-left-radius: 0; 845} 846 847%linked-not-last-child { 848border-top-right-radius: 0; 849border-bottom-right-radius: 0; 850} 851 852%linked { 853&:not(:first-child) { 854@extend %linked-not-first-child; 855} 856 857&:not(:last-child) { 858@extend %linked-not-last-child; 859} 860} 861 862%linked-vertical-not-first-child { 863border-top-left-radius: 0; 864border-top-right-radius: 0; 865} 866 867%linked-vertical-not-last-child { 868border-bottom-left-radius: 0; 869border-bottom-right-radius: 0; 870} 871 872%linked-vertical { 873&:not(:first-child) { 874@extend %linked-vertical-not-first-child; 875} 876 877&:not(:last-child) { 878@extend %linked-vertical-not-last-child; 879} 880} 881 882%linked-image-button { 883&:first-child { 884border-top-left-radius: $corner-radius; 885border-bottom-left-radius: $corner-radius; 886} 887 888&:last-child { 889border-top-right-radius: $corner-radius; 890border-bottom-right-radius: $corner-radius; 891} 892 893&:only-child { 894border-radius: $circular-radius; 895} 896} 897 898%linked-vertical-image-button { 899&:first-child { 900border-top-left-radius: $corner-radius; 901border-top-right-radius: $corner-radius; 902} 903 904&:last-child { 905border-bottom-left-radius: $corner-radius; 906border-bottom-right-radius: $corner-radius; 907} 908 909&:only-child { 910border-radius: $circular-radius; 911} 912} 913 914/* menu buttons */ 915modelbutton.flat, 916.menuitem.button.flat { 917min-height: $menuitem-size; 918padding: 0 8px; 919border-radius: $corner-radius; 920 921@extend %ripple; 922@include ink-color($on-surface); 923 924&:selected { 925background-color: $overlay-selected; 926} 927} 928 929modelbutton.flat arrow { 930transition: color $duration $ease-out; 931color: hint($on-surface); 932 933&:disabled { 934color: disabled-hint($on-surface); 935} 936 937&.left { 938-gtk-icon-source: -gtk-icontheme("pan-start-symbolic"); 939} 940 941&.right { 942-gtk-icon-source: -gtk-icontheme("pan-end-symbolic"); 943} 944} 945 946button.color { 947min-height: $small-size; 948min-width: $small-size; 949padding: $container-padding; 950 951colorswatch:only-child { 952&, 953overlay { 954// border-radius: 0; 955} 956} 957} 958 959/** 960* Links 961*/ 962 963*:link { 964color: $primary; 965 966&:disabled { 967color: disabled($on-surface); 968} 969} 970 971*:visited { 972color: $visited; 973 974&:disabled { 975color: disabled($on-surface); 976} 977} 978 979button.link { 980&:link { 981color: $primary; 982@include ink-color($primary, $button-style: "flat"); 983} 984 985&:visited { 986color: $visited; 987@include ink-color($visited, $button-style: "flat"); 988} 989 990&:disabled { 991color: disabled($on-surface); 992} 993 994> label { 995text-decoration-line: underline; 996} 997} 998 999/** 1000* GtkSpinButton 1001*/ 1002 1003spinbutton { 1004&:not(.vertical) { 1005// in this horizontal configuration, the whole spinbutton 1006// behaves as the entry, so we extend the entry styling 1007// and nuke the style on the internal entry 1008@extend %entry; 1009 1010padding: 0; 1011 1012entry { 1013min-width: $large-size - 8px * 2; 1014// reset all the other props since the spinbutton node is styled here 1015margin: 0; 1016border-image: none; 1017border-radius: 0; 1018box-shadow: none; 1019background-color: transparent; 1020} 1021 1022button { 1023@extend %button-flat-basic; 1024@extend %button-small; 1025 1026// margin: $container-padding; 1027border: solid $container-padding transparent; 1028background-clip: padding-box; 1029 1030// Remove unwanted focus indicator 1031&:focus:not(:hover):not(:active) { 1032background-color: transparent; 1033} 1034 1035&.up:dir(ltr), 1036&.down:dir(rtl) { 1037margin-left: -$container-padding / 2; 1038} 1039 1040&.up:dir(rtl), 1041&.down:dir(ltr) { 1042margin-right: -$container-padding / 2; 1043} 1044} 1045} 1046 1047// OSD horizontal 1048.osd &:not(.vertical) { 1049} 1050 1051// Vertical 1052&.vertical { 1053// in the vertical configuration, we treat the spinbutton 1054// as a box, and tweak the style of the entry in the middle 1055// so that it's linked 1056 1057// FIXME: this should not be set at all, but otherwise it gets the wrong 1058// color 1059caret-color: $primary; 1060 1061// FIXME: this should not be set at all, but otherwise it gets the wrong 1062// color 1063&:disabled { 1064color: disabled($on-surface); 1065} 1066 1067entry { 1068@extend %entry_raised; 1069 1070min-height: $medium-size; 1071min-width: $large-size; 1072padding: 0; 1073} 1074 1075button { 1076min-height: $medium-size; 1077min-width: $large-size; 1078padding: 0; 1079 1080@extend %button-flat-basic; 1081 1082// Remove unwanted focus indicator 1083&:focus:not(:hover):not(:active) { 1084background-color: transparent; 1085} 1086 1087&.up { 1088border-radius: $corner-radius $corner-radius 0 0; 1089} 1090 1091&.down { 1092border-radius: 0 0 $corner-radius $corner-radius; 1093} 1094} 1095} 1096 1097// OSD vertical 1098.osd &.vertical { 1099} 1100 1101// Misc 1102treeview &:not(.vertical) { 1103min-height: 0; 1104border-style: none; 1105border-radius: 0; 1106 1107entry { 1108min-height: 0; 1109padding: 1px 2px; 1110} 1111} 1112} 1113 1114/** 1115* ComboBoxes 1116*/ 1117 1118combobox { 1119arrow { 1120transition: -gtk-icon-transform $duration $ease-out; 1121-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 1122min-height: 16px; 1123min-width: 16px; 1124} 1125 1126button.combo:checked arrow { 1127// color: $primary; 1128-gtk-icon-transform: rotate(-.5turn); 1129} 1130 1131// workaround for menuitem selection 1132decoration { 1133transition: none; 1134} 1135 1136// remove hard-coded 2px padding 1137cellview { 1138margin: -2px; 1139} 1140 1141button.combo cellview { 1142&:dir(ltr) { 1143margin-left: -2px + 8px - ($medium-size - 16px) / 2; 1144} 1145 1146&:dir(rtl) { 1147margin-right: -2px + 8px - ($medium-size - 16px) / 2; 1148} 1149} 1150 1151menu { 1152padding: 2px 0; 1153 1154menuitem { 1155min-height: $medium-size - 2px * 2; 1156padding: 0 8px; 1157} 1158 1159// overflow arrows 1160> arrow { 1161&.top { 1162margin-top: -2px; 1163} 1164 1165&.bottom { 1166margin-top: 2px * 2; 1167margin-bottom: -2px * 3; 1168} 1169} 1170} 1171 1172> .linked:not(.vertical) > entry:not(:only-child) { 1173border-radius: $corner-radius $corner-radius 0 0; 1174 1175&:first-child { 1176margin-right: -$medium-size; 1177padding-right: $medium-size; 1178} 1179 1180&:last-child { 1181margin-left: -$medium-size; 1182padding-left: $medium-size; 1183} 1184} 1185 1186> .linked:not(.vertical) > button:not(:only-child) { 1187@extend %button-flat-basic; 1188// @extend %button-small; 1189 1190min-height: 16px; 1191min-width: 16px; 1192margin: ($medium-size - $small-size) / 2; 1193padding: ($small-size - 16px) / 2; 1194border-radius: $circular-radius; 1195} 1196} 1197 1198// the combo is a composite widget so the way we do button linking doesn't 1199// work, special case needed. See 1200// https://bugzilla.gnome.org/show_bug.cgi?id=733979 1201 1202.linked:not(.vertical) > combobox { 1203&:not(:first-child) > box > button.combo { 1204@extend %linked-not-first-child; 1205} 1206 1207&:not(:last-child) > box > button.combo { 1208@extend %linked-not-last-child; 1209} 1210} 1211 1212.linked.vertical > combobox { 1213&:not(:first-child) > box > button.combo { 1214@extend %linked-vertical-not-first-child; 1215} 1216 1217&:not(:last-child) > box > button.combo { 1218@extend %linked-vertical-not-last-child; 1219} 1220} 1221 1222button.combo:only-child { 1223border-radius: $corner-radius $corner-radius 0 0; 1224font-weight: normal; 1225 1226@include entry(normal); 1227 1228&:focus { 1229@include entry(focus); 1230} 1231 1232&:drop(active), 1233&:hover { 1234@include entry(hover); 1235} 1236 1237&:checked { 1238@include entry(checked); 1239} 1240 1241&:disabled { 1242@include entry(disabled); 1243} 1244 1245arrow { 1246transition: color $duration $ease-out; 1247color: hint($on-surface); 1248 1249&:disabled { 1250color: disabled-hint($on-surface); 1251} 1252} 1253} 1254 1255/** 1256* Toolbars 1257*/ 1258 1259toolbar { 1260-GtkWidget-window-dragging: true; 1261padding: 2px; 1262 1263button { 1264@extend %button-flat; 1265} 1266 1267// on OSD 1268.osd & { 1269} 1270 1271// stand-alone OSD toolbars 1272&.osd { 1273@extend %toolbar-osd; 1274 1275// positional classes for `attached` osd toolbars 1276&.left, 1277&.right, 1278&.top, 1279&.bottom { 1280border-radius: 0; 1281} 1282 1283&.bottom { 1284box-shadow: none; 1285background-color: transparent; 1286background-image: 1287linear-gradient( 1288to bottom, 1289transparent, 1290rgba(black, .1) 30%, 1291rgba(black, .2) 50%, 1292rgba(black, .4) 1293); 1294} 1295} 1296 1297// toolbar separators 1298&.horizontal > separator { 1299margin: 2px; 1300} 1301 1302&.vertical > separator { 1303margin: 2px; 1304} 1305 1306&:not(.inline-toolbar):not(.osd) { 1307scale, 1308entry, 1309spinbutton, 1310button { 1311margin: 2px; 1312} 1313 1314.linked entry, 1315.linked spinbutton, 1316.linked button { 1317&:not(:first-child) { 1318margin-left: 0; 1319} 1320 1321&:not(:last-child) { 1322margin-right: 0; 1323} 1324} 1325 1326spinbutton { 1327entry, 1328button { 1329margin: 0; 1330} 1331} 1332 1333switch { 1334margin: 2px + $container-padding 2px; 1335} 1336} 1337} 1338 1339%toolbar-osd { 1340transition: $transition-shadow; 1341padding: $container-padding; 1342border-radius: $corner-radius; 1343box-shadow: $shadow-z4, inset 0 1px highlight($surface-z8); 1344background-color: $surface-z8; 1345 1346&:backdrop { 1347box-shadow: $shadow-z2, inset 0 1px highlight($surface-z8); 1348} 1349} 1350 1351// searchbar, location-bar & inline-toolbar 1352.inline-toolbar { 1353padding: $container-padding; 1354border-style: solid; 1355border-width: 0 1px 1px; 1356border-color: divider($on-surface); 1357background-color: $surface-z1; 1358background-clip: padding-box; 1359} 1360 1361searchbar > revealer > box, 1362.location-bar { 1363padding: $container-padding; 1364border-style: solid; 1365border-width: 0 0 1px; 1366border-color: divider($on-surface); 1367} 1368 1369searchbar > revealer > box { 1370// workaround: undo the GtkContainer:border-width and use CSS padding instead 1371margin: -6px; 1372padding: $container-padding; 1373} 1374 1375/** 1376* Header bars 1377*/ 1378 1379.titlebar { 1380transition: background-color $duration $ease-out, color $duration $ease-out; 1381border-radius: $corner-radius $corner-radius 0 0; 1382box-shadow: $shadow-z1, inset 0 1px highlight($titlebar); 1383background-color: $titlebar; 1384color: $on-titlebar; 1385 1386&:disabled { 1387color: disabled($on-titlebar); 1388} 1389 1390&:backdrop { 1391background-color: $titlebar-backdrop; 1392color: hint($on-titlebar); 1393 1394&:disabled { 1395color: disabled-hint($on-titlebar); 1396} 1397} 1398 1399.title { 1400padding-left: 12px; 1401padding-right: 12px; 1402font-weight: bold; 1403} 1404 1405.subtitle { 1406padding-left: 12px; 1407padding-right: 12px; 1408font-size: smaller; 1409} 1410 1411.subtitle, 1412.dim-label { 1413transition: color $duration $ease-out; 1414color: hint($on-titlebar); 1415 1416&:backdrop { 1417color: disabled($on-titlebar); 1418} 1419} 1420 1421// Don't draw titlebar above titlebar 1422.titlebar { 1423background-color: transparent; 1424box-shadow: none; 1425} 1426 1427// The separator for split headerbars 1428headerbar + separator { 1429background-color: divider($on-titlebar); 1430} 1431 1432entry { 1433box-shadow: inset 0 -1px stroke($on-titlebar); 1434background-color: entry-fill($on-titlebar); 1435color: $on-titlebar; 1436 1437&:disabled { 1438box-shadow: inset 0 -1px disabled-stroke($on-titlebar); 1439background-color: entry-fill($on-titlebar); 1440color: disabled($on-titlebar); 1441} 1442 1443image { 1444color: hint($on-titlebar); 1445 1446&:hover, 1447&:active { 1448color: $on-titlebar; 1449} 1450 1451&:disabled { 1452color: disabled($on-titlebar); 1453} 1454} 1455} 1456 1457.linked:not(.vertical) > entry:not(:only-child) { 1458border-radius: $corner-radius $corner-radius 0 0; 1459} 1460 1461@at-root %titlebar-button, & button:not(.suggested-action):not(.destructive-action) { 1462@extend %button-flat; 1463 1464border-image: 1465radial-gradient( 1466circle closest-corner at center calc(100% - 1px), 1467$titlebar-indicator 0%, 1468transparent 0% 1469) 0 0 0 / 0 0 0; 1470background-color: transparent; 1471color: hint($on-titlebar); 1472@include ink-color($on-titlebar, $button-style: "flat"); 1473 1474&:disabled { 1475color: disabled-hint($on-titlebar); 1476} 1477 1478@at-root %titlebar-button-checked, 1479&:checked { 1480border-image: 1481radial-gradient( 1482circle closest-corner at center calc(100% - 1px), 1483$titlebar-indicator 100%, 1484transparent 0% 1485) 0 0 2 / 0 0 2px; 1486background-color: transparent; 1487color: $on-titlebar; 1488@include ink-color($on-titlebar, $button-style: "flat"); 1489 1490&:disabled { 1491background-color: transparent; 1492color: disabled($on-titlebar); 1493} 1494} 1495 1496&:backdrop { 1497color: disabled($on-titlebar); 1498 1499&:disabled { 1500color: disabled-hint($on-titlebar); 1501} 1502 1503&:checked { 1504color: hint($on-titlebar); 1505 1506&:disabled { 1507color: disabled-hint($on-titlebar); 1508} 1509} 1510} 1511} 1512 1513button.suggested-action, button.destructive-action { 1514&:disabled { 1515background-color: fill($on-titlebar); 1516color: disabled($on-titlebar); 1517} 1518} 1519 1520// FIXME: Ugly overriding 1521stackswitcher button:not(.suggested-action):not(.destructive-action).text-button { 1522min-width: 120px - 8px * 2; 1523} 1524 1525// FIXME: Ugly overriding 1526.path-bar button:not(.suggested-action):not(.destructive-action).text-button { 1527min-width: 0; 1528padding-left: ($medium-size - 24px) / 2; 1529padding-right: ($medium-size - 24px) / 2; 1530} 1531 1532&.selection-mode { 1533// .1ms was a workaround for https://gitlab.gnome.org/GNOME/gtk/issues/698 1534// but let's keep it for backwards compatibility. 1535transition: background-color .1ms $ripple-fade-in-duration, color $duration $ease-out; 1536animation: ripple-on-headerbar $ripple-fade-in-duration $ease-out; 1537box-shadow: $shadow-z1, inset 0 1px highlight($primary); 1538background-color: $primary; 1539color: $on-primary; 1540 1541&:backdrop { 1542color: hint($on-primary); 1543} 1544 1545.subtitle:link { 1546color: $on-primary; 1547} 1548 1549button:not(.suggested-action):not(.destructive-action) { 1550border-image: 1551radial-gradient( 1552circle closest-corner at center calc(100% - 1px), 1553currentcolor 0%, 1554transparent 0% 1555) 0 0 0 / 0 0 0; 1556color: $on-primary; 1557 1558&:disabled { 1559color: disabled($on-primary); 1560} 1561 1562&:checked { 1563border-image: 1564radial-gradient( 1565circle closest-corner at center calc(100% - 1px), 1566currentcolor 100%, 1567transparent 0% 1568) 0 0 2 / 0 0 2px; 1569color: $on-primary; 1570 1571&:disabled { 1572color: disabled($on-primary); 1573} 1574} 1575 1576&:backdrop { 1577color: hint($on-primary); 1578 1579&:disabled { 1580color: disabled-hint($on-primary); 1581} 1582 1583&:checked { 1584color: hint($on-primary); 1585 1586&:disabled { 1587color: disabled-hint($on-primary); 1588} 1589} 1590} 1591} 1592 1593.selection-menu { 1594padding-left: 16px; 1595padding-right: 16px; 1596 1597arrow { 1598-GtkArrow-arrow-scaling: 1; 1599} 1600 1601.arrow { 1602-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 1603} 1604} 1605} 1606 1607.selection-mode { 1608box-shadow: inset 0 1px highlight($primary); // Avoid double shadows 1609background-color: $primary; 1610} 1611 1612// squared corners when the window is maximized, tiled, or fullscreen 1613.tiled &, 1614.tiled-top &, 1615.tiled-right &, 1616.tiled-bottom &, 1617.tiled-left &, 1618.maximized &, 1619.fullscreen & { 1620border-radius: 0; 1621box-shadow: $shadow-z1; 1622} 1623 1624&.default-decoration { 1625min-height: $small-size; 1626padding: $container-padding; 1627box-shadow: inset 0 1px highlight($titlebar); 1628 1629.tiled &, 1630.maximized &, 1631.fullscreen & { 1632box-shadow: none; 1633} 1634 1635button.titlebutton { 1636min-height: $small-size; 1637min-width: $small-size; 1638margin: 0; 1639padding: 0; 1640} 1641 1642// workaround for non-animatable buttons 1643.background:not(.csd) & button.titlebutton:active { 1644background-size: 1000% 1000%; 1645} 1646} 1647 1648.solid-csd & { 1649&:dir(rtl), &:dir(ltr) { // specificity bump 1650border-radius: 0; 1651box-shadow: $shadow-z1; // just remove the highlight 1652} 1653} 1654} 1655 1656headerbar { 1657// The sizing factor needs to be defined in the headerbar node for the case of split headerbars 1658min-height: $large-size; 1659padding: 0 $container-padding; 1660 1661// add vertical margins to common widget on the headerbar to avoid them spanning the whole height 1662entry, 1663spinbutton, 1664button { 1665margin-top: $container-padding; 1666margin-bottom: $container-padding; 1667} 1668 1669separator.titlebutton { 1670margin-top: $large-size / 4; 1671margin-bottom: $large-size / 4; 1672background-color: divider($on-titlebar); 1673} 1674 1675switch { 1676margin-top: ($large-size - 24px) / 2; 1677margin-bottom: ($large-size - 24px) / 2; 1678} 1679 1680// reset button margins of the spinbutton 1681spinbutton button { 1682margin-top: 0; 1683margin-bottom: 0; 1684} 1685 1686// FIXME: This is a hacky workaround. 1687.entry-tag { 1688margin-top: 5px; 1689margin-bottom: 5px; 1690} 1691} 1692 1693// Development versions of apps to use a differently styled headerbar 1694window.devel .titlebar:not(.selection-mode) { 1695} 1696 1697/** 1698* Pathbars 1699*/ 1700 1701%pathbar_button, 1702.path-bar.linked:not(.vertical) > button { 1703padding-left: ($medium-size - 24px) / 2; 1704padding-right: ($medium-size - 24px) / 2; 1705border-image: 1706radial-gradient( 1707circle closest-corner at center calc(100% - 1px), 1708$primary 0%, 1709transparent 0% 1710) 0 0 0 / 0 0 0; 1711border-radius: $corner-radius; 1712color: hint($on-surface); 1713@include ink-color($on-surface, $button-style: "flat"); 1714 1715&:disabled { 1716background-color: transparent; 1717color: disabled-hint($on-surface); 1718} 1719 1720&:checked { 1721border-image: 1722radial-gradient( 1723circle closest-corner at center calc(100% - 1px), 1724$primary 100%, 1725transparent 0% 1726) 0 0 2 / 0 0 2px; 1727color: $primary; 1728@include ink-color($primary, $button-style: "flat"); 1729 1730&:disabled { 1731background-color: transparent; 1732color: disabled($on-surface); 1733} 1734} 1735 1736label:not(:only-child) { 1737&:first-child { 1738margin-left: 0; 1739} 1740 1741&:last-child { 1742margin-right: 0; 1743} 1744} 1745 1746&.text-button { 1747min-width: 0; 1748} 1749 1750&.slider-button { 1751padding-left: (24px - 16px) / 2; 1752padding-right: (24px - 16px) / 2; 1753} 1754} 1755 1756/** 1757* Tree Views 1758*/ 1759 1760treeview.view { 1761@at-root * { 1762-GtkTreeView-horizontal-separator: 4; 1763-GtkTreeView-grid-line-width: 1; 1764-GtkTreeView-grid-line-pattern: ''; 1765-GtkTreeView-tree-line-width: 1; 1766-GtkTreeView-tree-line-pattern: ''; 1767-GtkTreeView-expander-size: 16; 1768} 1769 1770border-left-color: stroke($on-surface); // this is actually the tree lines color, 1771border-top-color: divider($on-surface); // while this is the grid lines color, better then nothing 1772 1773// to avoid borders being overridden by the previously set props 1774rubberband { 1775@extend %rubberband; 1776} 1777 1778&:hover, 1779&:selected { 1780border-radius: 0; 1781} 1782 1783&.separator { 1784min-height: 1px + 2px * 2; 1785color: divider($on-surface); 1786} 1787 1788&:drop(active) { 1789// FIXME: box-shadow, background-color and background-image are not available here. 1790border-style: solid none; 1791border-width: 9999px; 1792border-color: overlay("hover", $on-surface); 1793 1794&.after { 1795border-top-style: none; 1796} 1797 1798&.before { 1799border-bottom-style: none; 1800} 1801} 1802 1803&.expander { 1804-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 1805-gtk-icon-transform: rotate(-90deg); 1806 1807&:dir(rtl) { 1808-gtk-icon-transform: rotate(90deg); 1809} 1810 1811&:checked { 1812-gtk-icon-transform: unset; 1813} 1814 1815color: hint($on-surface); 1816 1817&:hover, 1818&:active { 1819color: $on-surface; 1820} 1821 1822&:disabled { 1823color: disabled-hint($on-surface); 1824} 1825} 1826 1827// progress bar in treeviews 1828&.progressbar { 1829border-bottom: $bar-size solid $primary; 1830background-color: transparent; 1831 1832&:selected:hover { 1833background-color: transparent; 1834} 1835} 1836 1837// progress bar trough in treeviews 1838&.trough { 1839border-bottom: $bar-size solid disabled-stroke($on-surface); 1840background-color: transparent; 1841 1842&:selected:hover { 1843background-color: transparent; 1844} 1845} 1846 1847header { 1848button { 1849padding: 2px 6px; 1850border-style: none solid solid none; 1851border-width: 1px; 1852border-color: divider($on-surface); 1853border-radius: 0; 1854background-clip: padding-box; 1855color: hint($on-surface); 1856@include ink-color($on-surface, $button-style: "flat", $hover-alt: true); 1857@include list-item; 1858 1859&:disabled { 1860background-color: transparent; 1861color: disabled-hint($on-surface); 1862} 1863 1864&:last-child { 1865border-right-style: none; 1866} 1867} 1868} 1869 1870button.dnd, 1871header.button.dnd { // for treeview-like derive widgets 1872padding: 2px 6px; 1873border-style: none solid solid; 1874border-width: 1px; 1875border-color: divider($on-surface); 1876border-radius: 0; 1877box-shadow: none; 1878background-clip: padding-box; 1879background-color: $surface-z8; 1880color: $primary; 1881} 1882 1883// see tests/testaccel to test 1884acceleditor > label { 1885background-color: $primary; 1886} 1887} 1888 1889/** 1890* Menus 1891*/ 1892 1893menubar, 1894.menubar { 1895-GtkWidget-window-dragging: true; 1896padding: 0; 1897// box-shadow: inset 0 -1px divider($on-surface); 1898background-color: $titlebar; 1899color: $on-titlebar; 1900 1901&:backdrop { 1902background-color: $titlebar-backdrop; 1903color: hint($on-titlebar); 1904} 1905 1906.csd & { 1907transition: $transition; 1908} 1909 1910> menuitem { 1911transition: $transition; 1912min-height: 20px; 1913padding: 4px 8px; 1914color: hint($on-titlebar); 1915 1916// Seems like it :hover even with keyboard focus 1917&:hover { 1918transition: none; 1919background-color: overlay("activated", $on-titlebar); 1920color: $on-titlebar; 1921} 1922 1923&:disabled { 1924color: disabled-hint($on-titlebar); 1925} 1926} 1927} 1928 1929// Needed to make the border-radius of menus work 1930// otherwise the background bleeds out of the menu edges 1931.background.popup { 1932background-color: transparent; 1933} 1934 1935menu, 1936.menu, 1937.context-menu { 1938margin: 4px 0; // See https://bugzilla.gnome.org/show_bug.cgi?id=591258 1939padding: 4px 0; 1940border: 1px solid divider($on-surface); // adds borders in a non composited env 1941box-shadow: inset 0 1px highlight($surface-z8); 1942background-color: $surface-z8; 1943color: $on-surface; 1944font: initial; 1945text-shadow: none; 1946 1947.csd & { 1948border: none; // axes borders in a composited env 1949border-radius: $corner-radius; 1950} 1951 1952menuitem { 1953transition: background-color $duration $ease-out; 1954min-height: 20px; 1955min-width: 40px; 1956padding: 4px 8px; 1957 1958&:hover { 1959transition: none; 1960background-color: overlay("hover", $on-surface); 1961} 1962 1963&:disabled { 1964color: disabled($on-surface); 1965} 1966 1967// submenu indicators 1968arrow { 1969min-height: 16px; 1970min-width: 16px; 1971color: hint($on-surface); 1972 1973&:disabled { 1974color: disabled-hint($on-surface); 1975} 1976 1977&:dir(ltr) { 1978-gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); 1979margin-left: 8px; 1980} 1981 1982&:dir(rtl) { 1983-gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl'); 1984margin-right: 8px; 1985} 1986} 1987 1988// avoids labels color being overridden, see 1989// https://bugzilla.gnome.org/show_bug.cgi?id=767058 1990label { 1991&:dir(rtl), 1992&:dir(ltr) { 1993// color: inherit; 1994} 1995} 1996} 1997 1998// overflow arrows 1999> arrow { 2000min-height: 16px; 2001min-width: 16px; 2002padding: 4px; 2003background-color: $surface-z8; 2004color: hint($on-surface); 2005 2006&.top { 2007margin-top: -4px; 2008border-bottom: 1px solid divider($on-surface); 2009border-radius: $corner-radius $corner-radius 0 0; 2010-gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); 2011} 2012 2013&.bottom { 2014margin-top: 4px * 2; 2015margin-bottom: -4px * 3; 2016border-top: 1px solid divider($on-surface); 2017border-radius: 0 0 $corner-radius $corner-radius; 2018-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 2019} 2020 2021&:hover { 2022background-image: image(overlay("hover", $on-surface)); 2023} 2024 2025&:disabled { 2026border-color: transparent; 2027background-color: transparent; 2028color: transparent; 2029// color: disabled-hint($on-surface); 2030} 2031} 2032 2033separator { 2034margin: 4px 0; 2035} 2036} 2037 2038menuitem { 2039accelerator { 2040color: hint($on-surface); 2041} 2042 2043&:disabled accelerator { 2044color: disabled-hint($on-surface); 2045} 2046} 2047 2048/** 2049* Popovers 2050*/ 2051 2052popover.background { 2053transition: $transition-shadow; 2054padding: 2px; 2055box-shadow: $shadow-z4; // TODO: this should really have a highlight 2056background-color: $surface-z8; 2057 2058&:backdrop { 2059box-shadow: $shadow-z2; 2060} 2061 2062&, 2063.csd & { 2064border-style: solid; 2065border-width: 1px; 2066border-color: rgba(black, .1) rgba(black, .2) rgba(black, .3); 2067border-radius: $corner-radius + 1px; 2068background-clip: padding-box; 2069} 2070 2071> stack { 2072margin: -4px; // remove extra padding from menu style popovers 2073} 2074 2075> toolbar { 2076margin: -2px; 2077} 2078 2079> list, 2080> .view, 2081> toolbar { 2082border-style: none; 2083box-shadow: none; 2084background-color: transparent; 2085} 2086 2087&.touch-selection, 2088&.magnifier, 2089&.osd { 2090// @extend %osd; 2091} 2092 2093button:not(.suggested-action):not(.destructive-action) { 2094// @extend %button-flat; 2095} 2096 2097.linked:not(.vertical) > entry:not(:only-child) { 2098// border-radius: $corner-radius $corner-radius 0 0; 2099} 2100 2101&.menu button, 2102button.model { 2103@extend %button-flat; 2104 2105min-height: 32px; 2106padding: 0 8px; 2107border-radius: $corner-radius; 2108} 2109 2110separator { 2111margin: 4px 0; 2112} 2113 2114list separator { 2115margin: 0; 2116} 2117} 2118 2119/** 2120* Notebooks 2121*/ 2122 2123notebook { 2124&:focus > header > tabs > tab:checked { 2125background-color: overlay("focus", $primary); 2126} 2127 2128> header { 2129&.top { 2130box-shadow: inset 0 -1px divider($on-surface); 2131 2132> tabs { 2133> tab { 2134box-shadow: inset 0 -2px transparent; 2135 2136&:checked { 2137box-shadow: inset 0 -2px $primary; 2138} 2139} 2140} 2141} 2142 2143&.bottom { 2144box-shadow: inset 0 1px divider($on-surface); 2145 2146> tabs { 2147> tab { 2148box-shadow: inset 0 2px transparent; 2149 2150&:checked { 2151box-shadow: inset 0 2px $primary; 2152} 2153} 2154} 2155} 2156 2157&.left { 2158box-shadow: inset -1px 0 divider($on-surface); 2159 2160> tabs { 2161> tab { 2162box-shadow: inset -2px 0 transparent; 2163 2164&:checked { 2165box-shadow: inset -2px 0 $primary; 2166} 2167} 2168} 2169} 2170 2171&.right { 2172box-shadow: inset 1px 0 divider($on-surface); 2173 2174> tabs { 2175> tab { 2176box-shadow: inset 2px 0 transparent; 2177 2178&:checked { 2179box-shadow: inset 2px 0 $primary; 2180} 2181} 2182} 2183} 2184 2185&.top > tabs > arrow { 2186@extend %notebook_vert_arrows; 2187} 2188 2189&.bottom > tabs > arrow { 2190@extend %notebook_vert_arrows; 2191} 2192 2193@at-root %notebook_vert_arrows { 2194&.down { 2195-gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); 2196} 2197 2198&.up { 2199-gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); 2200} 2201} 2202 2203&.left > tabs > arrow { 2204@extend %notebook_horz_arrows; 2205} 2206 2207&.right > tabs > arrow { 2208@extend %notebook_horz_arrows; 2209} 2210 2211@at-root %notebook_horz_arrows { 2212&.down { 2213-gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); 2214} 2215 2216&.up { 2217-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 2218} 2219} 2220 2221> tabs > arrow { 2222min-height: 16px; 2223min-width: 16px; 2224padding: 4px; 2225border-radius: 0; 2226color: hint($on-surface); 2227@extend %ripple; 2228@include ink-color($on-surface, $hover-alt: true); 2229 2230&:disabled { 2231color: disabled-hint($on-surface); 2232} 2233} 2234 2235> tabs > tab { 2236transition: $transition, 2237background-size 0ms, 2238background-image 0ms; 2239min-height: $small-size; 2240min-width: $small-size; 2241padding: $container-padding 16px; 2242outline: none; 2243background-image: radial-gradient(circle, $primary 10%, transparent 0%); 2244background-repeat: no-repeat; 2245background-position: center; 2246background-size: 0% 0%; 2247color: hint($on-surface); 2248font-weight: 500; 2249 2250&:hover { 2251background-color: overlay("hover-alt", $on-surface); 2252} 2253 2254&:disabled { 2255color: disabled-hint($on-surface); 2256} 2257 2258&:checked { 2259transition: $transition, 2260background-size $ripple-fade-in-duration $ease-out, 2261background-image $ripple-fade-in-duration + $ripple-fade-out-duration $ease-out; 2262background-color: transparent; 2263background-image: radial-gradient(circle, transparent 10%, transparent 0%); 2264background-size: 1000% 1000%; 2265color: $primary; 2266 2267&:disabled { 2268color: disabled($on-surface); 2269} 2270 2271&.reorderable-page { 2272// background-color: $surface-z1; 2273// color: $on-surface; 2274} 2275 2276&.dnd { 2277background-color: overlay("dragged", $primary); 2278} 2279} 2280 2281// FIXME: The tab node doesn't have :drop(active), instead its child box has it. 2282> box { 2283transition: background-color $duration $ease-out; 2284margin: -$container-padding -16px; 2285padding: $container-padding 16px; 2286 2287&:drop(active) { 2288background-color: overlay("hover", $on-surface); 2289} 2290} 2291 2292// colors the button like the label, overridden otherwise 2293button.flat { 2294@extend %button-small; 2295 2296&:last-child { 2297margin-left: $container-padding; 2298margin-right: $container-padding - 16px; 2299} 2300 2301&:first-child { 2302margin-left: $container-padding - 16px; 2303margin-right: $container-padding; 2304} 2305} 2306} 2307} 2308} 2309 2310/** 2311* Scrollbars 2312*/ 2313 2314scrollbar { 2315$_slider_min_length: 24px; 2316 2317// disable steppers 2318@at-root * { 2319-GtkScrollbar-has-backward-stepper: false; 2320-GtkScrollbar-has-forward-stepper: false; 2321} 2322 2323transition: $transition; 2324// background-color: $surface-z0; 2325background-clip: padding-box; 2326 2327// scrollbar border 2328&.top { border-bottom: 1px solid divider($on-surface); } 2329&.bottom { border-top: 1px solid divider($on-surface); } 2330&.left { border-right: 1px solid divider($on-surface); } 2331&.right { border-left: 1px solid divider($on-surface); } 2332 2333// slider 2334slider { 2335transition: background-color $duration $ease-out; 2336min-width: 8px; 2337min-height: 8px; 2338border: 4px solid transparent; 2339border-radius: $circular-radius; 2340background-clip: padding-box; 2341background-color: scrollbar-thumb($on-surface); 2342 2343&:hover { 2344background-color: scrollbar-thumb($on-surface, "hover"); 2345} 2346 2347&:active { 2348background-color: scrollbar-thumb($on-surface, "pressed"); 2349} 2350 2351&:disabled { 2352background-color: scrollbar-thumb($on-surface, "disabled"); 2353} 2354} 2355 2356&.fine-tune { 2357slider { 2358min-width: 4px; 2359min-height: 4px; 2360} 2361 2362&.horizontal slider { 2363margin: 2px 0; 2364} 2365 2366&.vertical slider { 2367margin: 0 2px; 2368} 2369} 2370 2371&.overlay-indicator { 2372&:not(.fine-tune) slider { 2373transition-property: background-color, min-height, min-width; 2374} 2375 2376&:not(.dragging):not(.hovering) { 2377border-color: transparent; 2378background-color: transparent; 2379 2380slider { 2381min-width: 4px; 2382min-height: 4px; 2383margin: 4px - 1px; 2384border: 1px solid rgba($surface-z1, .3); 2385} 2386 2387button { 2388min-width: 4px; 2389min-height: 4px; 2390margin: 4px - 1px; 2391border: 1px solid rgba($surface-z1, .3); 2392border-radius: $circular-radius; 2393background-color: scrollbar-thumb($on-surface); 2394background-clip: padding-box; 2395-gtk-icon-source: none; 2396 2397&:disabled { 2398background-color: scrollbar-thumb($on-surface, "disabled"); 2399} 2400} 2401 2402&.horizontal { 2403slider { 2404min-width: $_slider_min_length; 2405} 2406 2407button { 2408min-width: 8px; 2409} 2410} 2411 2412&.vertical { 2413slider { 2414min-height: $_slider_min_length; 2415} 2416 2417button { 2418min-height: 8px; 2419} 2420} 2421} 2422 2423&.dragging, 2424&.hovering { 2425background-color: $surface-z8; 2426} 2427} 2428 2429&.horizontal slider { 2430min-width: $_slider_min_length; 2431} 2432 2433&.vertical slider { 2434min-height: $_slider_min_length; 2435} 2436 2437// button styling 2438button { 2439@extend %button-flat-basic; 2440 2441min-width: 16px; 2442min-height: 16px; 2443padding: 0; 2444border-radius: 0; 2445} 2446 2447// button icons 2448&.vertical { 2449button { 2450&.down { 2451-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 2452} 2453 2454&.up { 2455-gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); 2456} 2457} 2458} 2459 2460&.horizontal { 2461button { 2462&.down { 2463-gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); 2464} 2465 2466&.up { 2467-gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); 2468} 2469} 2470} 2471} 2472 2473 2474/** 2475* Switch 2476*/ 2477 2478switch { 2479transition: all $duration $ease-out; 2480margin: $container-padding 0; 2481padding: 0 2px; 2482border: 5px solid transparent; 2483border-radius: $circular-radius; 2484background-color: stroke($on-surface); 2485background-clip: padding-box; 2486font-size: 0; 2487 2488&:checked { 2489background-color: rgba($primary, .5); 2490} 2491 2492&:disabled { 2493opacity: .5; 2494} 2495 2496// hide on/off icons for >=3.24.5 2497image { 2498margin: -8px; 2499-gtk-icon-transform: scale(0); 2500} 2501 2502slider { 2503transition: all $duration $ease-out; 2504min-width: 20px; 2505min-height: 20px; 2506margin: -3px -2px; 2507border-radius: $circular-radius; 2508outline: none; 2509box-shadow: 0 0 0 10px transparent, $shadow-z1; 2510background-color: $surface-switch-thumb; 2511} 2512 2513&:hover slider { 2514box-shadow: 0 0 0 10px overlay("hover", $on-surface), $shadow-z1; 2515} 2516 2517&:focus slider { 2518box-shadow: 0 0 0 10px overlay("focus", $on-surface), $shadow-z1; 2519} 2520 2521&:checked slider { 2522background-color: $primary; 2523} 2524 2525&:checked:hover slider { 2526box-shadow: 0 0 0 10px overlay("hover", $primary), $shadow-z1; 2527} 2528 2529&:checked:focus slider { 2530box-shadow: 0 0 0 10px overlay("focus", $primary), $shadow-z1; 2531} 2532 2533row:selected & { 2534} 2535} 2536 2537/** 2538* Check and Radio items 2539*/ 2540 2541// draw regular check and radio items using our PNG assets 2542// all assets are rendered from assets.svg. never add pngs directly 2543 2544// selection-mode 2545.view.content-view.check:not(list), 2546.content-view:not(list) check { 2547min-height: 40px; 2548min-width: 40px; 2549margin: 0; 2550padding: 0; 2551background-color: transparent; 2552background-image: none; 2553-gtk-icon-shadow: $icon-shadow-z2; 2554 2555&:hover, 2556&:active { 2557-gtk-icon-shadow: $icon-shadow-z4; 2558} 2559 2560@each $class, $suffix in ("": "-unchecked", ":checked": "-checked") { 2561&#{$class} { 2562$_url: 'assets/selectionmode-checkbox#{$suffix}#{$asset-suffix}'; 2563 2564-gtk-icon-source: -gtk-scaled(url("#{$_url}.png"), url("#{$_url}@2.png")); 2565} 2566} 2567} 2568 2569checkbutton, 2570radiobutton { 2571outline: none; 2572} 2573 2574checkbutton.text-button, 2575radiobutton.text-button { 2576// this is for a nice focus on check and radios text 2577padding: 2px; 2578 2579label:not(:only-child) { 2580margin: 0 4px; 2581} 2582} 2583 2584$check-radio-size: 40px; 2585 2586check, 2587radio { 2588min-height: 24px; 2589min-width: 24px; 2590margin: -($check-radio-size - 24px) / 2; 2591padding: ($check-radio-size - 24px) / 2; 2592border-radius: $circular-radius; 2593color: hint($on-surface); 2594@extend %ripple; 2595@include ink-color($on-surface); 2596 2597&:checked, 2598&:indeterminate { 2599color: $primary; 2600@include ink-color($primary); 2601} 2602 2603&:disabled { 2604color: disabled-hint($on-surface); 2605} 2606 2607&:only-child { 2608// margin: -12px; 2609} 2610 2611popover modelbutton.flat & { 2612&, 2613&:focus, 2614&:hover, 2615&:focus:hover, 2616&:active, 2617&:disabled { 2618transition: none; // FIXME: this is a workaround for a popover check/radio long transition issue 2619background-color: transparent; 2620background-image: none; 2621} 2622 2623&.left:dir(rtl) { 2624margin-left: -12px; 2625margin-right: -4px; 2626} 2627 2628&.right:dir(ltr) { 2629margin-left: -4px; 2630margin-right: -12px; 2631} 2632} 2633 2634menu menuitem & { 2635transition: none; 2636margin: 0; // this is a workaround for a menu check/radio size allocation issue 2637padding: 0; 2638 2639&:dir(ltr) { 2640margin-right: 8px; 2641} 2642 2643&:dir(rtl) { 2644margin-left: 8px; 2645} 2646 2647&, 2648&:checked, 2649&:indeterminate { 2650&:hover, 2651&:focus { 2652background-color: transparent; 2653} 2654} 2655} 2656} 2657 2658%check, 2659check { 2660-gtk-icon-source: -gtk-recolor(url("icons/checkbox-unchecked-symbolic.svg")); 2661 2662&:checked { 2663-gtk-icon-source: -gtk-recolor(url("icons/checkbox-checked-symbolic.svg")); 2664} 2665 2666&:indeterminate { 2667-gtk-icon-source: -gtk-recolor(url("icons/checkbox-mixed-symbolic.svg")); 2668} 2669} 2670 2671%radio, 2672radio { 2673-gtk-icon-source: -gtk-recolor(url("icons/radio-unchecked-symbolic.svg")); 2674 2675&:checked { 2676// -gtk-icon-source: -gtk-recolor(url("icons/radio-checked-symbolic.svg")); 2677} 2678 2679&:indeterminate { 2680-gtk-icon-source: -gtk-recolor(url("icons/radio-mixed-symbolic.svg")); 2681} 2682 2683border-image-slice: $check-radio-size / 2px; 2684border-image-width: $check-radio-size / 2; 2685 2686$radio-indicator-size: 10px / $check-radio-size / 2; 2687 2688border-image-source: 2689-gtk-gradient( 2690radial, 2691center center, 0, 2692center center, .001, 2693to($primary), 2694to(transparent) 2695); 2696 2697&:checked:not(:indeterminate) { 2698border-image-source: 2699-gtk-gradient( 2700radial, 2701center center, 0, 2702center center, $radio-indicator-size, 2703to($primary), 2704to(transparent) 2705); 2706 2707&:disabled { 2708border-image-source: 2709-gtk-gradient( 2710radial, 2711center center, 0, 2712center center, $radio-indicator-size, 2713to(disabled-hint($on-surface)), 2714to(transparent) 2715); 2716} 2717} 2718} 2719 2720%small_check, 2721menu menuitem check { 2722min-height: 16px; 2723min-width: 16px; 2724border-radius: $corner-radius; 2725-gtk-icon-source: -gtk-recolor(url("icons/small-checkbox-unchecked-symbolic.svg")); 2726 2727&:checked { 2728-gtk-icon-source: -gtk-recolor(url("icons/small-checkbox-checked-symbolic.svg")); 2729} 2730 2731&:indeterminate { 2732-gtk-icon-source: -gtk-recolor(url("icons/small-checkbox-mixed-symbolic.svg")); 2733} 2734} 2735 2736%small_radio, 2737menu menuitem radio { 2738min-height: 16px; 2739min-width: 16px; 2740border-image: none; 2741-gtk-icon-source: -gtk-recolor(url("icons/small-radio-unchecked-symbolic.svg")); 2742 2743&:checked { 2744-gtk-icon-source: -gtk-recolor(url("icons/small-radio-checked-symbolic.svg")); 2745} 2746 2747&:indeterminate { 2748-gtk-icon-source: -gtk-recolor(url("icons/small-radio-mixed-symbolic.svg")); 2749} 2750} 2751 2752// ANIMATION: 2753// this is made with those pretty convoluted transitions, since checks and radios have to animate only on state changes, 2754// the transformation is set on the active state and it get reset on the checked state. 2755radio:not(:checked):active { 2756// -gtk-icon-transform: scale(0); 2757} 2758 2759// Otherwise, treeview.view styling will be applied... 2760treeview.view check, 2761treeview.view radio { 2762padding: 0; 2763color: hint($on-surface); 2764 2765&:checked, 2766&:indeterminate { 2767color: $primary; 2768} 2769 2770&:disabled { 2771color: disabled-hint($on-surface); 2772} 2773 2774&, 2775&:hover, 2776&:selected, 2777&:selected:hover { 2778box-shadow: none; 2779background-color: transparent; 2780} 2781} 2782 2783treeview.view radio:checked { 2784-gtk-icon-source: -gtk-recolor(url("icons/radio-checked-symbolic.svg")); 2785border-image: none; 2786} 2787 2788/** 2789* GtkScale 2790*/ 2791 2792scale { 2793// sizing 2794$_marks_length: 8px; 2795$_marks_distance: 7px; 2796 2797$trough_size: 2px; 2798$finetune_trough_size: 4px; 2799 2800$slider_size: 32px; 2801 2802$slider_margin: -($slider_size - $trough_size) / 2; 2803$finetune_slider_margin: -($slider_size - $finetune_trough_size) / 2; 2804 2805$color_slider_margin: -($slider_size) * 3 / 4; 2806$color_marks_slider_margin: -($slider_size - 16px) - $color_slider_margin; 2807 2808min-height: $trough_size; 2809min-width: $trough_size; 2810 2811&.horizontal { 2812padding: ($medium-size - $trough_size) / 2 12px; 2813} 2814 2815&.vertical { 2816padding: 12px ($medium-size - $trough_size) / 2; 2817} 2818 2819// the slider is inside the trough, so to have make it bigger there's a negative margin 2820slider { 2821min-height: $slider_size; 2822min-width: $slider_size; 2823margin: $slider_margin; 2824} 2825 2826// click-and-hold the slider to activate 2827&.fine-tune { 2828&.horizontal { 2829min-height: $finetune_trough_size; 2830padding-top: ($medium-size - $finetune_trough_size) / 2; 2831padding-bottom: ($medium-size - $finetune_trough_size) / 2; 2832} 2833 2834&.vertical { 2835min-width: $finetune_trough_size; 2836padding-left: ($medium-size - $finetune_trough_size) / 2; 2837padding-right: ($medium-size - $finetune_trough_size) / 2; 2838} 2839 2840// to make the trough grow in fine-tune mode 2841slider { 2842margin: $finetune_slider_margin; 2843} 2844} 2845 2846// the backing bit 2847trough { 2848transition: background-color $duration $ease-out; 2849outline: none; 2850background-color: stroke($on-surface); 2851 2852&:disabled { 2853background-color: disabled-stroke($on-surface); 2854} 2855} 2856 2857// the colored part of the backing bit 2858highlight { 2859transition: background-image $duration $ease-out; 2860background-image: image($primary); 2861 2862&:disabled { 2863background-color: $surface-z0; 2864background-image: image(disabled-hint($on-surface)); 2865} 2866} 2867 2868// this is another differently styled part of the backing bit, the most relevant use case is for example 2869// in media player to indicate how much video stream as been cached 2870fill { 2871transition: background-color $duration $ease-out; 2872background-color: stroke($on-surface); 2873 2874&:disabled { 2875background-color: transparent; 2876} 2877} 2878 2879slider { 2880transition: background-color $duration $ease-out, 2881background-size $ripple-fade-out-duration $ease-out, 2882background-image $ripple-fade-out-opacity-duration $ease-out; 2883background-repeat: no-repeat; 2884background-position: center; 2885background-size: auto, 1000% 1000%; 2886border-radius: 50%; 2887color: $primary; 2888 2889@each $class, $suffix in ("": "", ":disabled": "-disabled") { 2890&#{$class} { 2891$_url: 'assets/scale-slider#{$suffix}#{$asset-suffix}'; 2892 2893background-image: 2894-gtk-scaled(url('#{$_url}.png'), url('#{$_url}@2.png')), 2895radial-gradient(circle, transparent 10%, transparent 0%); 2896} 2897} 2898 2899&:hover { 2900background-color: overlay("hover", $primary); 2901} 2902 2903&:focus { 2904background-color: overlay("focus", $primary); 2905} 2906 2907&:active { 2908$_url: 'assets/scale-slider#{$asset-suffix}'; 2909 2910transition: background-color $duration $ease-out, 2911background-size 0ms, 2912background-image 0ms; 2913animation: ripple-on-slider $ripple-fade-in-duration $ease-out forwards; 2914background-image: 2915-gtk-scaled(url('#{$_url}.png'), url('#{$_url}@2.png')), 2916radial-gradient(circle, overlay("pressed", $primary) 10%, transparent 0%); 2917background-size: auto, 0% 0%; 2918} 2919} 2920 2921marks, 2922value { 2923color: hint($on-surface); 2924} 2925 2926indicator { 2927background-color: stroke($on-surface); 2928color: transparent; 2929} 2930 2931//marks margins 2932@each $scale_orient, $marks_class, $marks_pos, $marks_margin in (horizontal, top, top, bottom), 2933(horizontal, bottom, bottom, top), 2934(vertical, top, left, right), 2935(vertical, bottom, right, left) { 2936&.#{$scale_orient} marks { 2937&.#{$marks_class} { 2938margin-#{$marks_margin}: $_marks_distance; 2939margin-#{$marks_pos}: -($_marks_distance + $_marks_length); 2940} 2941} 2942 2943&.#{$scale_orient}.fine-tune marks { 2944&.#{$marks_class} { 2945margin-#{$marks_margin}: $_marks_distance - 1px; 2946margin-#{$marks_pos}: -($_marks_distance + $_marks_length - 1px); 2947} 2948} 2949} 2950 2951&.horizontal { 2952indicator { 2953min-height: $_marks_length; 2954min-width: 1px; 2955} 2956} 2957 2958&.vertical { 2959indicator { 2960min-height: 1px; 2961min-width: $_marks_length; 2962} 2963} 2964 2965// *WARNING* scale with marks madness following 2966 2967@each $dir_class, $dir_infix in (".horizontal": "-horz", ".vertical": "-vert") { 2968@each $marks_class, $marks_infix in ( 2969".marks-before:not(.marks-after)": "-marks-before", 2970".marks-after:not(.marks-before)": "-marks-after" 2971) { 2972&#{$dir_class}#{$marks_class} { 2973slider { 2974@each $state_class, $state_infix in ("": "", ":disabled": "-disabled") { 2975&#{$state_class} { 2976$_scale_asset: 'assets/scale#{$dir_infix}#{$marks_infix}-slider#{$state_infix}#{$asset-suffix}'; 2977 2978background-image: 2979-gtk-scaled(url('#{$_scale_asset}.png'), url('#{$_scale_asset}@2.png')), 2980radial-gradient(circle, transparent 10%, transparent 0%); 2981} 2982} 2983 2984&:active { 2985$_scale_asset: 'assets/scale#{$dir_infix}#{$marks_infix}-slider#{$asset-suffix}'; 2986 2987background-image: 2988-gtk-scaled(url('#{$_scale_asset}.png'), url('#{$_scale_asset}@2.png')), 2989radial-gradient(circle, overlay("pressed", $primary) 10%, transparent 0%); 2990} 2991} 2992} 2993} 2994} 2995 2996&.color { 2997min-height: 0; 2998min-width: 0; 2999 3000&.horizontal { 3001padding: 0 0 12px 0; 3002 3003slider { 3004&:dir(ltr), &:dir(rtl) { // specificity bump 3005margin-bottom: $color_slider_margin; 3006margin-top: $color_marks_slider_margin; 3007} 3008} 3009} 3010 3011&.vertical { 3012&:dir(ltr) { 3013padding: 0 0 0 12px; 3014 3015slider { 3016margin-left: $color_slider_margin; 3017margin-right: $color_marks_slider_margin; 3018} 3019} 3020 3021&:dir(rtl) { 3022padding: 0 12px 0 0; 3023 3024slider { 3025margin-right: $color_slider_margin; 3026margin-left: $color_marks_slider_margin; 3027} 3028} 3029} 3030} 3031} 3032 3033/** 3034* Progress bars 3035*/ 3036 3037progressbar { 3038// sizing 3039&.horizontal { 3040trough, 3041progress { 3042min-height: $bar-size; 3043} 3044} 3045 3046&.vertical { 3047trough, 3048progress { 3049min-width: $bar-size; 3050} 3051} 3052 3053// FIXME: insensitive state missing and some other state should be set probably 3054color: hint($on-surface); 3055font-size: smaller; 3056 3057trough { 3058background-color: disabled-stroke($on-surface); 3059} 3060 3061progress { 3062background-color: $primary; 3063} 3064 3065&.osd { // progressbar.osd used for epiphany page loading progress 3066// min-width: $bar-size; 3067// min-height: $bar-size; 3068// background-color: transparent; 3069 3070trough { 3071// background-color: transparent; 3072} 3073 3074progress { 3075// background-color: $primary; 3076} 3077} 3078 3079// makes the progress indicator disappear, when the fraction is 0 3080trough.empty progress { 3081all: unset; 3082} 3083} 3084 3085/** 3086* Level Bar 3087*/ 3088 3089levelbar { 3090&.horizontal { 3091block { 3092min-height: $bar-size; 3093} 3094 3095&.discrete block { 3096min-width: $medium-size; 3097 3098&:not(:last-child) { 3099margin-right: 2px; 3100} 3101} 3102} 3103 3104&.vertical { 3105block { 3106min-width: $bar-size; 3107} 3108 3109&.discrete block { 3110min-height: $medium-size; 3111 3112&:not(:last-child) { 3113margin-bottom: 2px; 3114} 3115} 3116} 3117 3118trough { 3119} 3120 3121block { 3122&.low { 3123background-color: $warning; 3124} 3125 3126&.high, 3127&:not(.empty) { 3128background-color: $primary; 3129} 3130 3131&.full { 3132background-color: $success; 3133} 3134 3135&.empty { 3136background-color: disabled-stroke($on-surface); 3137} 3138} 3139} 3140 3141/** 3142* Print dialog 3143*/ 3144 3145printdialog { 3146paper { 3147padding: 0; 3148border: 1px solid divider($on-surface); 3149background-clip: padding-box; 3150background-color: $surface-z1; 3151color: $on-surface; 3152} 3153 3154.dialog-action-box { 3155margin: 12px; 3156} 3157} 3158 3159/** 3160* Frames 3161*/ 3162 3163frame > border, 3164.frame { 3165margin: 0; 3166padding: 0; 3167border: 1px solid divider($on-surface); 3168border-radius: 0; 3169box-shadow: none; 3170background-clip: padding-box; 3171background-color: $surface-z1; 3172 3173&.flat { 3174border-style: none; 3175background-color: transparent; 3176} 3177} 3178 3179// for backward compatibility 3180frame.flat > border { 3181border-style: none; 3182background-color: transparent; 3183} 3184 3185actionbar > revealer > box { 3186padding: $container-padding; 3187border-top: 1px solid divider($on-surface); 3188// background-color: $surface-z1; 3189 3190button:not(.suggested-action):not(.destructive-action) { 3191@extend %button-flat; 3192} 3193 3194.linked:not(.vertical) > entry:not(:only-child) { 3195border-radius: $corner-radius $corner-radius 0 0; 3196} 3197} 3198 3199scrolledwindow { 3200// avoid double borders when viewport inside scrolled window 3201viewport.frame { 3202border-style: none; 3203background-color: transparent; 3204} 3205 3206// This is used when content is touch-dragged past boundaries. 3207// draws a box on top of the content, the size changes programmatically. 3208@at-root overshoot { 3209&.top { @include overshoot(top); } 3210 3211&.bottom { @include overshoot(bottom); } 3212 3213&.left { @include overshoot(left); } 3214 3215&.right { @include overshoot(right); } 3216} 3217 3218// Overflow indication, works similarly to the overshoot, the size if fixed tho. 3219@at-root undershoot { 3220// &.top { @include undershoot(top); } 3221 3222// &.bottom { @include undershoot(bottom); } 3223 3224// &.left { @include undershoot(left); } 3225 3226// &.right { @include undershoot(right); } 3227} 3228 3229// the small square between two scrollbars 3230@at-root junction { 3231border-style: solid none none solid; 3232border-width: 1px; 3233border-color: divider($on-surface); 3234// background-color: $surface-z0; 3235 3236&:dir(rtl) { 3237border-style: solid solid none none; 3238} 3239} 3240} 3241 3242// vbox and hbox separators 3243separator { 3244min-width: 1px; 3245min-height: 1px; 3246background-color: divider($on-surface); 3247} 3248 3249%hide_separators { 3250min-width: 0; 3251min-height: 0; 3252background-color: transparent; 3253} 3254 3255/** 3256* Lists 3257*/ 3258 3259list { 3260border-color: divider($on-surface); 3261// background-color: $surface-z1; 3262 3263row { 3264padding: 2px; 3265} 3266} 3267 3268row { 3269background-clip: padding-box; 3270 3271&.activatable { 3272@extend %ripple; 3273@include ink-color($on-surface, $hover-alt: true); 3274@include list-item; 3275 3276// this is for indicathing which row generated a popover 3277// see https://bugzilla.gnome.org/show_bug.cgi?id=754411 3278&.has-open-popup { 3279background-color: overlay("activated", $on-surface); 3280} 3281} 3282 3283&:selected { 3284@include ink-color($primary, $hover-alt: true, $on: $overlay-selected); 3285 3286&.has-open-popup { 3287background-color: overlay("activated", $primary, $on: $overlay-selected); 3288} 3289} 3290} 3291 3292/** 3293* App Notifications 3294*/ 3295 3296.app-notification { 3297@extend %toolbar-osd; 3298margin: 8px; 3299 3300button { 3301@extend %button-flat; 3302 3303&.text-button:not(:disabled) { 3304color: $primary; 3305@include ink-color($primary, $button-style: "flat"); 3306} 3307} 3308 3309&.frame { 3310border-style: none; 3311} 3312 3313border { 3314border-style: none; 3315background-color: transparent; 3316} 3317} 3318 3319/** 3320* Expanders 3321*/ 3322 3323expander { 3324title > arrow { 3325transition: all $duration $ease-out; 3326min-width: 16px; 3327min-height: 16px; 3328-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 3329 3330&:checked { 3331&:dir(ltr) { 3332-gtk-icon-transform: rotate(-180deg); 3333} 3334 3335&:dir(rtl) { 3336-gtk-icon-transform: rotate(180deg); 3337} 3338} 3339 3340color: hint($on-surface); 3341 3342&:hover, 3343&:active { 3344color: $on-surface; 3345} 3346 3347&:disabled { 3348color: disabled-hint($on-surface); 3349} 3350} 3351} 3352 3353/** 3354* Calendar 3355*/ 3356 3357calendar { 3358padding: 1px; 3359border: 1px solid divider($on-surface); 3360background-clip: padding-box; 3361background-color: $surface-z1; 3362color: $on-surface; 3363 3364&:disabled { 3365color: disabled($on-surface); 3366} 3367 3368&:selected { 3369border-radius: $corner-radius + 1px; 3370background-color: $overlay-selected; 3371} 3372 3373&.header { 3374border-style: none none solid; 3375border-color: divider($on-surface); 3376border-radius: 0; 3377} 3378 3379&.button { 3380border-radius: $corner-radius + 1px; 3381color: hint($on-surface); 3382 3383&:hover { 3384background-image: image(overlay("hover", $on-surface)); 3385} 3386 3387&:disabled { 3388color: disabled-hint($on-surface); 3389} 3390} 3391 3392&.highlight { 3393color: hint($on-surface); 3394font-weight: 500; 3395} 3396 3397&:indeterminate { 3398color: disabled-hint($on-surface); 3399} 3400} 3401 3402/** 3403* Dialogs 3404*/ 3405 3406// Message Dialog styling 3407messagedialog { 3408&.background { 3409background-color: $surface-z8; 3410} 3411 3412.titlebar { 3413min-height: $small-size; 3414border-style: none; 3415box-shadow: inset 0 1px highlight($surface-z8); 3416background-color: $surface-z8; 3417color: $on-surface; 3418 3419&:backdrop { 3420background-color: $surface-z8; 3421color: hint($on-surface); 3422} 3423} 3424 3425&.csd { 3426// rounded bottom border styling for csd version 3427&.background { 3428// bigger radius for better antialiasing 3429border-bottom-left-radius: $corner-radius; 3430border-bottom-right-radius: $corner-radius; 3431} 3432} 3433 3434// Hint text 3435box.vertical > label + label { 3436color: hint($on-surface); 3437} 3438 3439.dialog-action-box { 3440margin-top: -$container-padding; 3441// padding: $container-padding; 3442 3443button { 3444@extend %button-flat; 3445 3446&:not(:last-child) { 3447margin-right: $container-padding; 3448} 3449 3450&:not(:disabled) { 3451color: $primary; 3452@include ink-color($primary, $button-style: "flat"); 3453} 3454 3455&.suggested-action:not(:disabled) { 3456// color: $primary; 3457// @include ink-color($primary, $button-style: "flat"); 3458} 3459 3460&.destructive-action:not(:disabled) { 3461color: $error; 3462@include ink-color($error, $button-style: "flat"); 3463} 3464} 3465} 3466} 3467 3468filechooser { 3469.dialog-action-box { 3470border-top: 1px solid divider($on-surface); 3471} 3472 3473#pathbarbox { 3474border-bottom: 1px solid divider($on-surface); 3475// background-color: $surface-z0; 3476 3477// The new folder button 3478> stack > box > button { 3479@extend %button-flat-activatable; 3480 3481border-radius: $circular-radius; 3482} 3483} 3484} 3485 3486filechooserbutton:drop(active) { 3487// box-shadow: none; 3488} 3489 3490/** 3491* Sidebar 3492*/ 3493 3494.sidebar { 3495border-style: none; 3496background-color: transparent; 3497 3498&:not(separator) { 3499@at-root %sidebar_left, 3500&:dir(ltr), 3501&.left, 3502&.left:dir(rtl) { 3503border-right: 1px solid divider($on-surface); 3504border-left-style: none; 3505} 3506 3507@at-root %sidebar_right, 3508&:dir(rtl), 3509&.right { 3510border-left: 1px solid divider($on-surface); 3511border-right-style: none; 3512} 3513} 3514 3515list { 3516// background-color: transparent; 3517} 3518 3519paned & { 3520&, 3521&.left, 3522&.right, 3523&.left:dir(rtl), 3524&:dir(rtl), 3525&:dir(ltr) { 3526border-style: none; 3527} 3528} 3529} 3530 3531stacksidebar.sidebar { 3532& { 3533&:dir(ltr), 3534&.left, 3535&.left:dir(rtl) { 3536list { 3537@extend %sidebar_left; 3538} 3539} 3540 3541&:dir(rtl), 3542&.right { 3543list { 3544@extend %sidebar_right; 3545} 3546} 3547} 3548 3549+ separator.vertical, 3550separator.horizontal { 3551@extend %hide_separators; 3552} 3553 3554list { 3555padding: 4px; 3556// background-color: $surface-z0; // This should not be necessary, but the parent stacksidebar ignores background-color. 3557} 3558 3559row { 3560min-height: 32px; 3561padding: 0 8px - 6px; 3562border-radius: $corner-radius; 3563color: hint($on-surface); 3564font-weight: 500; 3565 3566&:selected { 3567$background-color: overlay("activated", $primary); 3568color: $primary; 3569@include ink-color($primary, $on: $background-color, $hover-alt: true); 3570} 3571 3572+ row { 3573margin-top: 4px; 3574} 3575 3576> label { 3577padding-left: 6px; 3578padding-right: 6px; 3579} 3580 3581&.needs-attention > label { 3582@extend %needs-attention; 3583} 3584} 3585} 3586 3587separator.sidebar { 3588background-color: divider($on-surface); 3589 3590&.selection-mode, 3591.selection-mode & { 3592// background-color: divider($on-primary); 3593} 3594} 3595 3596/** 3597* File chooser 3598*/ 3599 3600// dim the sidebar icons, see bug #786613 for details on this oddity 3601row image.sidebar-icon { 3602transition: color $duration $ease-out; 3603color: hint($on-surface); 3604 3605&:disabled { 3606color: disabled-hint($on-surface); 3607} 3608} 3609 3610placessidebar.sidebar { 3611> viewport.frame { 3612border-style: none; 3613background-color: transparent; 3614} 3615 3616list { 3617padding: (4px - 3px) 0 4px; 3618} 3619 3620row { 3621// Needs overriding of the GtkListBoxRow padding 3622min-height: 32px; 3623margin: -1px 4px; // Remove unwanted hard-coded vertical margins with -1px 3624padding: 0; 3625border-radius: $corner-radius; 3626 3627// Using margins/padding directly in the SidebarRow 3628// will make the animation of the new bookmark row jump 3629> revealer { 3630padding: 0 8px; 3631} 3632 3633&:selected { 3634$background-color: overlay("activated", $primary); 3635color: $primary; 3636font-weight: 500; 3637@include ink-color($primary, $on: $background-color, $hover-alt: true); 3638 3639image.sidebar-icon { 3640color: $primary; 3641} 3642} 3643 3644&:disabled { 3645color: disabled($on-surface); 3646} 3647 3648image.sidebar-icon { 3649&:dir(ltr) { 3650padding-right: 8px; 3651} 3652 3653&:dir(rtl) { 3654padding-left: 8px; 3655} 3656} 3657 3658label.sidebar-label { 3659&:dir(ltr) { 3660padding-right: 2px; 3661} 3662 3663&:dir(rtl) { 3664padding-left: 2px; 3665} 3666} 3667 3668@at-root button.sidebar-button { 3669@extend %button-flat-basic; 3670@extend %button-small; 3671} 3672 3673&.sidebar-placeholder-row { 3674background-color: overlay("hover", $on-surface); 3675} 3676 3677&.sidebar-new-bookmark-row { 3678color: $primary; 3679 3680image.sidebar-icon { 3681color: $primary; 3682} 3683} 3684} 3685} 3686 3687placesview { 3688.server-list-button { 3689> image { 3690-gtk-icon-transform: rotate(-.5turn); 3691} 3692 3693&:checked > image { 3694-gtk-icon-transform: rotate(0turn); 3695} 3696} 3697 3698// this selects the "connect to server" label 3699> actionbar > revealer > box > label { 3700padding-left: 8px; 3701padding-right: 8px; 3702} 3703} 3704 3705/** 3706* Paned 3707*/ 3708 3709paned { 3710> separator { 3711min-width: 1px; 3712min-height: 1px; 3713-gtk-icon-source: none; // defeats the ugly default handle decoration 3714border-style: none; // just to be sure 3715background-color: transparent; 3716// workaround, using background istead of a border since the border will get rendered twice (?) 3717background-image: image(divider($on-surface)); 3718background-size: 1px 1px; 3719background-clip: content-box; // avoids borders image being rendered twice (?) 3720 3721&.wide { 3722min-width: 6px; 3723min-height: 6px; 3724// background-color: $surface-z0; 3725background-image: image(divider($on-surface)), image(divider($on-surface)); 3726background-size: 1px 1px, 1px 1px; 3727} 3728} 3729 3730&.horizontal > separator { 3731background-repeat: repeat-y; 3732 3733&:dir(ltr) { 3734margin: 0 -8px 0 0; 3735padding: 0 8px 0 0; 3736background-position: left; 3737} 3738 3739&:dir(rtl) { 3740margin: 0 0 0 -8px; 3741padding: 0 0 0 8px; 3742background-position: right; 3743} 3744 3745&.wide { 3746margin: 0; 3747padding: 0; 3748background-repeat: repeat-y, repeat-y; 3749background-position: left, right; 3750} 3751} 3752 3753&.vertical > separator { 3754margin: 0 0 -8px 0; 3755padding: 0 0 8px 0; 3756background-repeat: repeat-x; 3757background-position: top; 3758 3759&.wide { 3760margin: 0; 3761padding: 0; 3762background-repeat: repeat-x, repeat-x; 3763background-position: bottom, top; 3764} 3765} 3766} 3767 3768/** 3769* GtkInfoBar 3770*/ 3771 3772infobar { 3773border-style: none; 3774 3775&.action:hover > revealer > box { 3776background-image: image(overlay("hover", $on-surface)); 3777} 3778 3779&.info > revealer > box, 3780&.question > revealer > box { 3781border-bottom: 1px solid divider($on-surface); 3782// background-color: $surface-z1; 3783 3784button { 3785@extend %button-flat; 3786 3787&.text-button:not(:disabled) { 3788color: $primary; 3789@include ink-color($primary, $button-style: "flat"); 3790} 3791} 3792} 3793 3794&.warning > revealer > box { 3795background-color: $warning; 3796color: $on-warning; 3797 3798button.flat { 3799color: $on-warning; 3800@include ink-color($on-warning, $button-style: "flat"); 3801} 3802 3803selection { 3804} 3805 3806*:link { 3807color: $on-warning; 3808} 3809} 3810 3811&.error > revealer > box { 3812background-color: $error; 3813color: $on-error; 3814 3815button.flat { 3816color: $on-error; 3817@include ink-color($on-error, $button-style: "flat"); 3818} 3819 3820selection { 3821} 3822 3823*:link { 3824color: $on-error; 3825} 3826} 3827 3828// Remove ugly hard-coded padding 3829button label { 3830margin: 0 -4px; 3831} 3832} 3833 3834/** 3835* Tooltips 3836*/ 3837 3838tooltip { 3839&.background { 3840// background-color needs to be set this way otherwise it gets drawn twice 3841// see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details. 3842background-color: $tooltip; 3843color: $on-tooltip; 3844} 3845 3846// padding: 4px; /* not working */ 3847border-radius: $corner-radius; 3848box-shadow: none; // otherwise it gets inherited by windowframe.csd 3849 3850&:not(.csd):not(.unity-csd) { 3851// border: 1px solid divider($on-surface); 3852// border-radius: $corner-radius + 1px; 3853} 3854 3855// FIXME: we need a border or tooltips vanish on black background. 3856decoration { 3857background-color: transparent; 3858} 3859 3860> box { 3861margin: -6px; // Remove hard-coded 6px margin 3862min-height: 32px - 4px * 2; 3863padding: 4px 8px; 3864} 3865 3866.dim-label { 3867color: hint($on-tooltip); 3868} 3869 3870* { 3871// workaround for Eclipse. 3872// do not include any declaration here. 3873} 3874} 3875 3876/** 3877* Color Chooser 3878*/ 3879 3880colorswatch { 3881// This widget is made of two boxes one on top of the other, the lower box is colorswatch {} the other one 3882// is colorswatch overlay {}, colorswatch has the programmatically set background, so most of the style is 3883// applied to the overlay box. 3884 3885// base color corners rounding 3886// to avoid the artifacts caused by rounded corner anti-aliasing the base color 3887// sports a bigger radius. 3888// nth-child is needed by the custom color strip. 3889 3890&.top { 3891border-top-left-radius: $corner-radius + .5px; 3892border-top-right-radius: $corner-radius + .5px; 3893 3894overlay { 3895border-top-left-radius: $corner-radius; 3896border-top-right-radius: $corner-radius; 3897} 3898} 3899 3900&.bottom { 3901border-bottom-left-radius: $corner-radius + .5px; 3902border-bottom-right-radius: $corner-radius + .5px; 3903 3904overlay { 3905border-bottom-left-radius: $corner-radius; 3906border-bottom-right-radius: $corner-radius; 3907} 3908} 3909 3910&.left, 3911&:first-child:not(.top) { 3912border-top-left-radius: $corner-radius + .5px; 3913border-bottom-left-radius: $corner-radius + .5px; 3914 3915overlay { 3916border-top-left-radius: $corner-radius; 3917border-bottom-left-radius: $corner-radius; 3918} 3919} 3920 3921&.right, 3922&:last-child:not(.bottom) { 3923border-top-right-radius: $corner-radius + .5px; 3924border-bottom-right-radius: $corner-radius + .5px; 3925 3926overlay { 3927border-top-right-radius: $corner-radius; 3928border-bottom-right-radius: $corner-radius; 3929} 3930} 3931 3932&.dark { 3933color: $on-dark; 3934} 3935 3936&.light { 3937color: $on-light; 3938} 3939 3940overlay { 3941transition: $transition-shadow; 3942box-shadow: $shadow-z1; 3943 3944&:drop(active), 3945&:hover { 3946box-shadow: $shadow-z3; 3947} 3948} 3949 3950&#add-color-button { 3951border-radius: $corner-radius $corner-radius 0 0; 3952color: $on-surface; 3953 3954&:only-child { 3955border-radius: $corner-radius; 3956} 3957 3958overlay { 3959background-color: $surface-z8; 3960} 3961} 3962 3963&:disabled { 3964opacity: .5; 3965 3966overlay { 3967box-shadow: none; 3968} 3969} 3970 3971row:selected & { 3972} 3973 3974&#editor-color-sample { 3975border-radius: $corner-radius + .5px; 3976 3977overlay { 3978border-radius: $corner-radius; 3979 3980&:hover { 3981// box-shadow: $shadow-z1; 3982} 3983} 3984} 3985} 3986 3987// colorscale popup 3988colorchooser .popover.osd { 3989transition: $transition-shadow; 3990border-radius: $corner-radius; 3991box-shadow: $shadow-z4, inset 0 1px highlight($surface-z8); 3992background-color: $surface-z8; 3993 3994&:backdrop { 3995box-shadow: $shadow-z2, inset 0 1px highlight($surface-z8); 3996} 3997} 3998 3999/** 4000* Misc 4001*/ 4002 4003// content view (grid/list) 4004.content-view { 4005// background-color: $surface-z0; 4006 4007&:hover { 4008// -gtk-icon-effect: highlight; 4009} 4010 4011rubberband, 4012.rubberband { 4013@extend %rubberband; 4014} 4015} 4016 4017.scale-popup { 4018.osd & { 4019// @extend %osd; 4020 4021// FIXME: quick hack, redo properly 4022button.flat { 4023} 4024} 4025 4026// +/- buttons on GtkVolumeButton popup 4027button { 4028} 4029} 4030 4031/** 4032* Window Decorations 4033*/ 4034 4035decoration { 4036transition: $transition-shadow; 4037border-radius: $corner-radius $corner-radius 0 0; 4038box-shadow: $shadow-z16, 0 16px (24px * .6) 2px transparent, 0 6px (30px * .6) 5px transparent; 4039 4040// FIXME rationalize shadows 4041 4042// this is used for the resize cursor area 4043margin: 8px; 4044 4045&:backdrop { 4046// the transparent shadow here is to enforce that the shadow extents don't 4047// change when we go to backdrop, to prevent jumping windows. 4048// The biggest shadow should be in the same order then in the active state 4049// or the jumping will happen during the transition. 4050box-shadow: $shadow-z4, 0 16px (24px * .6) 2px transparent, 0 6px (30px * .6) 5px transparent; 4051} 4052 4053.maximized &, 4054.fullscreen &, 4055.tiled &, 4056.tiled-top &, 4057.tiled-right &, 4058.tiled-bottom &, 4059.tiled-left & { 4060border-radius: 0; 4061} 4062 4063.popup & { 4064box-shadow: none; 4065} 4066 4067// server-side decorations as used by mutter 4068.ssd & { 4069box-shadow: 0 3px 3px rgba(black, .16); // just doing borders, wm draws actual shadows 4070} 4071 4072.csd.popup & { 4073border-radius: $corner-radius; 4074box-shadow: $shadow-z4; 4075} 4076 4077tooltip.csd & { 4078border-radius: $corner-radius; 4079box-shadow: none; 4080} 4081 4082messagedialog.csd & { 4083border-radius: $corner-radius; 4084// box-shadow: $shadow-z24, 0 24px (38px * .6) 3px transparent, 0 9px (46px * .6) 8px transparent; 4085 4086&:backdrop { 4087// box-shadow: $shadow-z4, 0 24px (38px * .6) 3px transparent, 0 9px (46px * .6) 8px transparent; 4088} 4089} 4090 4091.solid-csd & { 4092margin: 0; 4093padding: 2px; 4094border-radius: 0; 4095box-shadow: none; 4096box-shadow: inset 0 1px highlight($titlebar); 4097background-color: $titlebar; 4098 4099&:backdrop { 4100background-color: $titlebar-backdrop; 4101} 4102} 4103} 4104 4105// Window Close button 4106button.titlebutton { 4107border-radius: $circular-radius; 4108 4109.selection-mode & { 4110} 4111} 4112 4113 4114// catch all extend :) 4115 4116.monospace { 4117font-family: monospace; 4118} 4119 4120/** 4121* Touch Copy & Paste 4122*/ 4123 4124// touch selection handlebars for the Popover.osd above 4125cursor-handle { 4126color: $primary; 4127-gtk-icon-source: -gtk-recolor(url("icons/cursor-handle-symbolic.svg")); 4128 4129&.top:dir(ltr), 4130&.bottom:dir(rtl) { 4131-gtk-icon-transform: rotate(90deg); 4132} 4133 4134&.bottom:dir(ltr), 4135&.top:dir(rtl) { 4136-gtk-icon-transform: unset; 4137} 4138 4139&.insertion-cursor:dir(ltr), 4140&.insertion-cursor:dir(rtl) { 4141padding-top: 6px; 4142-gtk-icon-transform: rotate(45deg); 4143} 4144} 4145 4146// Decouple the font of context menus from their entry/textview 4147.context-menu { 4148font: initial; 4149} 4150 4151// shortcut window keys 4152.keycap { 4153min-width: 28px - 8px * 2; 4154min-height: 28px; 4155padding-left: 8px; 4156padding-right: 8px; 4157border-radius: $corner-radius; 4158box-shadow: $shadow-z1; 4159background-color: $surface-z8; 4160color: $on-surface; 4161font-size: smaller; 4162} 4163 4164// workaround for clipped shadows of .keycap 4165shortcut:last-child { 4166margin-bottom: 4px; 4167} 4168 4169// FIXME needs to be done widget by widget, this wildcard should really die 4170:not(decoration):not(window):drop(active) { 4171// caret-color: $primary; 4172} 4173 4174// FIXME aggregate with buttons 4175stackswitcher button.text-button { 4176min-width: 100px; 4177} 4178 4179// FIXME aggregate with buttons 4180stackswitcher button.circular, 4181stackswitcher button.text-button.circular { 4182min-width: $medium-size; 4183min-height: $medium-size; 4184padding: 0; 4185} 4186 4187/** 4188* App Icons 4189*/ 4190 4191// Outline for low res icons 4192.lowres-icon { 4193// -gtk-icon-shadow: none; 4194} 4195 4196// Drapshadow for large icons 4197.icon-dropshadow { 4198// -gtk-icon-shadow: none; 4199} 4200 4201/** 4202* Emoji 4203*/ 4204 4205popover.emoji-picker { 4206padding: 0; 4207 4208entry { 4209border-bottom: 1px solid divider($on-surface); 4210border-image: none; 4211border-radius: 0; 4212box-shadow: none; 4213background-color: transparent; 4214} 4215 4216scrolledwindow { 4217border-bottom: 1px solid divider($on-surface); 4218} 4219} 4220 4221button.emoji-section { 4222margin: 4px; 4223 4224&:not(:last-child) { 4225margin-right: 0; 4226} 4227} 4228 4229popover.emoji-picker .emoji { 4230min-width: 3em; 4231min-height: 3em; 4232padding: 0 8px; 4233// font-size: larger; 4234 4235widget { 4236transition: $transition; 4237border-radius: $corner-radius; 4238 4239&:hover { 4240background-color: overlay("hover", $on-surface); 4241} 4242} 4243} 4244 4245popover.emoji-completion { 4246padding: 8px 0; 4247 4248arrow { 4249border: none; 4250background: none; 4251} 4252 4253.emoji-completion-row { 4254min-height: $menuitem-size; 4255padding: 0 12px; 4256} 4257 4258.emoji:hover { 4259background-color: overlay("hover", $on-surface); 4260} 4261} 4262