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