_common.scss
Unicode text, UTF-8 text
1$asset_suffix: if($variant=='dark', '-dark', ''); 2 3$extra_background_clip: if($variant == 'light', padding-box, border-box); 4 5$small_size: 24px; 6$medium_size: 36px; 7$large_size: 48px; 8 9$container_padding: 6px; 10$material_radius: 2px; 11 12$material_duration: 0.2s; 13$material_timing_function: cubic-bezier(0.4, 0, 0.2, 1); 14 15* { 16padding: 0; 17background-clip: padding-box; 18transition-property: opacity, border-color, border-image, box-shadow, 19background-color, background-image, text-shadow, icon-shadow; 20transition-duration: $material_duration; 21transition-timing-function: $material_timing_function; 22-GtkToolButton-icon-spacing: 4; 23-GtkTextView-error-underline-color: $error_color; 24 25-GtkCheckButton-indicator-size: 20; 26-GtkCheckMenuItem-indicator-size: 16; 27 28// The size for scrollbars. The slider is 2px smaller, but we keep it 29// up so that the whole area is sensitive to button presses for the 30// slider. The stepper button is larger in both directions, the slider 31// only in the width 32 33-GtkScrolledWindow-scrollbar-spacing: 0; 34-GtkScrolledWindow-scrollbars-within-bevel: 1; 35 36-GtkToolItemGroup-expander-size: 11; 37-GtkExpander-expander-size: 16; 38-GtkTreeView-expander-size: 11; 39 40-GtkTreeView-horizontal-separator: 4; 41 42-GtkMenu-horizontal-padding: 0; 43-GtkMenu-vertical-padding: 0; 44 45-GtkWidget-link-color: $link_color; 46-GtkWidget-visited-link-color: $link_visited_color; 47 48-GtkWidget-focus-padding: 2; // FIXME: do we still need these? 49-GtkWidget-focus-line-width: 1; // 50 51-GtkWidget-text-handle-width: 20; 52-GtkWidget-text-handle-height: 20; 53 54-GtkDialog-button-spacing: 4; 55-GtkDialog-action-area-border: 0; 56 57-GtkStatusbar-shadow-type: none; 58 59// We use the outline properties to signal the focus properties 60// to the adwaita engine: using real CSS properties is faster, 61// and we don't use any outlines for now. 62 63outline-style: solid; 64outline-width: 2px; 65outline-color: $track_color; 66outline-offset: -4px; 67outline-radius: 2px; 68} 69 70 71/*************** 72* Base States * 73***************/ 74 75.background { 76background-color: $bg_color; 77color: $fg_color; 78 79&:backdrop { 80// color: $backdrop_fg_color; 81} 82} 83 84/* 85These wildcard seems unavoidable, need to investigate. 86Wildcards are bad and troublesome, use them with care, 87or better, just don't. 88Everytime a wildcard is used a kitten dies, painfully. 89*/ 90 91*:insensitive { 92-gtk-image-effect: dim; 93} 94 95.gtkstyle-fallback { 96background-color: $bg_color; 97color: $fg_color; 98&:prelight { 99background-color: darken($bg_color, 5%); 100color: $fg_color; 101} 102&:active { 103background-color: darken($bg_color, 10%); 104color: $fg_color; 105} 106&:insensitive { 107background-color: $bg_color; 108color: $insensitive_fg_color; 109} 110&:selected { 111background-color: $selected_bg_color; 112color: $selected_fg_color; 113} 114} 115 116.view { 117@extend .list-row.activatable; 118background-color: $base_color; 119color: $fg_color; 120 121&:hover, &:active, &:selected { border-radius: 2px; } 122 123&:insensitive { 124// background-color: $secondary_base_color; 125color: $insensitive_fg_color; 126} 127 128&:backdrop { 129// color: $backdrop_fg_color; 130} 131 132&:selected { @extend %selected_items; } 133} 134 135.rubberband { 136border: 1px solid $secondary_selected_bg_color; 137background-color: scale-alpha($secondary_selected_bg_color, $lower_opacity); 138} 139 140.label { 141&.separator { 142color: $fg_color; 143@extend .dim-label; 144// &:backdrop { color: $backdrop_fg_color; } 145} 146&:selected { 147@extend %selected_items; 148} 149&:insensitive { 150color: $insensitive_fg_color; 151// &:backdrop { color: $backdrop_insensitive_fg_color; } 152} 153} 154 155.dim-label { 156opacity: $hint_opacity; 157} 158 159GtkAssistant { 160.sidebar { 161padding: 6px 0; 162border-top: 1px solid $borders_color; 163&:dir(ltr) { border-right: 1px solid $borders_color; } 164&:dir(rtl) { border-left: 1px solid $borders_color; } 165} 166&.csd .sidebar { border-top-style: none; } 167.sidebar .label { 168opacity: $hint_opacity; 169padding: 5px 12px 6px; 170font-weight: bold; 171} 172.sidebar .label.highlight { 173opacity: 1; 174} 175} 176 177GtkTextView { // This will get overridden by .view, needed by gedit line numbers 178background-color: $secondary_base_color; 179} 180 181.grid-child { 182// outline-offset: -2px; 183padding: 4px; 184border-radius: 2px; 185&:selected { @extend %selected_items; } 186} 187 188%osd, .osd { opacity: $higher_opacity; } 189 190/********************* 191* Spinner Animation * 192*********************/ 193 194@keyframes spin { 195to { -gtk-icon-transform: rotate(1turn); } 196} 197 198.spinner { 199background-color: blue; 200background-image: none; 201opacity: 0; // non spinning spinner makes no sense 202-gtk-icon-source: -gtk-icontheme('process-working-symbolic'); 203&:active { 204opacity: 1; 205animation: spin 1s linear infinite; 206&:insensitive { 207opacity: $disabled_opacity; 208} 209} 210} 211 212/**************** 213* Text Entries * 214****************/ 215 216.entry { 217padding: 7px 8px 8px; 218border-radius: 2px; 219@include entry(normal); 220&:focus { @include entry(focus); } 221&:insensitive { @include entry(insensitive); } 222&.flat { 223border-radius: 0; 224@include entry(flat); 225&:focus { @include entry(flat-focus); } 226&:insensitive { @include entry(flat-insensitive); } 227} 228 229&:selected { @extend %selected_items; } 230 231&.image { // icons inside the entry 232&.left { padding-left: 2px; } 233&.right { padding-right: 2px; } 234} 235 236&.progressbar { 237margin: 2px; 238border-style: none none solid; 239border-width: 2px; 240border-color: $selected_bg_color; 241border-radius: 0; 242box-shadow: none; 243background-color: transparent; 244background-image: none; 245} 246 247.linked > &:not(.flat) { @extend %linked; } 248 249.linked.vertical > &:not(.flat) { @extend %linked_vertical; } 250 251// entry error and warning style 252@each $e_type, $e_color in (error, $error_color), 253(warning, $warning_color) { 254&.#{$e_type} { 255@include entry(normal, $e_color); 256&:focus { @include entry(focus, $e_color); } 257&:insensitive { @include entry(insensitive, $e_color); } 258&.flat { 259@include entry(flat, $e_color); 260&:focus { @include entry(flat-focus, $e_color); } 261&:insensitive { @include entry(flat-insensitive, $e_color); } 262} 263} 264} 265 266&.image { // entry icons colors 267&:not(:hover):not(:active) { color: gtkalpha(currentColor, $enabled_opacity); } 268&:insensitive { color: gtkalpha(currentColor, $hint_opacity); } 269} 270 271.osd & { 272} 273} 274 275 276/*********** 277* Buttons * 278***********/ 279 280// stuff for .needs-attention 281@keyframes needs_attention { 282from { 283background-image: -gtk-gradient(radial, 284center center, 0, 285center center, 0.001, 286to($accent_bg_color), 287to(transparent)); 288} 289to { 290background-image: -gtk-gradient(radial, 291center center, 0, 292center center, 0.5, 293to($accent_bg_color), 294to(transparent)); 295} 296} 297 298 299.button { 300padding: 7px 10px 8px; 301border-radius: 2px; 302background-repeat: no-repeat; 303background-position: center, center; 304background-size: ($medium_size * 2 / 0.8) ($medium_size * 2 / 0.8), auto; 305font-weight: 500; 306@include button(normal); 307&:hover { @include button(hover); } 308&:active { @include button(active); } 309&:insensitive { @include button(insensitive); } 310&:checked { @include button(checked); } 311&:checked:insensitive { @include button(checked-insensitive); } 312&.flat { 313@include button(flat); 314&:hover { @include button(flat-hover); } 315&:active { @include button(flat-active); } 316&:insensitive { @include button(flat-insensitive); } 317&:checked { @include button(flat-checked); } 318&:checked:insensitive { @include button(flat-checked-insensitive); } 319.linked > & { 320border-radius: 2px; 321&.image-button { 322outline-radius: 100px; 323border-radius: 100px; 324} 325} 326} 327// big standalone buttons like in Documents pager 328&.osd { 329&.image-button { 330padding: 16px; 331background-size: ($large_size / 0.8) ($large_size / 0.8), auto; 332} 333&:insensitive { opacity: 0; } 334} 335//overlay / OSD style 336.osd & { 337} 338 339// Suggested and Destructive Action buttons 340@each $b_type, $b_color in (suggested-action, $suggested_color), 341(destructive-action, $destructive_color) { 342&.#{$b_type} { 343background-color: $b_color; 344color: $selected_fg_color; 345// @include button(normal, $b_color, white); 346// &:hover { @include button(hover, $b_color, white); } 347// &:active, &:checked { @include button(active, $b_color, white); } 348&:insensitive { @include button(insensitive, $b_color, white); } 349&:checked { background-color: mix($selected_fg_color, $b_color, percentage($lower_opacity)); } 350&.flat { 351background-color: transparent; 352color: $b_color; 353// @include button(flat, $b_color, white); 354// &:hover { @include button(flat-hover, $b_color, white); } 355// &:active, &:checked { @include button(flat-active, $b_color, white); } 356&:insensitive { @include button(flat-insensitive, $b_color, white); } 357} 358} 359} 360 361&.image-button { @extend %image_button; } 362 363&.text-button { 364padding-left: 16px; 365padding-right: 16px; 366} 367 368&.text-button.image-button { 369// those buttons needs uneven horizontal padding, we want the icon side 370// to have the image-button padding, while the text side the text-button 371// one, so we're adding the missing padding to the label depending on 372// its position inside the button 373padding: 7px 10px 8px; // same as .button 374outline-radius: 2px; 375border-radius: 2px; 376background-size: ($medium_size * 2 / 0.8) ($medium_size * 2 / 0.8), auto; 377.label:first-child { padding-left: 6px; } 378.label:last-child { padding-right: 6px; } 379} 380 381.stack-switcher > & { 382// to position the needs attention dot, padding is added to the button 383// child, a label needs just lateral padding while an icon needs vertical 384// padding added too. 385 386outline-offset: -4px; // needs to be set or it gets overriden by GtkRadioButton outline-offset 387 388> .label { 389padding-left: 6px; // label padding 390padding-right: 6px; // 391} 392> GtkImage { 393padding-left: 6px; // image padding 394padding-right: 6px; // 395padding-top: 3px; // 396padding-bottom: 3px; // 397} 398&.text-button { 399padding: 7px 10px 8px; // needed or it will get overridden 400} 401&.image-button { 402// we want image buttons to have a 1:1 aspect ratio, so compensation 403// of the padding added to the GtkImage is needed 404padding: 7px 4px; 405} 406&.needs-attention > .label, 407&.needs-attention > GtkImage { @extend %needs_attention; } 408&.needs-attention:checked > .label, 409&.needs-attention:checked > GtkImage { 410animation: none; 411background-image: none; 412} 413} 414 415//inline-toolbar buttons 416.inline-toolbar & { 417@extend .button.flat; 418@extend %image_button; 419} 420 421.primary-toolbar & { icon-shadow: none; } // tango icons don't need shadows 422 423.linked > &:not(.flat):not(:only-child) { @extend %linked; } 424 425.linked.vertical > &:not(.flat):not(:only-child) { @extend %linked_vertical; } 426} 427 428%image_button { 429padding: 10px; 430outline-radius: 100px; 431border-radius: 100px; 432background-size: ($medium_size / 0.8) ($medium_size / 0.8), auto; 433} 434 435%needs_attention { 436transition: none; 437animation: needs_attention $material_duration $material_timing_function forwards; 438background-repeat: no-repeat; 439background-position: right 3px; 440background-size: 6px 6px; 441&:dir(rtl) { background-position: left 3px; } 442} 443 444 445// all the following is for the +|- buttons on inline toolbars, that way 446// should really be deprecated... 447.inline-toolbar GtkToolButton > .button { // redefining the button look is 448// needed since those are flat... 449} 450 451// More inline toolbar buttons 452.inline-toolbar.toolbar GtkToolButton { 453// & > .button.flat { @extend %linked_middle; } 454// &:first-child > .button.flat { @extend %linked:first-child; } 455// &:last-child > .button.flat { @extend %linked:last-child; } 456// &:only-child > .button.flat { @extend %linked:only-child; } 457} 458 459%linked_middle { 460border-radius: 0; 461} 462 463%linked { 464outline-radius: 2px; 465@extend %linked_middle; 466&:first-child { 467border-top-left-radius: 2px; 468border-bottom-left-radius: 2px; 469} 470&:last-child { 471border-top-right-radius: 2px; 472border-bottom-right-radius: 2px; 473} 474&:only-child { 475border-radius: 2px; 476} 477} 478 479%linked_vertical_middle { 480border-radius: 0; 481} 482 483%linked_vertical{ 484outline-radius: 2px; 485@extend %linked_vertical_middle; 486&:first-child { 487border-top-left-radius: 2px; 488border-top-right-radius: 2px; 489} 490&:last-child { 491border-bottom-left-radius: 2px; 492border-bottom-right-radius: 2px; 493} 494&:only-child { 495border-radius: 2px; 496} 497} 498 499/* menu buttons */ 500.menuitem.button.flat { 501&:selected { @extend %selected_items; } 502} 503 504 505GtkColorButton.button { 506padding: 7px 8px 8px; // Uniform padding on the GtkColorButton 507 508GtkColorSwatch:first-child:last-child { // :first-child:last-child for a specificity bump, it gets overridden by the 509// colorpicker style, otherwise 510border-radius: 2px; 511box-shadow: $z-depth-1; 512} 513} 514 515/********* 516* Links * 517*********/ 518 519*:link { 520color: $link_color; 521&:hover, &:active { color: $link_color; } 522&:visited { 523color: $link_visited_color; 524&:hover, &:active { color: $link_visited_color; } 525*:selected & { color: mix($selected_fg_color, $selected_bg_color, 60%); } 526} 527&:selected, *:selected & { 528color: mix($selected_fg_color, $selected_bg_color, 80%); 529} 530} 531 532.button:link, .button:visited { 533@extend *:link; 534& > .label { 535text-decoration-line: underline; 536} 537} 538 539/***************** 540* GtkSpinButton * 541*****************/ 542 543.spinbutton { 544.button { 545padding: 4px; 546border: solid $container_padding transparent; 547@extend %image_button; 548// @extend .button.flat; 549@include button(flat); 550&:hover { @include button(flat-hover); } 551&:active { @include button(flat-active); } 552&:insensitive { @include button(flat-insensitive); } 553} 554.osd & { 555.button { 556} 557} 558&.vertical { //FIXME: try using linking templates for vertically linked stuff 559.button { 560padding-top: 10px; // Same vertical padding as image-buttons 561padding-bottom: 10px; // 562border: none; 563&:first-child { 564border-radius: 2px 2px 0 0; 565} 566&:last-child { 567border-radius: 0 0 2px 2px; 568} 569} 570&.entry { 571} 572} 573GtkTreeView & { 574&.entry, &.entry:focus { 575// padding: 1px; 576// border-width: 1px 0; 577// border-color: $selected_bg_color; 578// border-radius: 0; 579// box-shadow: none; 580} 581} 582} 583 584/************** 585* ComboBoxes * 586**************/ 587GtkComboBox { 588> .the-button-in-the-combobox { padding: 5px 6px 6px; } // Otherwise combos 589// are bigger then 590// buttons 591-GtkComboBox-arrow-scaling: 0.5; 592-GtkComboBox-shadow-type: none; 593 594.menu .menuitem { padding: 5px 6px 6px; } 595.separator.vertical { 596// always disable separators 597-GtkWidget-wide-separators: true; 598} 599&.combobox-entry .entry { 600&:dir(ltr) { 601border-top-right-radius: 0; 602border-bottom-right-radius: 0; 603} 604&:dir(rtl) { 605border-top-left-radius: 0; 606border-bottom-left-radius: 0; 607} 608} 609&.combobox-entry .button { 610padding: 10px; 611&:dir(ltr) { 612border-top-left-radius: 0; 613border-bottom-left-radius: 0; 614} 615&:dir(rtl) { 616border-top-right-radius: 0; 617border-bottom-right-radius: 0; 618} 619} 620} 621 622.linked > GtkComboBox > .the-button-in-the-combobox, 623.linked > GtkComboBoxText > .the-button-in-the-combobox { 624// the combo is a composite widget so the way we do button linkind doesn't 625// work, special case needed. See 626// https://bugzilla.gnome.org/show_bug.cgi?id=733979 627&:dir(ltr), 628&:dir(rtl) { @extend %linked_middle; } // specificity bump 629} 630.linked > GtkComboBox:first-child > .the-button-in-the-combobox, 631.linked > GtkComboBoxText:first-child > .the-button-in-the-combobox { 632@extend %linked:first-child; 633} 634.linked > GtkComboBox:last-child > .the-button-in-the-combobox, 635.linked > GtkComboBoxText:last-child > .the-button-in-the-combobox { 636@extend %linked:last-child; 637} 638.linked > GtkComboBox:only-child > .the-button-in-the-combobox, 639.linked > GtkComboBoxText:only-child > .the-button-in-the-combobox { 640@extend %linked:only-child; 641} 642 643.linked.vertical > GtkComboBoxText > .the-button-in-the-combobox, 644.linked.vertical > GtkComboBox > .the-button-in-the-combobox { @extend %linked_vertical_middle; } 645.linked.vertical > GtkComboBoxText:first-child > .the-button-in-the-combobox, 646.linked.vertical > GtkComboBox:first-child > .the-button-in-the-combobox { @extend %linked_vertical:first-child; } 647.linked.vertical > GtkComboBoxText:last-child > .the-button-in-the-combobox, 648.linked.vertical > GtkComboBox:last-child > .the-button-in-the-combobox { @extend %linked_vertical:last-child; } 649.linked.vertical > GtkComboBoxText:only-child > .the-button-in-the-combobox, 650.linked.vertical > GtkComboBox:only-child > .the-button-in-the-combobox { @extend %linked_vertical:only-child; } 651 652/************ 653* Toolbars * 654************/ 655.toolbar { 656-GtkWidget-window-dragging: true; 657padding: 4px; 658background-color: $bg_color; 659.osd &, &.osd { 660padding: $container_padding; 661border-style: solid; 662border-width: 8px; 663border-image: -gtk-scaled(url("assets/osd-shadow#{$asset_suffix}.png"), 664url("assets/osd-shadow#{$asset_suffix}@2.png")) 66510 / 10px stretch; 666border-radius: 2px; 667// box-shadow: $z-depth-2; 668background-color: $base_color; 669&:backdrop { 670border-image: -gtk-scaled(url("assets/osd-shadow-backdrop#{$asset_suffix}.png"), 671url("assets/osd-shadow-backdrop#{$asset_suffix}@2.png")) 67210 / 10px stretch; 673// box-shadow: $z-depth-1; 674} 675& .button { 676@extend .button.flat; 677} 678} 679} 680 681//searchbar, location-bar & inline-toolbar 682.inline-toolbar { 683padding: $container_padding; 684border-style: solid; 685border-width: 0 1px 1px; 686border-color: $borders_color; 687background-color: $secondary_base_color; 688} 689 690.search-bar, .location-bar { 691padding: $container_padding; 692border-style: solid; 693border-width: 0 0 1px; 694border-color: $borders_color; 695background-color: $dark_color; 696background-clip: border-box; 697} 698 699/*************** 700* Header bars * 701***************/ 702 703.titlebar, 704.header-bar { 705padding: $container_padding; 706border-width: 0 0 1px; 707border-style: solid; 708border-color: $borders_color; 709border-radius: 2px 2px 0 0; 710box-shadow: inset 0 1px $highlight_color; 711background-color: $dark_color; 712background-clip: border-box; 713 714&:backdrop { 715// background-color: $dark_color; 716} 717 718.title { 719padding-left: 12px; 720padding-right: 12px; 721font-weight: bold; 722} 723 724.subtitle { 725@extend .dim-label; 726padding-left: 12px; 727padding-right: 12px; 728font-size: smaller; 729} 730 731.header-bar-separator, 732& > GtkBox > .separator.vertical { 733-GtkWidget-wide-separators: true; 734-GtkWidget-separator-width: 1px; 735border-style: solid; 736border-width: 0 1px; 737border-color: $borders_color; 738} 739 740& .button:not(.suggested-action):not(.destructive-action) { 741@extend .button.flat; 742border-image: -gtk-gradient(radial, 743center bottom, 0, 744center bottom, 0.001, 745to($selected_bg_color), 746to(transparent)) 7470 0 0 / 0 0 0px; 748&:checked { 749border-image: -gtk-gradient(radial, 750center bottom, 0, 751center bottom, 0.5, 752to($selected_bg_color), 753to(transparent)) 7540 0 2 / 0 0 2px; 755// box-shadow: inset 0 -2px $selected_bg_color; 756background-color: transparent; 757color: $fg_color; 758// transition: all $material_duration $material_timing_function, box-shadow 0 $material_timing_function $material_duration, color 0; 759// &:active { transition: none; } 760&:insensitive { 761background-color: transparent; 762color: $insensitive_fg_color; 763> .label { color: inherit; } 764} 765} 766} 767 768&.selection-mode { 769box-shadow: inset 0 1px $secondary_highlight_color; 770background-color: $selected_bg_color; 771color: $selected_fg_color; 772&:backdrop { 773} 774 775.subtitle:link { @extend *:link:selected; } 776 777.button { 778border-image: -gtk-gradient(radial, 779center bottom, 0, 780center bottom, 0.001, 781to($selected_fg_color), 782to(transparent)) 7830 0 0 / 0 0 0px; 784color: $secondary_selected_fg_color; 785&:hover, &:active, &:checked { 786color: $selected_fg_color; 787} 788 789&:insensitive { 790} 791 792&:checked { 793border-image: -gtk-gradient(radial, 794center bottom, 0, 795center bottom, 0.5, 796to($selected_fg_color), 797to(transparent)) 7980 0 2 / 0 0 2px; 799// box-shadow: inset 0 -2px $selected_fg_color; 800color: $selected_fg_color; 801&:insensitive { 802color: $insensitive_selected_fg_color; 803> .label { color: inherit; } 804} 805} 806&.suggested-action { 807// NOTE: do not use @extend .button; 808@include button(normal); 809&:hover { @include button(hover); } 810&:active { @include button(active); } 811&:insensitive { @include button(insensitive); } 812} 813} 814 815.selection-menu { 816padding-left: 16px; 817padding-right: 16px; 818 819GtkArrow { -GtkArrow-arrow-scaling: 1; } 820 821.arrow { 822-gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 823} 824} 825} 826 827.tiled &, .maximized & { 828border-radius: 0; // squared corners when the window is max'd or tiled 829box-shadow: none; 830} 831 832&.default-decoration { 833padding: $container_padding; 834border-width: 0; 835.button { padding: 4px; } 836} 837} 838 839/************ 840* Pathbars * 841************/ 842 843.path-bar .button { 844padding: 7px 6px 8px; 845&.image-button { padding: 10px; } 846&:only-child { 847padding-left: 16px; 848padding-right: 16px; 849} 850 851// the following is for spacing the icon and the label inside the home button 852.label:last-child { padding-left: 2px; } 853.label:first-child { padding-right: 2px; } 854.label:only-child { padding-right: 0; padding-left: 0; } 855GtkImage { padding-top: 1px; } 856} 857 858/************** 859* Tree Views * 860**************/ 861GtkTreeView.view { 862-GtkTreeView-grid-line-width: 1; 863-GtkTreeView-grid-line-pattern: ''; 864-GtkTreeView-tree-line-width: 1; 865-GtkTreeView-tree-line-pattern: ''; 866-GtkTreeView-expander-size: 16; 867 868border-left-color: $track_color; // this is actually the tree lines color, 869border-top-color: $borders_color; // while this is the grid lines color, better then nothing 870 871&.rubberband { @extend .rubberband; } // to avoid borders being overridden by the previously set props 872 873border-radius: 0; // rest border radius in lists 874 875&:hover, &:active, &:selected { border-radius: 0; } 876 877&.dnd { 878border-style: solid none; 879border-width: 1px; 880border-color: mix($fg_color, $selected_bg_color, 50%); 881} 882 883&.expander { 884-gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); 885&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); } 886&:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); } 887&:selected { 888color: scale-alpha($selected_fg_color, $enabled_opacity); 889&:hover, &:active { color: $selected_fg_color; } 890} 891} 892 893&.progressbar { // progress bar in treeviews 894@extend .entry.progressbar; 895border-width: 4px; 896&:selected { 897border-color: currentColor; 898} 899} 900 901&.trough { // progress bar trough in treeviews 902@extend .entry.progressbar; 903border-width: 4px; 904border-color: scale-alpha($selected_bg_color, $lower_opacity); 905&:selected { 906border-color: $track_color; 907} 908} 909} 910 911column-header { 912.button { 913@extend .list-row.activatable; 914padding: 3px 6px 4px; 915border-style: none solid solid none; 916border-width: 1px; 917border-color: $borders_color; 918border-radius: 0; 919box-shadow: none; 920background-color: $base_color; 921// font-weight: bold; 922&:hover, &:active { 923box-shadow: none; 924} 925&:insensitive { 926background-color: $base_color; 927} 928&.dnd { 929@extend column-header.button.dnd; 930} 931} 932&:last-child .button, 933&:last-child.button { //treeview-like derived widgets in Banshee and Evolution 934border-right-style: none; 935} 936} 937 938column-header.button.dnd { // for treeview-like derive widgets 939border-left-style: solid; 940background-clip: $extra_background_clip; 941color: $selected_bg_color; 942} 943 944 945/********* 946* Menus * 947*********/ 948.menubar { 949-GtkWidget-window-dragging: true; 950padding: 0px; 951box-shadow: inset 0 -1px $borders_color; 952background-color: $dark_color; 953& > .menuitem { 954padding: 4px 8px; 955color: $secondary_fg_color; 956&:hover { //Seems like it :hover even with keyboard focus 957box-shadow: inset 0 -2px $selected_bg_color; 958color: $fg_color; 959} 960&:insensitive { 961color: $insensitive_fg_color; 962box-shadow: none; 963} 964} 965} 966 967.menu { 968margin: 4px; 969padding: 0px; 970background-color: $base_color; 971border: 1px solid $borders_color; // adds borders in a non composited env 972.csd & { border: none; } // axes borders in a composited env 973.menuitem { 974transition: none; 975padding: 3px 4px 4px; 976font: initial; 977text-shadow: none; 978&:hover { 979color: $selected_fg_color; 980background-color: $selected_bg_color; 981} 982&:insensitive { 983color: $insensitive_fg_color; 984} 985//submenu indicators 986&.arrow { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); } 987&.arrow:dir(rtl) {-gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl'); } 988} 989&.button { // overlow buttons 990border-style: none; 991border-radius: 0; 992&.top { border-bottom: 1px solid $borders_color; } 993&.bottom { border-top: 1px solid $borders_color; } 994&:hover { background-color: $track_color; } 995&:insensitive { 996color: transparent; 997background-color: transparent; 998border-color: transparent ; 999} 1000} 1001} 1002 1003.menuitem .accelerator { color: gtkalpha(currentColor, $hint_opacity); } 1004 1005 1006/*************** 1007* Popovers * 1008***************/ 1009 1010.popover { 1011padding: 2px; 1012border: 1px solid; 1013border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.3); 1014border-radius: 2px + 1px; 1015background-color: $secondary_base_color; 1016box-shadow: $z-depth-2; 1017&:backdrop { box-shadow: $z-depth-1; } 1018 1019> .list, 1020> .view, 1021> .toolbar, 1022&.osd > .toolbar { 1023border-style: none; 1024border-image: none; 1025background-color: transparent; 1026} 1027 1028.button.flat { 1029padding: 5px 8px 6px; 1030background-color: transparent; 1031background-size: (128px / 0.8) (128px / 0.8), auto; 1032color: $fg_color; 1033font: initial; 1034} 1035 1036.linked > .button { 1037border-radius: 2px; 1038// @extend .button.flat; 1039@include button(flat); 1040&:hover { @include button(flat-hover); } 1041&:active { @include button(flat-active); } 1042&:insensitive { @include button(flat-insensitive); } 1043&:checked { @include button(checked); } 1044&:checked:insensitive { @include button(checked-insensitive); } 1045&.image-button { background-size: ($medium_size * 2 / 0.8) ($medium_size * 2 / 0.8), auto; } 1046} 1047 1048&.osd { @extend %osd; } 1049} 1050 1051/***************** 1052* Notebooks and * 1053* Tabs * 1054*****************/ 1055 1056.notebook { 1057// Through me you go to the grief wracked city; 1058// Through me you go to everlasting pain; 1059// Through me you go a pass among lost souls. 1060// ... 1061// Abandon all hope — Ye Who Enter Here 1062padding: 0; 1063background-color: $base_color; 1064-GtkNotebook-initial-gap: 6; 1065-GtkNotebook-arrow-spacing: 5; 1066-GtkNotebook-tab-curvature: 0; 1067-GtkNotebook-tab-overlap: 1; 1068-GtkNotebook-has-tab-gap: false; 1069-GtkWidget-focus-padding: 0; 1070-GtkWidget-focus-line-width: 0; 1071&.frame { 1072border: 1px solid $borders_color; 1073// FIXME doesn't work 1074&.top { border-top-width: 0; } 1075&.bottom { border-bottom-width: 0; } 1076&.right { border-right-width: 0; } 1077&.left { border-left-width: 0; } 1078} 1079&.header { 1080// FIXME: double borders in some case, can't fix it w/o a class tho 1081// FIXME: doesn't work on dark var 1082background-color: $dark_color; 1083 1084// this is the shading of the header behind the tabs 1085&.frame { 1086border: 1px solid $borders_color; 1087&.top { border-bottom-width: 0; } 1088&.bottom { border-top-width: 0; } 1089&.right { border-left-width: 0; } 1090&.left { border-right-width: 0; } 1091} 1092 1093&.top { 1094box-shadow: inset 0 -1px $borders_color; // border 1095} 1096&.bottom { 1097box-shadow: inset 0 1px $borders_color; 1098} 1099&.right { 1100box-shadow: inset 1px 0 $borders_color; 1101} 1102&.left { 1103box-shadow: inset -1px 0 $borders_color; 1104} 1105} 1106tab { 1107border-width: 0; 1108border-style: solid; 1109border-color: transparent; 1110background-color: transparent; 1111 1112outline-offset: 0; 1113 1114$tab_indicator_size: 2px; 1115//vertical tab sizing 1116$vt_vpadding: 8px; 1117$vt_hpadding: 20px; 1118// horizontal tab sizing 1119$ht_vpadding: 5px; 1120$ht_hpadding: 20px; 1121 1122//FIXME: we get double border in some cases, not considering the broken 1123//notebook content frame... 1124&.top, &.bottom { padding: $vt_vpadding $vt_hpadding; } 1125&.left, &.right { padding: $ht_vpadding $ht_hpadding; } 1126 1127 1128/* works for testnotebookdnd, but there's a superfluous border 1129in gedit or web, commented out for now, needs gtk fixes 1130&.reorderable-page { 1131&.top { 1132padding-top: ($vt_vpadding - 1px); 1133border-top-width: 1px; 1134border-left-width: 1px; 1135border-right-width: 1px; 1136} 1137&.bottom { 1138padding-bottom: ($vt_vpadding - 1px); 1139border-bottom-width: 1px; 1140border-left-width: 1px; 1141border-right-width: 1px; 1142} 1143&.left { 1144padding-left: ($ht_hpadding - 1px); 1145border-left-width: 1px; 1146border-top-width: 1px; 1147border-bottom-width: 1px; 1148} 1149&.right { 1150padding-right: ($ht_hpadding - 1px); 1151border-right-width: 1px; 1152border-top-width: 1px; 1153border-bottom-width: 1px; 1154} 1155} 1156*/ 1157&.reorderable-page { 1158-GtkNotebook-tab-overlap: 1; 1159&.top, &.bottom { 1160padding-left: 12px; // for a nicer close button 1161padding-right: 12px; // placement 1162border-left-width: 1px; 1163border-right-width: 1px; 1164} 1165&.left, &.right { 1166border-bottom-width: 1px; 1167border-top-width: 1px; 1168} 1169} 1170&.top { 1171//padding-bottom: ($vt_vpadding -$tab_indicator_size); 1172border-bottom-width: $tab_indicator_size; 1173} 1174&.bottom { 1175//padding-top: ($vt_vpadding -$tab_indicator_size); 1176border-top-width: $tab_indicator_size; 1177} 1178&.left { 1179//padding-right: ($ht_hpadding -$tab_indicator_size); 1180border-right-width: $tab_indicator_size; 1181} 1182&.right { 1183//padding-left: ($ht_hpadding -$tab_indicator_size); 1184border-left-width: $tab_indicator_size; 1185} 1186 1187//here's the interesting stuff 1188&:hover, &.prelight-page { 1189border-color: $track_color; 1190} 1191&:active, &.active-page { 1192border-color: $selected_bg_color; 1193} 1194@each $_tab, $_border in (top, bottom), 1195(bottom, top), 1196(left, right), 1197(right, left) { 1198&.reorderable-page.#{$_tab} { 1199border-color: transparent; 1200&:hover, &.prelight-page { 1201border-color: $borders_color; 1202border-#{$_border}-width: 1px; 1203border-#{$_border}-color: transparent; 1204background-color: $bg_color; 1205} 1206&:active, &.active-page { 1207border-color: $borders_color; 1208border-#{$_border}-width: 1px; 1209border-#{$_border}-color: transparent; 1210background-color: $light_color; 1211} 1212} 1213} 1214.label { //tab text 1215padding: 0 2px; // needed for a nicer focus ring 1216font-weight: bold; 1217color: $secondary_fg_color; 1218} 1219.prelight-page .label, .label.prelight-page { 1220// prelight tab text 1221color: $fg_color; 1222} 1223.active-page .label, .label.active-page { 1224// active tab text 1225color: $fg_color; 1226} 1227.button { //tab close button 1228padding: 0; 1229@extend %image_button; 1230background-size: ($small_size / 0.8) ($small_size / 0.8), auto; 1231// @extend .button.flat; 1232@include button(flat); 1233&:hover { @include button(flat-hover); } 1234&:active { @include button(flat-active); } 1235&:insensitive { @include button(flat-insensitive); } 1236& > GtkImage { // this is a hack which makes tabs grow 1237padding: 4px; 1238} 1239} 1240} 1241&.arrow { 1242&:not(:hover):not(:active) { color: gtkalpha(currentColor, $enabled_opacity); } 1243&:insensitive { 1244color: $insensitive_fg_color; 1245} 1246} 1247&:not(.reorderable-page) > .entry { 1248@extend .entry.flat; 1249} 1250} 1251 1252/************** 1253* Scrollbars * 1254**************/ 1255 1256$_slider_margin: 4px; 1257$_slider_fine_tune_margin: 6px; 1258 1259.scrollbar { 1260-GtkRange-slider-width: 8 + $_slider_margin * 2 + 1; 1261-GtkRange-trough-border: 0; 1262-GtkScrollbar-has-backward-stepper: false; 1263-GtkScrollbar-has-forward-stepper: false; 1264-GtkScrollbar-min-slider-length: 24 + $_slider_margin * 2; 1265// minimum size for the slider. 1266// sadly can't be in '.slider' 1267// where it belongs 1268-GtkRange-stepper-spacing: 0; 1269-GtkRange-trough-under-steppers: 1; 1270 1271.button { 1272border: none; 1273} 1274 1275&.overlay-indicator { 1276&:not(.dragging):not(.hovering) { // Overlay scrolling indicator 1277-GtkRange-slider-width: 12px; 1278 1279.slider { 1280margin: 2px; 1281border: 2px solid scale-alpha($base_color, $lower_opacity); 1282// background-clip: padding-box; 1283} 1284 1285.trough { 1286border-style: none; 1287background-color: transparent; 1288} 1289 1290// w/o the following margin tweaks the slider shrinks when hovering/dragging 1291&.vertical .slider { 1292// margin-top: $_slider_margin - 1px; 1293// margin-bottom: $_slider_margin - 1px; 1294} 1295 1296&.horizontal .slider { 1297// margin-left: $_slider_margin - 1px; 1298// margin-right: $_slider_margin - 1px; 1299} 1300 1301} 1302 1303&.dragging, 1304&.hovering { 1305.trough { 1306background-color: scale-alpha($base_color, $higher_opacity); 1307} 1308} 1309} 1310 1311// trough coloring 1312.trough { 1313border: 1px none $borders_color; 1314background-color: $base_color; 1315background-clip: $extra_background_clip; 1316} 1317 1318// slider coloring 1319.slider { 1320background-color: $tertiary_fg_color; 1321&:hover { background-color: $secondary_fg_color; } 1322&:active { background-color: $fg_color; } 1323&:insensitive { 1324opacity: $disabled_opacity; 1325} 1326} 1327 1328 1329// sizing 1330.slider { 1331border-radius: 100px; 1332margin: $_slider_margin; 1333} 1334 1335&.fine-tune .slider { margin: $_slider_fine_tune_margin; } 1336 1337&.vertical { 1338 1339.slider { 1340margin-left: 1px + $_slider_margin; 1341 1342&:dir(rtl) { 1343margin-left: $_slider_margin; 1344margin-right: 1px + $_slider_margin; 1345} 1346} 1347 1348&.fine-tune .slider { 1349margin-left: 1px + $_slider_fine_tune_margin; 1350 1351&:dir(rtl) { 1352margin-left: $_slider_fine_tune_margin; 1353margin-right: 1px + $_slider_fine_tune_margin; 1354} 1355} 1356 1357.trough { 1358border-left-style: solid; 1359 1360&:dir(rtl) { 1361border-left-style: none; 1362border-right-style: solid; 1363} 1364} 1365} 1366 1367&.horizontal { 1368 1369.slider { margin-top: 1px + $_slider_margin; } 1370 1371&.fine-tune .slider { margin-top: 1px + $_slider_fine_tune_margin; } 1372 1373.trough { border-top-style: solid; } 1374} 1375} 1376 1377.scrollbars-junction, 1378.scrollbars-junction.frame { // the small square between two scrollbars 1379border-style: solid none none solid; 1380background-color: $base_color; 1381 1382&:dir(rtl) { border-style: solid solid none none; } 1383} 1384 1385 1386/********** 1387* Switch * 1388**********/ 1389 1390GtkSwitch { 1391-GtkSwitch-slider-width: 28px; // 55px is the right value to make it as tall 1392// as buttons, not doing that for now 1393-GtkSwitch-slider-height: 28px; 1394 1395outline-offset: -4px; 1396outline-radius: 100px; 1397font-size: 0; 1398&.trough { 1399// similar to the .scale 1400border: 10px solid transparent; 1401border-radius: 100px; 1402background-color: $track_color; 1403// background-clip: padding-box; 1404&:insensitive { 1405color: $insensitive_fg_color; 1406} 1407&:active { 1408background-color: $accent_bg_color; 1409&:insensitive { 1410background-color: $track_color; 1411color: $accent_bg_color; 1412} 1413} 1414} 1415&.slider { 1416padding: 4px; 1417border-radius: 100px; 1418@include entry(normal); 1419&:hover { @include entry(focus); } 1420&:insensitive { @include entry(insensitive); } 1421} 1422.list-row:selected & { 1423} 1424 1425} 1426 1427/************************* 1428* Check and Radio items * 1429*************************/ 1430 1431// draw regular check and radio items using our PNG assets 1432// all assets are rendered from assets.svg. never add pngs directly 1433 1434@each $w,$a in ('check', 'checkbox'), 1435('radio','radio') { 1436 1437//standard checks and radios 1438@each $s,$as in ('','-unchecked'), 1439(':active', '-unchecked-active'), 1440(':insensitive','-unchecked-insensitive'), 1441(':inconsistent', '-mixed'), 1442(':inconsistent:active', '-mixed-active'), 1443(':inconsistent:insensitive', '-mixed-insensitive'), 1444(':checked', '-checked'), 1445(':checked:active', '-checked-active'), 1446(':checked:insensitive','-checked-insensitive') { 1447.#{$w}#{$s} { 1448-gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}#{$asset_suffix}.png"), 1449url("assets/#{$a}#{$as}#{$asset_suffix}@2.png")); 1450icon-shadow: $z-depth-1; 1451&:hover, &:active { icon-shadow: $z-depth-2; } 1452&:insensitive { icon-shadow: none; } 1453&.button.flat { } 1454} 1455} 1456 1457//menu 1458@each $s,$as in ('',''), 1459// (':active', '-checked'), 1460(':insensitive','-insensitive'), 1461(':inconsistent', '-mixed'), 1462// (':inconsistent:active', '-mixed'), 1463(':inconsistent:insensitive', '-mixed-insensitive'), 1464(':checked', '-checked'), 1465// (':checked:active', '-checked'), 1466(':checked:insensitive','-checked-insensitive') { 1467.menu .menuitem.#{$w}#{$s} { 1468// color: gtkalpha(currentColor, $hint_opacity); 1469// -gtk-icon-source: -gtk-icontheme('#{$a}-symbolic'); 1470// &:active, &:checked { -gtk-icon-source: -gtk-icontheme('#{$a}-checked-symbolic'); } 1471// &:inconsistent { -gtk-icon-source: -gtk-icontheme('#{$a}-mixed-symbolic'); } 1472-gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}-symbolic#{$asset_suffix}.png"), 1473url("assets/#{$a}#{$as}-symbolic#{$asset_suffix}@2.png")); 1474icon-shadow: none; 1475&:hover { 1476-gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}-symbolic-dark.png"), 1477url("assets/#{$a}#{$as}-symbolic-dark@2.png")); 1478} 1479} 1480} 1481} 1482 1483//treeview and list-rows 1484.view.check, .view.radio, 1485.list-row .check, list-row .radio { 1486} 1487 1488//selection-mode 1489@each $s,$as in ('','-selectionmode'), 1490(':active', '-active-selectionmode'), 1491(':insensitive', '-insensitive-selectionmode'), 1492(':checked', '-checked-selectionmode'), 1493(':checked:active', '-checked-active-selectionmode'), 1494(':insensitive:checked', '-checked-insensitive-selectionmode') { 1495.view.content-view.check#{$s}:not(.list) { 1496-gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}.png"), 1497url("assets/checkbox#{$as}@2.png")); 1498background-color: transparent; 1499} 1500} 1501 1502GtkCheckButton.text-button, GtkRadioButton.text-button { 1503// this is for a nice focus on check and radios text 1504padding: 2px 4px; 1505outline-offset: 0; 1506&:insensitive, 1507&:insensitive:active, 1508&:insensitive:inconsistent { 1509// set insensitive color, which is overriden otherwise 1510// color: $insensitive_fg_color; 1511} 1512} 1513 1514/************ 1515* GtkScale * 1516************/ 1517.scale, 1518.scale.scale-has-marks-above.scale-has-marks-below, 1519.scale.vertical.scale-has-marks-above.scale-has-marks-below { 1520// FIXME: rationalize 1521-GtkScale-slider-length: 20; 1522-GtkRange-slider-width: 20; 1523-GtkRange-trough-border: 2; 1524outline-offset: -8px; 1525outline-radius: 100px; 1526 1527&.fine-tune { 1528&.slider { background-size: 80%; } 1529} 1530 1531&.slider { 1532&:not(:hover):not(:active) { background-size: 80%; } 1533// @include entry(normal); 1534// border-radius: 50%; 1535// background-color: $accent_bg_color; 1536@each $s,$as in ('',''), 1537// (':hover','-hover'), 1538(':active','-active'), 1539(':insensitive','-insensitive') { 1540&.slider#{$s} { 1541$_url: 'assets/slider#{$as}#{$asset_suffix}'; 1542border-style: none; 1543border-radius: 0; 1544background-color: transparent; 1545background-image: -gtk-scaled(url('#{$_url}.png'), 1546url('#{$_url}@2.png')); 1547background-repeat: no-repeat; 1548background-position: center; 1549box-shadow: none; 1550} 1551} 1552&:hover { 1553// @include entry(focus); 1554// border-radius: 50%; // needed for double marks scales 1555} 1556&:insensitive { 1557// @include entry(insensitive); 1558// border-radius: 50%; // overridden 1559} 1560//OSD sliders 1561.osd & { 1562} 1563} 1564&.trough { 1565margin: 10px 12px; 1566background-color: $track_color; 1567&.highlight { 1568background-color: $accent_bg_color; 1569&:insensitive { background-color: $track_color; } 1570} 1571&:insensitive { color: $insensitive_fg_color; } 1572&.vertical { margin: 12px 10px; } 1573//OSD troughs 1574.osd & { 1575} 1576} 1577// marks color 1578&.separator { 1579color: $track_color; 1580} 1581// scales on selected list rows 1582.list-row:selected & { 1583} 1584} 1585 1586@each $d,$dn in ('', 'horz'), 1587('.vertical', 'vert') { 1588@each $w,$we in ('scale-has-marks-below','scale_marks_below'), 1589('scale-has-marks-above','scale_marks_above') { 1590.scale#{$d}.#{$w} { 1591-GtkScale-slider-length: 20; 1592-GtkRange-slider-width: 25; 1593-GtkRange-trough-border: 2; 1594 1595@extend %#{$we}_#{$dn}; 1596 1597@each $s,$as in ('',''), 1598// (':hover','-hover'), 1599(':active','-active'), 1600(':insensitive','-insensitive') { 1601&.slider#{$s} { 1602$_url: 'assets/slider-#{$dn}-#{$w}#{$as}#{$asset_suffix}'; 1603border-style: none; 1604border-radius: 0; 1605background-color: transparent; 1606background-image: -gtk-scaled(url('#{$_url}.png'), 1607url('#{$_url}@2.png')); 1608background-repeat: no-repeat; 1609background-position: center; 1610box-shadow: none; 1611} 1612} 1613} 1614} 1615} 1616 1617%scale_marks_above_horz { 1618.trough { margin: 15px 12px 10px; } 1619} 1620%scale_marks_below_horz { 1621.trough { margin: 10px 12px 15px; } 1622} 1623%scale_marks_above_vert { 1624.trough { margin: 12px 10px 12px 15px; } 1625} 1626%scale_marks_below_vert { 1627.trough { margin: 12px 15px 12px 10px; } 1628} 1629 1630/***************** 1631* Progress bars * 1632*****************/ 1633 1634GtkProgressBar { 1635-GtkProgressBar-min-horizontal-bar-height: 4; 1636-GtkProgressBar-min-vertical-bar-width: 4; 1637padding: 0; 1638font-size: smaller; 1639color: $tertiary_fg_color; 1640&.osd { 1641-GtkProgressBar-xspacing: 0; 1642-GtkProgressBar-yspacing: 0; 1643-GtkProgressBar-min-horizontal-bar-height: 4; 1644} 1645&.trough { // background 1646border-radius: 0; 1647background-color: scale-alpha($selected_bg_color, $lower_opacity); 1648&.osd { 1649border-style: none; 1650box-shadow: none; 1651// background-color: transparent; 1652} 1653} 1654} 1655 1656// moving bit 1657.progressbar { 1658border-radius: 0; 1659background-color: $selected_bg_color; 1660&.left { 1661border-top-left-radius: 0; 1662border-bottom-left-radius: 0; 1663} 1664&.right { 1665border-top-right-radius: 0; 1666border-bottom-right-radius: 0; 1667} 1668&.left.right { 1669box-shadow: none; 1670} 1671&.vertical { 1672&.bottom { 1673border-bottom-left-radius: 0; 1674border-bottom-right-radius: 0; 1675box-shadow: none; 1676} 1677&.top { 1678border-top-left-radius: 0; 1679border-top-right-radius: 0; 1680} 1681} 1682&.osd { 1683background-image: none; 1684background-color: $selected_bg_color; 1685border-style: none; 1686border-radius: 0; 1687} 1688} 1689 1690 1691/************* 1692* Level Bar * 1693*************/ 1694 1695.level-bar { 1696box-shadow: $z-depth-1; // needs to be set here to avoid clipping 1697-GtkLevelBar-min-block-width: 36; 1698-GtkLevelBar-min-block-height: 4; 1699&.vertical { 1700-GtkLevelBar-min-block-width: 4; 1701-GtkLevelBar-min-block-height: 36; 1702} 1703&.trough { 1704padding: 2px; 1705border-radius: 2px; 1706@include entry(normal); 1707&:insensitive { @include entry(insensitive); } 1708&.indicator-discrete { 1709&.horizontal { padding: 2px 1px; } 1710&.vertical { padding: 1px 2px; } 1711} 1712} 1713&.fill-block { 1714// FIXME: it would be nice to set make fill blocks bigger, but we'd need 1715// :nth-child working on discrete indicators 1716background-color: $selected_bg_color; 1717border-radius: 0; 1718box-shadow: none; 1719&.indicator-discrete { 1720&.horizontal { margin: 0 1px; } 1721&.vertical { margin: 1px 0; } 1722} 1723&.level-high { 1724background-color: $success_color; 1725} 1726&.level-low { 1727background-color: $warning_color; 1728} 1729&.empty-fill-block { 1730background-color: $track_color; 1731} 1732} 1733} 1734 1735 1736/********** 1737* Frames * 1738**********/ 1739.frame { 1740border: 1px solid $borders_color; 1741&.flat { border-style: none; } 1742padding: 0; 1743&.action-bar { 1744padding: $container_padding; 1745border-width: 1px 0 0; 1746} 1747} 1748 1749GtkScrolledWindow { 1750GtkViewport.frame { // avoid double borders when viewport inside 1751// scrolled window 1752border-style: none; 1753} 1754} 1755 1756//vbox and hbox separators 1757.separator { 1758// always disable separators 1759// -GtkWidget-wide-separators: true; 1760color: $borders_color; 1761 1762// Font and File button separators 1763GtkFileChooserButton &.vertical, 1764GtkFontButton &.vertical { 1765// always disable separators 1766-GtkWidget-wide-separators: true; 1767} 1768} 1769 1770/********* 1771* Lists * 1772*********/ 1773 1774.list { 1775border-color: $borders_color; 1776background-color: $base_color; 1777} 1778 1779.list-row, 1780.grid-child { 1781padding: 2px; 1782} 1783 1784.list-row.activatable { 1785// let's take care of background colors 1786background-image: -gtk-gradient(radial, 1787center center, 0, 1788center center, 0.5, 1789to(gtkalpha(currentColor, 0)), 1790to(transparent)), 1791linear-gradient(to bottom, gtkalpha(currentColor, 0)); 1792background-repeat: no-repeat; 1793background-position: center, center; 1794background-size: (192px / 0.8) (192px / 0.8), auto; 1795&:hover { 1796background-image: -gtk-gradient(radial, 1797center center, 0, 1798center center, 0.5, 1799to(gtkalpha(currentColor, 0)), 1800to(transparent)), 1801linear-gradient(to bottom, gtkalpha(currentColor, 0.05)); 1802} 1803&:active { 1804transition-property: opacity, border-color, border-image, box-shadow, 1805background-color, text-shadow, icon-shadow; // Remove background-image 1806animation: list_ripple_effect $material_duration $material_timing_function forwards; 1807} 1808} 1809 1810.list-row:selected { 1811@extend %selected_items; 1812.button { 1813&:insensitive { color: $insensitive_secondary_selected_fg_color; } 1814&.flat { 1815color: $secondary_selected_fg_color; 1816&:hover, &:active { color: $selected_fg_color; } 1817&:insensitive { color: $insensitive_secondary_selected_fg_color; } 1818} 1819} 1820} 1821 1822// transition 1823.list-row { 1824&:hover { transition-duration: 0; } 1825} 1826 1827 1828/********************* 1829* App Notifications * 1830*********************/ 1831 1832.app-notification, 1833.app-notification.frame { 1834@extend %osd; 1835@extend .toolbar.osd; 1836.button { 1837} 1838} 1839 1840/************* 1841* Expanders * 1842*************/ 1843 1844.expander { 1845-gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); 1846&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); } 1847&:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); } 1848&:not(:hover):not(:active) { color: gtkalpha(currentColor, $enabled_opacity); } 1849&:selected { color: $selected_fg_color; } 1850} 1851 1852/************ 1853* Calendar * 1854***********/ 1855GtkCalendar { 1856border: 1px solid $borders_color; 1857color: $fg_color; 1858 1859&:selected { 1860@extend .view:selected; 1861} 1862 1863&.header { 1864border: 1px solid transparent; 1865border-bottom-color: $borders_color; 1866border-radius: 0; 1867} 1868 1869&.button { 1870// @extend .button.flat; 1871@include button(flat); 1872&:hover { @include button(flat-hover); } 1873&:active { @include button(flat-active); } 1874&:insensitive { @include button(flat-insensitive); } 1875} 1876 1877&:inconsistent { color: gtkalpha(currentColor, $hint_opacity); } 1878&.highlight { 1879font-size: smaller; 1880color: gtkalpha(currentColor, $hint_opacity); 1881} 1882} 1883 1884/*********** 1885* Dialogs * 1886***********/ 1887 1888.message-dialog .dialog-action-area .button { 1889padding: 8px; 1890} 1891 1892.message-dialog { // Message Dialog styling 1893&.background { background-color: $light_color; } 1894.titlebar { 1895border-style: none; 1896// box-shadow: inset 0 1px $highlight_color; 1897background-color: $light_color; 1898} 1899&.csd { // rounded bottom border styling for csd version 1900&.background { 1901// bigger radius for better antialiasing 1902border-bottom-left-radius: 2px; 1903border-bottom-right-radius: 2px; 1904} 1905.dialog-action-area .button { 1906@extend .button.flat; 1907padding: 9px 16px 10px; 1908border-top: 1px solid $borders_color; 1909border-radius: 0; 1910background-size: (192px / 0.8) (192px / 0.8), auto; 1911// &:first-child{ border-bottom-left-radius: 2px; } 1912// &:last-child { border-bottom-right-radius: 2px; } 1913&:first-child{ border-radius: 0 0 0 2px; } 1914&:last-child { border-radius: 0 0 2px 0; } 1915} 1916} 1917} 1918 1919GtkFileChooserDialog { 1920.search-bar { 1921// background-color: $base_color; 1922// border-color: $bg_color; 1923} 1924.dialog-action-box { 1925border-top: 1px solid $borders_color; 1926} 1927} 1928 1929/*********** 1930* Sidebar * 1931***********/ 1932 1933.sidebar { 1934border: none; 1935background-color: $secondary_base_color; 1936 1937&:selected { 1938@extend %selected_items; 1939} 1940} 1941 1942GtkSidebarRow { 1943// Needs overriding of the GtkListBoxRow padding 1944&.list-row { 1945padding: 0px; 1946} 1947// Using margins/padding directly in the SidebarRow 1948// will make the animation of the new bookmark row jump 1949.sidebar-revealer { 1950padding: 4px 14px 4px 12px; 1951} 1952.sidebar-icon { 1953opacity: $hint_opacity; // dim the device icons 1954&:dir(ltr) { padding-right: 8px; } 1955&:dir(rtl) { padding-left: 8px; } 1956} 1957.sidebar-label { 1958&:dir(ltr) { padding-right: 2px; } 1959&:dir(rtl) { padding-left: 2px; } 1960} 1961} 1962 1963GtkPlacesSidebar.sidebar { 1964// in the sidebar case it makes no sense to click the selected row 1965// .list-row:selected:active { box-shadow: none; } 1966 1967// looks like the label doesn't get all the states so work around 1968.list-row:selected:insensitive .label { @extend %selected_items:insensitive; } 1969// .list-row:selected:backdrop:insensitive .label { @extend %selected_items:backdrop:insensitive; } 1970 1971.sidebar-placeholder-row { 1972border: solid 1px $selected_bg_color; 1973} 1974 1975.sidebar-new-bookmark-row { 1976color: $accent_bg_color; 1977} 1978 1979@at-root .sidebar-button.button { // @at-root needded to not change the specificity making button styling inheritance broken 1980// so istead of "GtkPlacesSidebar.sidebar .sidebar-button.button" [specificity 0,0,3,1] 1981// the extended selector ".sidebar-button.button" [specificity 0,0,2,0] 1982 1983&.image-button { padding: 4px; } 1984 1985@extend .button.flat; 1986// border-radius: 100%; 1987// outline-radius: 100%; 1988} 1989// this is for indicating which sidebar row generated a popover 1990// see https://bugzilla.gnome.org/show_bug.cgi?id=754411 1991.has-open-popup { @extend .list-row.activatable:active; } 1992} 1993 1994.sidebar-item { 1995padding: 10px 4px; 1996> .label { 1997padding-left: 6px; 1998padding-right: 6px; 1999} 2000&.needs-attention > .label { 2001@extend %needs_attention; 2002} 2003} 2004 2005/********* 2006* Paned * 2007*********/ 2008 2009GtkPaned { // this is for the standard paned separator 2010 2011-GtkPaned-handle-size: 1; // sets separator width 2012 2013-gtk-icon-source: none; // removes handle decoration 2014margin: 0 8px 8px 0; // drag area of the separator, not a real margin 2015&:dir(rtl) { 2016margin-right: 0; 2017margin-left: 8px; 2018} 2019.pane-separator { 2020background-color: $borders_color; 2021} 2022} 2023 2024GtkPaned.wide { // this is for the paned with wide separator 2025-GtkPaned-handle-size: 6; // wider separator here 2026margin: 0; // no need of the invisible drag area so, reset margin 2027.pane-separator { 2028background-color: transparent; 2029border-style: none solid; 2030border-color: $borders_color; 2031border-width: 1px; 2032} 2033&.vertical .pane-separator { border-style: solid none;} 2034} 2035 2036 2037/************** 2038* GtkInfoBar * 2039**************/ 2040GtkInfoBar { 2041border-style: none; 2042} 2043 2044.info { 2045background-color: $info_bg_color; 2046} 2047 2048.question { 2049background-color: $question_bg_color; 2050} 2051 2052.warning { 2053background-color: $warning_bg_color; 2054} 2055 2056.error { 2057background-color: $error_bg_color; 2058} 2059 2060.info, 2061.question, 2062.warning, 2063.error { 2064color: $selected_fg_color; 2065.button { 2066// @extend .list-row:selected.button; 2067&:insensitive { color: $insensitive_secondary_selected_fg_color; } 2068&.flat { 2069color: $secondary_selected_fg_color; 2070&:hover, &:active { color: $selected_fg_color; } 2071&:insensitive { color: $insensitive_secondary_selected_fg_color; } 2072} 2073} 2074.label:selected { 2075} 2076} 2077 2078/************ 2079* Tooltips * 2080************/ 2081 2082.tooltip { 2083&.background { 2084// background-color needs to be set this way otherwise it gets drawn twice 2085// see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details. 2086background-color: scale-alpha($base_color, $higher_opacity); 2087} 2088 2089// @extend %osd; 2090color: $fg_color; 2091padding: 4px; /* not working */ 2092border-radius: 2px; 2093box-shadow: none; // otherwise it gets inherited by windowframe.csd 2094// FIXME: we need a border or tooltips vanish on black background. 2095&.window-frame.csd { 2096background-color: transparent; 2097} 2098} 2099 2100.tooltip * { //Yeah this is ugly 2101padding: 4px; 2102background-color: transparent; 2103color: inherit; // just to be sure 2104} 2105 2106/***************** 2107* Color Chooser * 2108*****************/ 2109 2110GtkColorSwatch { 2111// This widget is made of two boxes one on top of the other, the lower box is GtkColorSwatch {} the other one 2112// is GtkColorSwatch > .overlay {}, GtkColorSwatch has the programmatically set background, so most of the style 2113// is applied to the overlay box. 2114 2115box-shadow: $z-depth-1; 2116 2117// we need to re-set the shadow here since it get axed by the previous bit 2118&:selected { } 2119 2120// base color corners rounding 2121// to avoid the artifacts caused by rounded corner anti-aliasing the base color 2122// sports a bigger radius. 2123// nth-child is needed by the custom color strip. 2124// The :not() madness is needed since actually the overlay is selectable by GtkColorSwatch > .overlay 2125// and GtkColorSwatch.overlay, I know it's weird, but this is gtk+, not a browser. 2126&.top { 2127border-top-left-radius: 2px; 2128border-top-right-radius: 2px; 2129} 2130&.bottom { 2131border-bottom-left-radius: 2px; 2132border-bottom-right-radius: 2px; 2133} 2134&.left, &:first-child:not(.overlay):not(.top) { 2135border-top-left-radius: 2px; 2136border-bottom-left-radius: 2px; 2137} 2138&.right, &:last-child:not(.overlay):not(.bottom) { 2139border-top-right-radius: 2px; 2140border-bottom-right-radius: 2px; 2141} 2142&:only-child:not(.overlay) { border-radius: 2px; } 2143 2144// overlay corner rounding 2145&.top > .overlay { 2146border-top-left-radius: 2px; 2147border-top-right-radius: 2px; 2148} 2149&.bottom > .overlay { 2150border-bottom-left-radius: 2px; 2151border-bottom-right-radius: 2px; 2152} 2153&:first-child:not(.top) > .overlay { 2154border-top-left-radius: 2px; 2155border-bottom-left-radius: 2px; 2156} 2157&:last-child:not(.bottom) > .overlay { 2158border-top-right-radius: 2px; 2159border-bottom-right-radius: 2px; 2160} 2161&:only-child > .overlay { border-radius: 2px; } 2162 2163// hover effect 2164&:hover { box-shadow: $z-depth-2; } 2165 2166// no hover effect for the colorswatch in the color editor 2167GtkColorEditor & { 2168border-radius: 2px; // same radius as the entry 2169&:hover { box-shadow: $z-depth-1; } 2170} 2171 2172// indicator and keynav outline colors 2173&.color-dark { 2174color: white; 2175} 2176&.color-light { 2177color: scale-alpha(black, 0.8); 2178} 2179 2180// border color 2181&.overlay, 2182&.overlay:selected { 2183} 2184 2185// make the add color button looks like, well, a button 2186&#add-color-button { 2187background-image: linear-gradient(to right, 2188$error_bg_color 25%, 2189$warning_bg_color 25%, $warning_bg_color 50%, 2190$info_bg_color 50%, $info_bg_color 75%, 2191$question_bg_color 75%); 2192color: white; 2193} 2194} 2195 2196 2197/******** 2198* Misc * 2199********/ 2200 2201//content view (grid/list) 2202.content-view { 2203background-color: $bg_color; 2204// &:hover { -gtk-image-effect: highlight; } 2205&.rubberband { @extend .rubberband; } 2206} 2207 2208.scale-popup { 2209 2210.osd & { @extend %osd; } 2211 2212.osd & .button.flat { //FIXME: quick hack, redo properly 2213} 2214 2215.button { // +/- buttons on GtkVolumeButton popup 2216padding: 10px; 2217} 2218} 2219 2220GtkScaleButton.button, 2221GtkVolumeButton.button { 2222// I assume both are image-button *by default* 2223// with the image-button/text-button classes automagically applied depending on the button child these selectors can be deleted. 2224@extend %image_button; 2225 2226&.text-button { @extend .text-button } 2227} 2228 2229.floating-bar { 2230@extend %osd; 2231// @extend .toolbar.osd; 2232padding: 3px 0 4px; 2233border: 1px solid $borders_color; 2234background-color: $base_color; 2235background-clip: $extra_background_clip; 2236} 2237 2238.floating-bar.bottom.left { /* axes left border and border radius */ 2239border-width: 1px 1px 0 0; 2240border-radius: 0 2px + 1px 0 0; 2241// border-width: 8px 8px 0 0; 2242// border-image-width: 10px 10px 0 0; 2243} 2244 2245.floating-bar.bottom.right { /* axes right border and border radius */ 2246border-width: 1px 0 0 1px; 2247border-radius: 2px + 1px 0 0 0; 2248// border-width: 8px 0 0 8px; 2249// border-image-width: 10px 0 0 10px; 2250} 2251 2252/********************** 2253* Window Decorations * 2254*********************/ 2255 2256.window-frame { 2257transition: none; 2258border-radius: 2px 2px 0 0; 2259box-shadow: $z-depth-4; 2260 2261// FIXME rationalize window-frame shadows 2262 2263/* this is used for the resize cursor area */ 2264margin: 8px; 2265 2266&:backdrop { 2267box-shadow: $z-depth-2; 2268} 2269&.tiled { 2270border-radius: 0; 2271} 2272&.popup { 2273box-shadow: none; 2274} 2275// server-side decorations as used by mutter 2276&.ssd { 2277box-shadow: 0 0 0 1px $borders_color; //just doing borders, wm draws actual shadows 2278} 2279&.csd { 2280&.popup { 2281border-radius: 0; 2282box-shadow: $z-depth-2; 2283} 2284&.tooltip { 2285border-radius: 2px; 2286box-shadow: $z-depth-2; 2287} 2288&.message-dialog { 2289border-radius: 2px; 2290box-shadow: $z-depth-4; 2291&:backdrop { box-shadow: $z-depth-2; } 2292} 2293} 2294&.solid-csd { 2295border-radius: 0; 2296margin: 4px; 2297background-color: $warning_color; 2298border: solid 1px $borders_color; 2299box-shadow: none; 2300} 2301} 2302 2303// Window Close button 2304.header-bar .button.titlebutton, 2305.titlebar .button.titlebutton { 2306// @extend .button.flat; 2307@extend %image_button; 2308} 2309 2310.header-bar.selection-mode .button.titlebutton, 2311.titlebar.selection-mode .button.titlebutton { 2312// &:backdrop { icon-shadow: none; } 2313} 2314 2315 2316// catch all extend :) 2317 2318%selected_items { 2319background-color: $selected_bg_color; 2320color: $selected_fg_color; 2321&:insensitive { color: $insensitive_selected_fg_color; } 2322&:backdrop { 2323// color: $backdrop_selected_fg_color; 2324&:insensitive { 2325color: $insensitive_selected_fg_color; 2326} 2327} 2328} 2329 2330.monospace { 2331font: Monospace; 2332} 2333 2334/********************** 2335* Touch Copy & Paste * 2336*********************/ 2337 2338//touch selection handlebars for the Popover.osd above 2339.entry.cursor-handle, 2340.cursor-handle { 2341background-color: $accent_bg_color; 2342background-image: none; 2343box-shadow: none; 2344border-style: none; 2345@each $s,$as in ('',''), 2346(':hover','-hover'), 2347(':active','-active') { //no need for insensitive and backdrop 2348&.top#{$s}:dir(ltr), &.bottom#{$s}:dir(rtl) { 2349$_url: 'assets/text-select-start#{$as}#{$asset_suffix}'; 2350-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'), 2351url('#{$_url}@2.png')); 2352padding-left: 10px; 2353} 2354&.bottom#{$s}:dir(ltr), &.top#{$s}:dir(rtl) { 2355$_url: 'assets/text-select-end#{$as}#{$asset_suffix}'; 2356-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'), 2357url('#{$_url}@2.png')); 2358padding-right: 10px; 2359} 2360&.insertion-cursor#{$s}:dir(ltr), &.insertion-cursor#{$s}:dir(rtl) { 2361$_url: 'assets/slider-horz-scale-has-marks-above#{$as}#{$asset_suffix}'; 2362-gtk-icon-source: -gtk-scaled(url('#{$_url}.png'), 2363url('#{$_url}@2.png')); 2364} 2365} 2366} 2367 2368/* Decouple the font of context menus from their entry/textview */ 2369.context-menu { 2370font: initial; 2371} 2372 2373.touch-selection { 2374font: initial; 2375color: $fg_color; 2376background-color: $base_color; 2377box-shadow: $z-depth-2; 2378&:backdrop { box-shadow: $z-depth-1; } 2379.button { 2380} 2381} 2382 2383// This is used by GtkScrolledWindow, when content is touch-dragged past boundaries. 2384// This draws a box on top of the content, the size changes programmatically. 2385.overshoot { 2386&.top { 2387@include overshoot(top); 2388} 2389&.bottom { 2390@include overshoot(bottom); 2391} 2392&.left { 2393@include overshoot(left); 2394} 2395&.right { 2396@include overshoot(right); 2397} 2398} 2399 2400// Overflow indication, works similarly to the overshoot, the size if fixed tho. 2401.undershoot { 2402&.top { 2403@include undershoot(top); 2404} 2405 2406&.bottom { 2407@include undershoot(bottom); 2408} 2409 2410&.left { 2411@include undershoot(left); 2412} 2413 2414&.right { 2415@include undershoot(right); 2416} 2417} 2418