// // Suffix // $asset_suffix: if($variant == 'dark', '-dark', ''); // // transitions // %transition { // do not include sizing factors and text colors/shadows transition-property: opacity, border-color, border-image, background-color, background-image, box-shadow, icon-shadow; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 0.2s; } /***************** * Common States * *****************/ * { @extend %transition; // global transition setting padding: 0; background-clip: padding-box; -GtkToolButton-icon-spacing: 4; -GtkTextView-error-underline-color: $error_color; -GtkCheckButton-indicator-size: 16; -GtkCheckMenuItem-indicator-size: 16; // The size for scrollbars. The slider is 2px smaller, but we keep it // up so that the whole area is sensitive to button presses for the // slider. The stepper button is larger in both directions, the slider // only in the width -GtkScrolledWindow-scrollbar-spacing: 0; -GtkScrolledWindow-scrollbars-within-bevel: 1; -GtkToolItemGroup-expander-size: 11; -GtkExpander-expander-size: 16; -GtkMenu-horizontal-padding: 0; -GtkMenu-vertical-padding: 0; -GtkWidget-link-color: $link_color; -GtkWidget-visited-link-color: $link_visited_color; -GtkWidget-text-handle-width: 16; -GtkWidget-text-handle-height: 16; -GtkDialog-button-spacing: 4; -GtkDialog-action-area-border: 0; -GtkStatusbar-shadow-type: none; // We use the outline properties to signal the focus properties // to the adwaita engine: using real CSS properties is faster, // and we don't use any outlines for now. outline-style: solid; outline-width: 2px; outline-color: $track_color; outline-offset: -4px; outline-radius: 2px; // disable foreground-shadows as default text-shadow: none; icon-shadow: none; } /*************** * Base States * ***************/ .background { background-color: $bg_color; color: $fg_color; } // These wildcard seems unavoidable, need to investigate. // Wildcards are bad and troublesome, use them with care, // or better, just don't. // Everytime a wildcard is used a kitten dies, painfully. *:insensitive { -gtk-image-effect: dim; } // for backdrop, tone down element surfaces with transparentize %fade_effect { *:backdrop { opacity: 0.75; transition: 0.2s; } } .gtkstyle-fallback { background-color: $bg_color; color: $fg_color; &:prelight { background-color: darken($bg_color, 5%); color: $fg_color; } &:active { background-color: darken($bg_color, 10%); color: $fg_color; } &:insensitive { background-color: $bg_color; color: $insensitive_fg_color; } &:selected { background-color: $selected_bg_color; color: $selected_fg_color; } } .view { @extend .list-row.activatable; background-color: $base_color; color: $fg_color; &:hover, &:active, &:selected { border-radius: 2px; } &:insensitive { color: $insensitive_fg_color; } &:selected { @extend %selected_items; } } .rubberband { border: 1px solid $secondary_selected_bg_color; background-color: gtkopacity($secondary_selected_bg_color, 0.2); } .label { &.separator { color: $fg_color; @extend .dim-label; } &:selected, &:selected:focus, &:selected:hover { @extend %selected_items; } &:insensitive { color: $insensitive_fg_color; } // always use dark foreground in Gnome-Software &.kudo-label { color: $fixed_fg_color; } } .dim-label { opacity: 0.55; } GtkAssistant { // sidebar styling .sidebar { padding: 0.5em 0; &:dir(ltr) { border-right: 1px solid $borders_color; } &:dir(rtl) { border-left: 1px solid $borders_color; } .label { padding: 0.7em 1em 0.8em; color: $secondary_fg_color; font-weight: 500; &.highlight { color: $selected_bg_color; } } } // header-bar styling .header-bar { // apply suggested-action button for "Next" and "Back" // last -> "cancel", nth -> "Next" and "Back", that's weird. .button.flat:not(:last-child) { @include button(normal); background-color: $suggested_color; color: $secondary_selected_fg_color; &:hover { @include button(hover); color: $selected_fg_color; } &:active { @include button(active); color: $selected_fg_color; background-color: $selected_bg_color; } &:checked { @include button(checked); background-color: mix($selected_fg_color, $suggested_color, 20%); color: $selected_fg_color; } &:insensitive { @include button(insensitive); } } } } GtkTextView { // This will get overridden by .view, // needed by gedit line numbers background-color: $secondary_dark_color; } .grid-child { // outline-offset: -2px; padding: 4px; border-radius: 2px; &:selected { @extend %selected_items; } } %osd, .osd { opacity: 0.9; } /********************* * Spinner Animation * *********************/ @keyframes colorful_bar { 0% { -gtk-icon-source: url("assets/bar-red.svg"); -gtk-icon-transform: scale(0, 1.0); } 24.9% { -gtk-icon-source: url("assets/bar-red.svg"); -gtk-icon-transform: scale(1.0, 1.0); } 25% { -gtk-icon-source: url("assets/bar-yellow.svg"); -gtk-icon-transform: scale(1.0, 1.0); } 49.9% { -gtk-icon-source: url("assets/bar-yellow.svg"); -gtk-icon-transform: scale(0, 1.0); } 50% { -gtk-icon-source: url("assets/bar-green.svg"); -gtk-icon-transform: scale(0, 1.0); } 74.9% { -gtk-icon-source: url("assets/bar-green.svg"); -gtk-icon-transform: scale(1.0, 1.0); } 75% { -gtk-icon-source: url("assets/bar-blue.svg"); -gtk-icon-transform: scale(1.0, 1.0); } 99.9% { -gtk-icon-source: url("assets/bar-blue.svg"); -gtk-icon-transform: scale(0, 1.0); } 100% { -gtk-icon-source: url("assets/bar-red.svg"); -gtk-icon-transform: scale(0, 1.0); } } .spinner { background-color: blue; background-image: none; opacity: 0; // non spinning spinner makes no sense -gtk-icon-source: url("assets/bar-red.svg"); &:active { opacity: 1.0; animation: colorful_bar 2s linear infinite; &:insensitive { opacity: 0.4; } &:backdrop { opacity: 1.0; } } &:backdrop { opacity: 0; } } /**************** * Text Entries * ****************/ .entry { padding: 0.75em 1em 0.8em; @include entry(normal); &:focus { @include entry(focus); } &:insensitive { @include entry(insensitive); } &.flat { @include entry(flat-normal); &:focus { @include entry(flat-focus); } &:insensitive { @include entry(flat-insensitive); } } &:selected { @extend %selected_items; } &.image { // icons inside the entry &.left { padding-left: 0.1em; } &.right { padding-right: 0.1em; } } &.progressbar { @extend %entry_progressbar; } .linked > &:not(.flat), .linked.vertical > &:not(.flat) { @extend .entry.flat; border-radius: 0; outline-radius: 0; } // entry error and warning style @each $e_type, $e_color in (error, $error_color), (warning, $warning_color) { &.#{$e_type} { @include entry(normal, $e_color); &:focus { @include entry(focus, $e_color); } &:insensitive { @include entry(insensitive, $e_color); } &.flat { @include entry(flat-normal, $e_color); &:focus { @include entry(flat-focus, $e_color); } &:insensitive { @include entry(flat-insensitive, $e_color); } } } } &.image { // entry icons colors &:not(:hover):not(:active) { color: gtkalpha(currentColor, 0.75); } &:active { color: $selected_bg_color; } &:insensitive { color: gtkalpha(currentColor, 0.6); } } GtkTreeView & { // reset styling inside tree-view &.flat:focus { padding: 1px; border-radius: 0; border-image: none; background-color: $base_color; color: $fg_color; box-shadow: none; transition: none; &:selected { @extend %selected_items; } } &:insensitive, &.flat:insensitive { color: $insensitive_fg_color; } } .osd & { } } /*********** * Buttons * ***********/ // stuff for .needs-attention @keyframes needs_attention { from { background-image: -gtk-gradient(radial, center center, 0, center center, 0.001, to($selected_bg_color), to(transparent)); } to { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to($selected_bg_color), to(transparent)); } } .button { padding: 0.7em 1em 0.8em; border-radius: 2px; background-repeat: no-repeat; background-position: center, center; background-size: 3em * 2 / 0.8 3em * 2 / 0.8, auto; font-weight: 500; @include button(normal); &:hover { @include button(hover); } &:active { @include button(active); } &:insensitive { @include button(insensitive); } &:checked { @include button(checked); } &:checked:insensitive { @include button(checked-insensitive); } &.flat { @include button(flat-normal); &:hover { @include button(flat-hover); } &:active { @include button(flat-active); } &:insensitive { @include button(flat-insensitive); } &:checked { @include button(flat-checked); } &:checked:insensitive { @include button(flat-checked-insensitive); } .linked > & { border-radius: 2px; &.image-button { outline-radius: 100px; border-radius: 100px; } } } // big standalone buttons like in Documents pager &.osd { &.image-button { @extend .button.flat; @extend %image_button; padding: 1.3em; background-color: $inverted_dark_color; &:not(:active):not(:insensitive):not(hover) { color: $secondary_accent_color; } &:hover { color: $accent_color; background-color: gtkopacity($inverted_dark_color, 0.7); background-image: linear-gradient(to bottom, $track_color); } &:active { color: $accent_color; background-color: gtkopacity($inverted_dark_color, 0.7); background-image: linear-gradient(to bottom, $accent_fill_color); } } &:insensitive { opacity: 0; } } // overlay / OSD style .osd & { } // Suggested and Destructive Action buttons @each $b_type, $b_color in (suggested-action, $suggested_color), (destructive-action, $destructive_color) { &.#{$b_type} { background-color: $b_color; color: $secondary_selected_fg_color; &:hover { @include button(hover); background-color: $b_color; color: $selected_fg_color; } &:active { @include button(active); background-color: $selected_bg_color; color: $selected_fg_color; } &:checked { background-color: mix($selected_fg_color, $b_color, 20%); } &:insensitive { @include button(insensitive, $b_color, $insensitive_selected_fg_color); } &.flat { background-color: transparent; color: $b_color; &:hover { @include button(flat-hover, $track_color, $b_color); } &:active { @include button(flat-active); background-color: gtkalpha($selected_bg_color, 0.2); color: $selected_bg_color; } &:checked { @include button(flat-checked, $b_color, $selected_fg_color); } &:insensitive { @include button(flat-insensitive, $b_color, $insensitive_selected_fg_color); } } } } &.image-button { @extend %image_button; } &.text-button { padding-left: 1.2em; padding-right: 1.2em; font-weight: 700; } &.text-button.image-button { // those buttons needs uneven horizontal padding, we want the icon side // to have the image-button padding, while the text side the text-button // one, so we're adding the missing padding to the label depending on // its position inside the button padding: 0.7em 1em 0.8em; // same as .button outline-radius: 2px; border-radius: 2px; background-size: 3em * 2 / 0.8 3em * 2 / 0.8, auto; .label:first-child { padding-left: 0.5em; } .label:last-child { padding-right: 0.5em; } } .stack-switcher > & { // to position the needs attention dot, padding is added to the button // child, a label needs just lateral padding while an icon needs vertical // padding added too. outline-offset: -0.2em; // needs to be set or it gets overriden // by GtkRadioButton outline-offset > .label { padding-left: 0.5em; // label padding padding-right: 0.5em; // } > GtkImage { padding-left: 0.5em; // image padding padding-right: 0.5em; // padding-top: 0.2em; // padding-bottom: 0.2em; // } &.text-button { padding: 0.7em 1em 0.8em; // needed or it will get overridden } &.image-button { // we want image buttons to have a 1:1 aspect ratio, so compensation // of the padding added to the GtkImage is needed padding: 0.5em 0.3em; } &.needs-attention > .label, &.needs-attention > GtkImage { @extend %needs_attention; } &.needs-attention:active > .label, &.needs-attention:active > GtkImage, &.needs-attention:checked > .label, &.needs-attention:checked > GtkImage { animation: none; background-image: none; } } // inline-toolbar buttons .inline-toolbar &, .action-bar &, .inline-toolbar .linked > &, .action-bar .linked > & { &, &:not(.text-button).image-button { @extend .button.flat; padding: 0.75em; border-radius: 100px; outline-radius: 100px; } &.text-button { border-radius: 2px; outline-radius: 2px; } } .inline-toolbar .stack-switcher > &, .action-bar .stack-switcher > & { &, &:not(.text-button).image-button { @extend .button.flat; padding: 0.5em 0.25em; border-radius: 100px; outline-radius: 100px; } } .primary-toolbar & { icon-shadow: none; } // tango icons don't need shadows // mimic tab-switcher-ish button array // horizontal array .linked > &:not(.flat):not(:only-child) { @extend %linked_middle; } .linked > &, .linked > & .image-button, .linked > & .text-button { @extend %linked_middle; @extend %button_array; } // vertical array .linked.vertical > &:not(:only-child) { @extend %linked_vertical_middle; } .linked.vertical > &, .linked.vertical > & .image-button, .linked.vertical > & .text-button { @extend %linked_vertical_middle; @extend %button_vertical_array; } } %button_array { @include button(flat-normal); border-radius: 0; outline-radius: 0; color: $secondary_fg_color; border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.5, to($track_color), to(transparent)) 0 0 1 / 0 0 1px; &:hover { @include button(flat-hover); border-radius: 0; border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.5, to($track_color), to(transparent)) 0 0 2 / 0 0 2px; } &:active, &:checked { @include button(flat-checked); border-radius: 0; color: $fg_color; background-color: transparent; border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.5, to($selected_bg_color), to(transparent)) 0 0 2 / 0 0 2px; &:hover { background-color: gtkalpha($secondary_fg_color, 0.1); } &:insensitive { @include button(flat-checked-insensitive); color: $insensitive_fg_color; background-color: transparent; border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.5, to(gtkopacity($selected_bg_color, 0.2)), to(transparent)) 0 0 2 / 0 0 2px; > .label { color: inherit; } } } &:insensitive { @include button(flat-insensitive); border-radius: 0; color: $insensitive_fg_color; background-color: transparent; border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.5, to($track_color), to(transparent)) 0 0 1 / 0 0 1px; } } %button_vertical_array { @include button(flat-normal); border-image: none; border-width: 0; outline-radius: 0; color: $secondary_fg_color; &:hover { @include button(flat-hover); &:dir(ltr) { box-shadow: inset 2px 0 $track_color; } &:dir(rtl) { box-shadow: inset -2px 0 $track_color; } } &:active, &:checked { @include button(flat-checked); color: $fg_color; background-color: transparent; &:dir(ltr) { box-shadow: inset 2px 0 $selected_bg_color; } &:dir(rtl) { box-shadow: inset -2px 0 $selected_bg_color; } &:hover { background-color: gtkalpha(currentColor, 0.1); } &:insensitive { @include button(flat-checked-insensitive); color: $insensitive_fg_color; background-color: transparent; &:dir(ltr) { box-shadow: inset 2px 0 gtkopacity($selected_bg_color, 0.2); } &:dir(ltr) { box-shadow: inset -2px 0 gtkopacity($selected_bg_color, 0.2); } > .label { color: inherit; } } } &:insensitive { @include button(flat-insensitive); color: $insensitive_fg_color; background-color: transparent; &:dir(ltr) { box-shadow: inset 1px 0 $track_color; } &:dir(rtl) { box-shadow: inset -1px 0 $track_color; } } &:dir(ltr) { box-shadow: inset 1px 0 $track_color; } &:dir(rtl) { box-shadow: inset -1px 0 $track_color; } } %image_button { padding: 1em; outline-radius: 100px; border-radius: 100px; background-size: 3em * 1 / 0.8 3em * 1 / 0.8, auto; } %needs_attention { background-repeat: no-repeat; background-position: right 3px; background-size: 0.4em 0.4em; animation: needs_attention 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; transition: none; &:dir(rtl) { background-position: left 3px; } } // all the following is for the +|- buttons on inline toolbars, that way // should really be deprecated... .inline-toolbar GtkToolButton > .button { // redefining the button look is // needed since those are flat... outline-radius: 100px; border-radius: 100px; } // More inline toolbar buttons .inline-toolbar.toolbar GtkToolButton { // & > .button.flat { @extend %linked_middle; } // &:first-child > .button.flat { @extend %linked:first-child; } // &:last-child > .button.flat { @extend %linked:last-child; } // &:only-child > .button.flat { @extend %linked:only-child; } } %linked_middle { border-radius: 0; } %linked { outline-radius: 2px; @extend %linked_middle; &:first-child { border-top-left-radius: 2px; border-bottom-left-radius: 2px; } &:last-child { border-top-right-radius: 2px; border-bottom-right-radius: 2px; } &:only-child { border-radius: 2px; } } %linked_vertical_middle { border-radius: 0; } %linked_vertical{ outline-radius: 2px; @extend %linked_vertical_middle; &:first-child { border-top-left-radius: 2px; border-top-right-radius: 2px; } &:last-child { border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; } &:only-child { border-radius: 2px; } } // menu buttons .menuitem.button.flat { transition: none; &:selected { @extend %selected_items; } } GtkColorButton.button { padding: 0.4em 0.6em 0.5em; // Uniform padding on the GtkColorButton GtkColorSwatch:first-child:last-child { // :first-child:last-child for a // specificity bump, it gets // overridden by the // colorpicker style, otherwise border-radius: 2px; box-shadow: $z-depth-1; } &, GtkColorSwatch { &:insensitive { box-shadow: none; opacity: 0.4; } } } // button box is always shown with flat-buttons GtkButtonBox > .button { @include button(flat-normal); color: $secondary_accent_color; font-weight: 700; &:hover { @include button(flat-hover); color: $accent_color; } &:active { @include button(flat-active); color: $accent_color; } &:insensitive { @include button(flat-insensitive); } &:checked { @include button(flat-checked); color: $accent_color; } &:checked:insensitive { @include button(flat-checked-insensitive); color: gtkopacity($accent_color, 0.4); } } /********* * Links * *********/ *:link { color: $link_color; &:hover, &:active { color: $link_color; } &:visited { color: $link_visited_color; &:hover, &:active { color: $link_visited_color; } *:selected & { color: mix($selected_fg_color, $selected_bg_color, 60%); } } &:selected, *:selected & { color: mix($selected_fg_color, $selected_bg_color, 80%); } &:insensitive { opacity: 0.4; } } .button:link, .button:visited { @extend *:link; & > .label { text-decoration-line: underline; } } /***************** * GtkSpinButton * *****************/ .spinbutton { .button, .osd & .button { padding: 0.4em; border: solid 0.35em transparent; border-radius: 100px; outline-radius: 100px; background: none; box-shadow: none; color: $secondary_fg_color; &:not(:last-child) { // '-' button &:hover { @include button(flat-hover); background: none; color: $error_color; } &:active { @include button(flat-active); background-color: $track_color; color: $error_color; } &:insensitive { @include button(flat-insensitive); background: none; color: $insensitive_fg_color; } } &:last-child { // '+' button &:hover { @include button(flat-hover); background: none; color: $success_color; } &:active { @include button(flat-active); background-color: $track_color; color: $success_color; } &:insensitive { @include button(flat-insensitive); background: none; color: $insensitive_fg_color; } } } &.vertical { // FIXME: try using linking templates for // vertically linked stuff padding: 0.5em 0; .button { padding: 0.2em 0; border: solid 0.5em transparent; border-radius: 200px; outline-radius: 200px; background: none; box-shadow: none; color: $secondary_fg_color; &:first-child { // '+' button &:hover { @include button(flat-hover); background: none; color: $success_color; } &:active { @include button(flat-active); background-color: $track_color; color: $success_color; } &:insensitive { @include button(flat-insensitive); background: none; color: $insensitive_fg_color; } } &:last-child { // '-' button &:hover { @include button(flat-hover); background: none; color: $error_color; } &:active { @include button(flat-active); background-color: $track_color; color: $error_color; } &:insensitive { @include button(flat-insensitive); background: none; color: $insensitive_fg_color; } } } &.entry { } } GtkTreeView & { // reset styling inside tree-view &.entry:focus { padding: 1px; border-radius: 0; border-width: 0; background-color: $base_color; color: $fg_color; box-shadow: none; &:selected { @extend %selected_items; } } } } /************** * ComboBoxes * **************/ GtkComboBox { > .the-button-in-the-combobox { // Otherwise combos are bigger than buttons padding: 0.35em 0.5em 0.45em; } -GtkComboBox-arrow-scaling: 0.5; -GtkComboBox-shadow-type: none; .menu { padding: 2px 0; } .menu .menuitem { padding: 0.35em 0.5em 0.45em; } .separator.vertical { // always disable separators -GtkWidget-wide-separators: true; } .button { // combobox-button styling @extend %button_array; border-radius: 0; padding: 0.5em 0.5em 0.55em; // FIXME: need a bit more padding color: $secondary_fg_color; &:hover, &:active, &:checked { @include button(flat-normal); @extend %button_array:active; background-color: transparent; &:insensitive { color: $insensitive_fg_color; } } &:insensitive { color: $insensitive_fg_color; background-color: transparent; } } &.combobox-entry { padding: 0; .entry { } .button { padding: 0 0.7em; } } } .linked.vertical > GtkComboBox { .button { // vertical combobox-button styling @extend %button_vertical_array; padding: 0.35em 0.5em 0.45em; border-radius: 0; color: $secondary_fg_color; } } .linked > GtkComboBox > .the-button-in-the-combobox, .linked > GtkComboBoxText > .the-button-in-the-combobox { // the combo is a composite widget so the way we do button linkind doesn't // work, special case needed. See // https://bugzilla.gnome.org/show_bug.cgi?id=733979 &:dir(ltr), &:dir(rtl) { // specificity bump @extend %linked_middle; } } // stop using rounded-borders .linked > GtkComboBox:first-child > .the-button-in-the-combobox, .linked > GtkComboBoxText:first-child > .the-button-in-the-combobox, .linked > GtkComboBox:last-child > .the-button-in-the-combobox, .linked > GtkComboBoxText:last-child > .the-button-in-the-combobox, .linked > GtkComboBox:only-child > .the-button-in-the-combobox, .linked > GtkComboBoxText:only-child > .the-button-in-the-combobox { @extend %linked_middle; } .linked.vertical > GtkComboBoxText > .the-button-in-the-combobox, .linked.vertical > GtkComboBox > .the-button-in-the-combobox, .linked.vertical > GtkComboBoxText:first-child > .the-button-in-the-combobox, .linked.vertical > GtkComboBox:first-child > .the-button-in-the-combobox, .linked.vertical > GtkComboBoxText:last-child > .the-button-in-the-combobox, .linked.vertical > GtkComboBox:last-child > .the-button-in-the-combobox, .linked.vertical > GtkComboBoxText:only-child > .the-button-in-the-combobox, .linked.vertical > GtkComboBox:only-child > .the-button-in-the-combobox { @extend %linked_vertical_middle; } /************ * Toolbars * ************/ .toolbar { -GtkWidget-window-dragging: true; padding: 0.4em; border-width: 0; background-color: $bg_color; color: $secondary_fg_color; // draw shadows box-shadow: if($variant == 'light', $toolbar-shadow-light, $toolbar-shadow-dark); &.vertical, .inline-toolbar &, GtkPaned &, GtkEventBox &, GtkGrid &.primary-toolbar { // stop drawing fake-shadows box-shadow: none; } .osd &, &.osd { padding: 3px; border-style: solid; border-width: 9px; border-image: -gtk-scaled(url("assets/osd-shadow#{$asset_suffix}.png"), url("assets/osd-shadow#{$asset_suffix}@2.png")) 10 / 10px stretch; border-radius: 2px; box-shadow: none; color: $inverted_fg_color; background-color: $inverted_dark_color; &:backdrop { border-image: -gtk-scaled(url("assets/osd-shadow-backdrop#{$asset_suffix}.png"), url("assets/osd-shadow-backdrop#{$asset_suffix}@2.png")) 10 / 10px stretch; } .button { @extend .button.flat; &:not(:active):not(:insensitive):not(hover) { color: $secondary_accent_color; } &:hover, &:active { color: $accent_color; } &:active, &:checked { border-image: none; box-shadow: none; } &:insensitive { color: gtkopacity($accent_color, 0.4); } } .label { padding: 0 1em; } } .button { // use flat-buttons @extend .button.flat; border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.001, to($track_color), to(transparent)) 0 0 0 / 0 0 0px; color: $secondary_fg_color; box-shadow: none; &:hover { border-image: none; color: $fg_color; box-shadow: none; } &:checked { border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.5, to($selected_bg_color), to(transparent)) 0 0 2 / 0 0 2px; background: transparent; color: $fg_color; box-shadow: none; &:insensitive { border-image: none; background: transparent; color: $insensitive_fg_color; box-shadow: none; > .label { color: inherit; } } } &:insensitive { border-image: none; background-color: transparent; color: $insensitive_secondary_fg_color; box-shadow: none; } .image-button { border-radius: 100px; outline-radius: 100px; } } & .linked > .button { border-radius: 100px; outline-radius: 100px; &:hover { background-color: transparent; } // remove double-background &:not(:checked) { border-radius: 100px; outline-radius: 100px; } } & .linked > .button.text-button:not(.image-button) { // revive underlines @extend %button_array; } } // searchbar, location-bar & inline-toolbar .inline-toolbar { padding: 0.4em; border-style: solid; border-width: 0 1px 1px; border-color: $borders_color; background-color: $secondary_dark_color; box-shadow: if($variant == 'light', $inline-shadow-light, $inline-shadow-dark); } .search-bar, .location-bar { padding: 0.4em; border-style: solid; border-width: 0 0 1px; border-color: $borders_color; background-color: $secondary_dark_color; // use flat circle-button for '+', 'x', etc... .button.raised { padding: 0.75em; border-radius: 100px; outline-radius: 100px; } } /*************** * Header bars * ***************/ .titlebar, .header-bar { @extend %fade_effect; -GtkPaned-handle-size: 0; // FIXME: workaround for ugly Gedit! padding: 0.4em; border-width: 1px 0 1px; border-style: solid; // do not use transparentize border-top-color: $top_edge_border_color; border-bottom-color: $solid_dark_borders_color; background-color: $inverted_dark_color; background-clip: border-box; // basic text colours color: $inverted_secondary_fg_color; .label { // FIXME: only for insensitive state! &:checked { &:insensitive { color: $insensitive_inverted_fg_color; } } &:insensitive { color: $insensitive_inverted_secondary_fg_color; } } // titles .title { padding-left: 1em; padding-right: 1em; color: $inverted_fg_color; font-weight: 700; &:backdrop { @extend .dim-label; } } .subtitle { @extend .dim-label; padding-left: 1em; padding-right: 1em; color: $inverted_secondary_fg_color; font-size: 90%; &:backdrop { @extend .dim-label; } } // separator .header-bar-separator, & > GtkBox > .separator.vertical, & > GtkBox > GtkBox > .separator.vertical { -GtkWidget-separator-width: 0; border: 0 none transparent; color: transparent; } // button styling .button:not(.suggested-action):not(.destructive-action) { @extend .button.flat; border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.001, to($track_color), to(transparent)) 0 0 0 / 0 0 0px; color: $inverted_secondary_fg_color; &:hover { color: $inverted_fg_color; } &:checked { border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.5, to($selected_bg_color), to(transparent)) 0 0 2 / 0 0 2px; background-color: transparent; color: $inverted_fg_color; // &:active { transition: none; } &:insensitive { background-color: transparent; color: $insensitive_inverted_fg_color; > .label { color: inherit; } } } &:insensitive { color: $insensitive_inverted_secondary_fg_color; } } .button, .linked > .button, .button.suggested-action, .button.destructive-action { &, & .label.text-button { color: $inverted_secondary_fg_color; &:hover { color: $inverted_fg_color; } &:checked { color: $inverted_fg_color; &:insensitive { color: $insensitive_inverted_fg_color; } } &:insensitive { color: $insensitive_inverted_secondary_fg_color; } } .label.text-button { // workaround for Gnome-Software border-image: none; box-shadow: none; } } // force to draw circle flat buttons as default .button:not(.suggested-action):not(.destructive-action) { border-radius: 100px; outline-radius: 100px; &.text-button { border-radius: 2px; outline-radius: 2px; &.image-button { border-radius: 2px; outline-radius: 2px; } } } // entry styling .entry, .linked > .entry { color: $inverted_secondary_fg_color; &:focus { color: $inverted_fg_color; } &:insensitive { color: $insensitive_inverted_secondary_fg_color; } } // combobox styling GtkComboBox, .linked > GtkComboBox { &.combobox-entry { .entry { color: $inverted_secondary_fg_color; &:focus { color: $inverted_fg_color; } &:insensitive { color: $insensitive_inverted_secondary_fg_color; } } .button { color: $inverted_secondary_fg_color; &:hover { color: $inverted_fg_color; } &:checked { color: $inverted_fg_color; &:insensitive { color: $insensitive_inverted_fg_color; } } &:insensitive { color: $insensitive_inverted_secondary_fg_color; } } } } // menu styling .menu .menuitem { // reset text colour color: $secondary_fg_color; &:hover { color: $fg_color; } .label { &:insensitive { color: $insensitive_fg_color; } } .accelerator { color: gtkalpha(currentColor, 0.6); } .separator { color: $borders_color; } } // pop-over styling .popover .button.flat { color: $secondary_fg_color; &:hover { color: $fg_color; } .label { &:hover { color: $fg_color; } &:insensitive { color: $insensitive_fg_color; } } } // switch styling GtkSwitch { &.trough { background-color: gtkopacity($inverted_secondary_fg_color, 0.1); &:active { background-color: gtkopacity($selected_bg_color, 0.2); &:insensitive { background-color: gtkopacity($selected_bg_color, 0.2); } } &:insensitive { color: $insensitive_inverted_fg_color; background-color: $track_color; } } &.slider { background-color: $inverted_bg_color; &:hover { background-image: linear-gradient(to bottom, gtkalpha($selected_fg_color, 0.2)); } &:active { background-color: $selected_bg_color; &:insensitive { background-color: #3F4E56; } } &:insensitive { background-color: #3F4E56; } } } // selection-mode styling &.selection-mode { border-width: 1px 0 1px 0; // remove side borders border-top-color: $highlight_color; border-bottom-color: transparent; background-color: $selected_bg_color; color: $selected_fg_color; .subtitle:link { @extend *:link:selected; } .button, .button.text-button, .flat.selection-menu, .text-button.selection-menu, .button.image-button { border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.001, to($selected_fg_color), to(transparent)) 0 0 0 / 0 0 0px; color: $secondary_selected_fg_color; background-color: transparent; &:hover, &:active, &:checked { color: $selected_fg_color; } &:insensitive { color: $insensitive_inverted_secondary_fg_color; } &:checked { border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.5, to($selected_fg_color), to(transparent)) 0 0 2 / 0 0 2px; color: $selected_fg_color; background-color: transparent; &:insensitive { color: $insensitive_selected_fg_color; > .label { color: inherit; } } } &.suggested-action { // NOTE: do not use @extend .button; @include button(normal); &:hover { @include button(hover); } &:active { @include button(active); } &:insensitive { @include button(insensitive); } } } .button:not(.suggested-action):not(.destructive-action) { border-radius: 100px; outline-radius: 100px; &.text-button, &.flat.selection-menu { border-radius: 2px; outline-radius: 2px; &.image-button { border-radius: 100px; outline-radius: 100px; } } } .entry { color: $inverted_secondary_fg_color; &:focus { color: $inverted_fg_color; } &:insensitive { color: $insensitive_inverted_secondary_fg_color; } } .selection-menu { padding-left: 1.2em; padding-right: 1.2em; GtkArrow { -GtkArrow-arrow-scaling: 1; } .arrow { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); } } } // misc .tiled & { @extend %tiled_integration; transition: none; } .maximized & { @extend %maxd_integration; transition: none; } &.default-decoration { // FIXME: do not use scalable units padding: 5.3px; border-width: 0; .title { // fade_effect doesn't work color: $inverted_fg_color; &:backdrop { color: gtkopacity($inverted_fg_color, 0.4); } } .button.titlebutton { padding: 4px; color: $inverted_secondary_fg_color; &:hover, &:active { color: $inverted_fg_color; } &:backdrop { color: gtkopacity($inverted_fg_color, 0.4); } } } } .header-bar { // draw hilight and shadows .csd &, GtkBox &:only-child { box-shadow: if($variant == 'light', $header-shadow-light, $header-shadow-dark); .tiled & { @extend %tiled_integration; } .maximized & { @extend %maxd_integration; } } // override unwanted side-borders GtkBox &:not(:only-child):first-child, GtkBox &:not(:only-child):last-child { border-left-color: $inverted_dark_color; border-right-color: $inverted_dark_color; .tiled &, .maximized & { border-left-color: $panel_bg_color; border-right-color: $panel_bg_color; } } // Remove unneeded side shadows with dirty hacks GtkBox &:not(:only-child):last-child { &:dir(ltr) { box-shadow: if($variant == 'light', $sub-header-shadow-light-ltr, $sub-header-shadow-dark-ltr); .tiled & { @extend %tiled_integration; } .maximized & { @extend %maxd_integration; } } &:dir(rtl) { box-shadow: if($variant == 'light', $sub-header-shadow-light-rtl, $sub-header-shadow-dark-rtl); .tiled & { @extend %tiled_integration; } .maximized & { @extend %maxd_integration; } } } // draw paned-separator with border GtkPaned &:not(:only-child):last-child { &:dir(ltr) { border-left: 1px solid $solid_dark_borders_color; .tiled & { @extend %tiled_integration; } .maximized & { @extend %maxd_integration; } } &:dir(rtl) { border-right: 1px solid $solid_dark_borders_color; .tiled & { @extend %tiled_integration; } .maximized & { @extend %maxd_integration; } } } } .header-bar.selection-mode { // selection-mode specific GtkBox & { // Remove unneeded side shadows with dirty hacks &:not(:only-child):last-child { &:dir(ltr) { box-shadow: if($variant == 'light', $selected-header-shadow-light-ltr, $selected-header-shadow-dark-ltr); .tiled & { @extend %tiled_integration; } .maximized & { @extend %maxd_integration; } } &:dir(rtl) { box-shadow: if($variant == 'light', $selected-header-shadow-light-rtl, $selected-header-shadow-dark-rtl); .tiled & { @extend %tiled_integration; } .maximized & { @extend %maxd_integration; } } } } } .header-bar, .titlebar { // set rounded corners border-top-left-radius: 2px; border-top-right-radius: 2px; GtkBox &:not(:last-child):not(.titlebar) { &:dir(ltr) { border-top-left-radius: 2px; border-top-right-radius: 0; } &:dir(rtl) { border-top-left-radius: 0; border-top-right-radius: 2px; } } GtkBox &:last-child:not(.titlebar) { &:dir(ltr) { border-top-left-radius: 0; } &:dir(rtl) { border-top-right-radius: 0; } } } // squared corners when the window is max'd or tiled %tiled_integration { border-radius: 0; border-color: $panel_bg_color; border-width: 2px 0 0 0; border-top-color: $secondary_selected_bg_color; background-color: $panel_bg_color; box-shadow: none; &:backdrop { border-top-color: $track_color; } } %maxd_integration { border-radius: 0; border-color: $panel_bg_color; border-width: 1px 0 0 0; background-color: $panel_bg_color; box-shadow: none; } /************ * Pathbars * ************/ .path-bar .button { padding: 0.3em 0.7em 0.4em; &.image-button { padding: 0.7em; } &:only-child { padding: 0.3em 0.7em 0.4em; } // the following is for spacing the icon and the label inside the home button .label { &:last-child { padding-left: 2px; } &:first-child { padding-right: 2px; } &:only-child { padding-right: 0; padding-left: 0; } } GtkImage { padding-top: 1px; } } /************** * Tree Views * **************/ GtkTreeView.view { @at-root * { -GtkTreeView-horizontal-separator: 4; -GtkTreeView-grid-line-width: 1; -GtkTreeView-grid-line-pattern: ''; -GtkTreeView-tree-line-width: 1; -GtkTreeView-tree-line-pattern: ''; -GtkTreeView-expander-size: 16; } border-left-color: $track_color; // this is actually the tree lines color, border-top-color: $borders_color; // while this is the grid lines color, // better then nothing &.rubberband { @extend .rubberband; } // to avoid borders being overridden // by the previously set props border-radius: 0; // rest border radius in lists &:hover, &:selected { border-radius: 0; } // override foreground colours &, & .entry, & .entry > .label { color: $secondary_fg_color; &:hover, &:active, &:focus { color: $fg_color; } &:selected { color: $selected_fg_color; } &:insensitive { color: $insensitive_fg_color; &:selected { color: $insensitive_selected_fg_color; } } } .separator { &, &:hover { color: $borders_color; } } // clear backgrounds background-color: transparent; background-image: none; box-shadow: none; &.dnd { border-style: solid none; border-width: 1px; border-color: mix($fg_color, $selected_bg_color, 50%); } &.expander { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); } &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); } &:selected { color: gtkopacity($selected_fg_color, 0.75); &:hover, &:active { color: $selected_fg_color; } } } &.progressbar { // progress bar in treeviews @extend %treeview_progressbar; border-color: $accent_color; &:selected { border-color: currentColor; } } &.trough { // progress bar trough in treeviews @extend %treeview_progressbar; border-color: gtkopacity($accent_color, 0.2); &:selected { border-color: $track_color; } } &, GtkPaned & { // redraw some stuff for RhythmBox background-color: $base_color; &:hover, .list-row:hover { color: $fg_color; } &:selected, .list-row:selected { @extend %selected_items; } } } column-header { .button { @extend .list-row.activatable; padding: 0.3em 0.4em 0.35em; border-style: none solid solid none; border-width: 1px; border-color: $borders_color; border-radius: 0; background-color: $base_color; color: $tertiary_fg_color; box-shadow: none; &:hover, &:active { color: $fg_color; box-shadow: none; } &:insensitive { background-color: $base_color; } &.dnd { @extend column-header.button.dnd; } } &:last-child .button, &:last-child.button { // treeview-like derived widgets // in Banshee and Evolution border-right-style: none; } GtkPaned & { // redraw some stuff for RhythmBox .button { background-color: $base_color; // background-image: linear-gradient(to bottom, $bg_color); &:insensitive { background-color: $base_color; } } &:not(:first-child):not(:last-child) { &.button, & .button { border-style: none solid solid none; } } &, &:only-child, &:first-child, &:last-child { &.button, & .button { border-style: none none solid none; } } } } column-header.button.dnd { // for treeview-like derive widgets // transition: none; border-left-style: solid; color: $selected_bg_color; } /********* * Menus * *********/ .menubar { -GtkWidget-window-dragging: true; padding: 0; box-shadow: $menubar-shadow; background-color: $inverted_dark_color; color: $inverted_secondary_fg_color; // FIXME: Gtk+3 firefox needs this! & > .menuitem { padding: 0.4em 0.6em; color: $inverted_secondary_fg_color; &:hover { // Seems like it :hover even with keyboard focus color: $inverted_fg_color; box-shadow: inset 0 -2px $selected_bg_color; } &:insensitive { color: $insensitive_inverted_fg_color; box-shadow: none; } } .tiled &, .maximized & { background-color: $panel_bg_color; box-shadow: none; } } .menu { margin: 4px 0; padding: 4px 0; border-width: 1px; // adds borders in a non composited env border-style: solid; border-color: $base_color transparent transparent; background-color: $secondary_base_color; .csd & { // axes borders in a composited env border-width: 1px; border-radius: 2px; border-color: $base_color transparent transparent; } .menuitem { transition: none; padding: 0.4em 0.4em 0.5em; color: $secondary_fg_color; font: initial; text-shadow: none; &:hover { transition: none; color: $fg_color; background-color: gtkalpha(currentColor, 0.1); } &:insensitive { color: $insensitive_fg_color; } // submenu indicators &.arrow { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); &:insensitive { color: $insensitive_fg_color; } } &.arrow:dir(rtl) {-gtk-icon-source:-gtk-icontheme('pan-end-symbolic-rtl'); } } &.button { // overlow buttons border-style: none; border-radius: 0; background-color: $secondary_base_color; &:hover { background-color: $secondary_dark_color; } &:insensitive { color: transparent; background-color: transparent; border-color: transparent ; } &.top { border-bottom: 1px solid $borders_color; } &.bottom { border-top: 1px solid $borders_color; } } // use asymmetric separators GtkSeparatorMenuItem { &:dir(ltr) { padding-left: 2.4em; padding-right: 0; } &:dir(rtl) { padding-left: 0; padding-right: 2.4em; } } } .menuitem { .accelerator { color: gtkalpha(currentColor, 0.55); } .separator { color: $borders_color; } } .csd.popup { border-radius: 2px; } /*************** * Popovers * ***************/ .popover { padding: 2px; border: 1px solid; border-color: $base_color $secondary_base_color $secondary_base_color; border-radius: 2px; background-color: $secondary_base_color; box-shadow: $z-depth-3; &:backdrop { box-shadow: $z-depth-1; } > .list, > .view, > .toolbar, &.osd > .toolbar { border-style: none; border-image: none; background-color: transparent; transition: none; } .button.menuitem.flat, .button.flat { transition: none; background-color: transparent; background-size: 8em * 1 / 0.8 8em * 1 / 0.8, auto; color: $secondary_fg_color; font: initial; &:hover { background-color: transparent; // remove double-bg color: $fg_color; } // FIXME: label padding is ugly // vertical padding of GtkMenuItem * 0.5 .label { padding: 0.2em 0 0.25em; } } .linked > .button { // @extend .button.flat; @include button(flat-normal); @extend %button_array; color: $secondary_fg_color; &:hover { @include button(flat-hover); } &:active { @include button(flat-active); } &:insensitive { @include button(flat-nsensitive); } &:checked { @include button(flat-checked); color: $fg_color; background-color: transparent; } &:checked:insensitive { @include button(flat-checked-insensitive); } } // hide trough in popover .scrollbar.trough { background-color: transparent; border: 1px none transparent; } &.osd { @extend %osd; } } /***************** * Notebooks and * * Tabs * *****************/ .notebook { // Through me you go to the grief wracked city; // Through me you go to everlasting pain; // Through me you go a pass among lost souls. // ... // Abandon all hope — Ye Who Enter Here padding: 0; background-color: $base_color; -GtkNotebook-initial-gap: 6; -GtkNotebook-arrow-spacing: 5; -GtkNotebook-tab-curvature: 0; -GtkNotebook-tab-overlap: 1; -GtkNotebook-has-tab-gap: false; -GtkWidget-focus-padding: 0; -GtkWidget-focus-line-width: 0; &.frame { border: 1px solid $borders_color; @each $_tab, $_border in (top, top), (bottom, bottom), (left, left), (right, right) { &.#{$_tab} { border-#{$_border}-color: $base_color; } } } &.header { // FIXME: double borders in some case, can't fix it w/o a class tho // FIXME: doesn't work on dark var background-color: $bg_color; // this is the shading of the header behind the tabs &.frame { border: none; } @each $_header, $_border in (top, 0 -1px), (bottom, 0 1px), (left, -1px 0), (right, 1px 0) { &.#{$_header} { box-shadow: inset #{$_border} $borders_color; } } } tab { outline-offset: 0; border-width: 0; border-style: solid; border-color: transparent; background-color: transparent; $tab_indicator_size: 2px; // vertical tab sizing $vt_vpadding: 0.5em; $vt_hpadding: 1.2em; // horizontal tab sizing $ht_vpadding: 0.5em; $ht_hpadding: 1.2em; // FIXME: we get double border in some cases, not considering the broken // notebook content frame... &.top, &.bottom { padding: $vt_vpadding $vt_hpadding; } &.left, &.right { padding: $ht_vpadding $ht_hpadding; } &.reorderable-page { -GtkNotebook-tab-overlap: 1; &.top, &.bottom { padding-left: 1.2em; // for a nicer close button padding-right: 1.2em; // placement border-left-width: 1px; border-right-width: 1px; } &.left, &.right { border-bottom-width: 1px; border-top-width: 1px; } } @each $_tab, $_border in (top, bottom), (bottom, top), (left, right), (right, left) { &.#{$_tab} { // padding-#{$_border}: ($vt_vpadding -$tab_indicator_size); border-#{$_border}-width: $tab_indicator_size; } } // here's the interesting stuff &:hover, &.prelight-page { border-color: $track_color; } &:active, &.active-page { border-color: $selected_bg_color; } @each $_tab, $_border in (top, bottom), (bottom, top), (left, right), (right, left) { &.reorderable-page.#{$_tab} { border-color: transparent; &:hover, &.prelight-page { border-color: $borders_color; border-#{$_border}-width: 1px; border-#{$_border}-color: $borders_color; background-color: $base_color; box-shadow: none; } &:active, &.active-page { border-color: $borders_color; border-#{$_border}-width: 2px; border-#{$_border}-color: $selected_bg_color; background-color: $base_color; box-shadow: if($variant == 'light', $tab-shadow-light, $tab-shadow-dark); } } } .label { // tab text // needed for a nicer focus ring // and to prevent unexpected offset on reorderable-page, // set same padding with .button > GtkImage padding: 0.5em; font-weight: 700; color: $tertiary_fg_color; } .prelight-page .label, .label.prelight-page { // hover tab text color: $fg_color; } .active-page .label, .label.active-page { // active tab text color: $fg_color; } .button { // tab close button @extend %image_button; padding: 0; background-size: 3em * 1 / 0.8 3em * 1 / 0.8, auto; @include button(flat-normal); color: $tertiary_fg_color; &:hover { @include button(flat-hover); } &:active { @include button(flat-active); } &:insensitive { @include button(flat-insensitive); } & > GtkImage { // this is a hack which makes tabs grow padding: 0.6em; } } .prelight-page .button, &:hover .button { // hover tab close button color: $fg_color; } .active-page .button, &:hover .button { // active tab close button color: $fg_color; } } &.arrow { color: $tertiary_fg_color; &:hover, &:active { color: $fg_color; } &:insensitive { color: $insensitive_secondary_fg_color; } } &:not(.reorderable-page) > .entry { @extend .entry.flat; } } /************** * Scrollbars * **************/ @keyframes slow_down_ltr { to { margin-right: 0; } } @keyframes slow_down_rtl { to { margin-left: 0; } } @keyframes slow_down_horz { to { margin-top: 0; } } .scrollbar { -GtkRange-slider-width: 12; -GtkRange-trough-border: 0; -GtkScrollbar-has-backward-stepper: false; -GtkScrollbar-has-forward-stepper: false; -GtkScrollbar-min-slider-length: 32; // minimum size for the slider. // sadly can't be in '.slider' // where it belongs -GtkRange-stepper-spacing: 0; -GtkRange-trough-under-steppers: 1; .button { border: none; } &.overlay-indicator { &:not(.dragging):not(.hovering) { // Overlay scrolling indicator -GtkRange-slider-width: 10px; // actually 10 - 4 -> 6px slider .slider { margin: 0; border: none; } .trough { border-style: none; background-color: transparent; } // w/o the following margin tweaks the slider shrinks when // hovering/dragging &.vertical .slider { margin-top: 0; margin-bottom: 0; &:dir(ltr) { margin-left: 0; margin-right: 6px; } &:dir(ltr) { margin-left: 6px; margin-right: 0; } } &.horizontal .slider { margin-top: 6px; margin-bottom: 0; margin-left: 0; margin-right: 0; } } &.dragging, &.hovering { .trough { background-color: gtkopacity($base_color, 0.55); } } &.hovering { // slow-down when deforming &.vertical .slider { &:dir(ltr) { animation: slow_down_ltr 0.2s linear forwards; } &:dir(rtl) { animation: slow_down_rtl 0.2s linear forwards; } } &.horizontal .slider { animation: slow_down_horz 0.2s linear forwards; } } } // trough coloring .trough { border: none; background-color: $base_color; } // slider coloring .slider { background-color: gtkopacity($tertiary_fg_color, 0.55); &:hover { background-color: gtkopacity($secondary_fg_color, 0.55); } &:active { background-color: $fg_color; } &:insensitive { opacity: 0.4; } } // sizing .slider { border-radius: 0; margin: 0; } &.fine-tune .slider { margin: 0; } &.vertical { .slider { margin: 0; } &.fine-tune .slider { margin: 0; } } &.horizontal { .slider { margin: 0; } &.fine-tune .slider { margin: 0; } } } .scrollbars-junction, .scrollbars-junction.frame { // the small square between two scrollbars border: none; background-color: $base_color; } /********** * Switch * **********/ GtkSwitch { -GtkSwitch-slider-width: 20px; // 55px is the right value to make it as tall // as buttons, not doing that for now -GtkSwitch-slider-height: 20px; outline-offset: -4px; outline-radius: 100px; font-size: 0; &.trough { // similar to the .scale border: 8px solid transparent; border-radius: 100px; background-color: $track_color; &:active { background-color: gtkopacity($selected_bg_color, 0.2); &:insensitive { background-color: gtkopacity($selected_bg_color, 0.2); } } &:insensitive { color: $insensitive_fg_color; background-color: $track_color; } } &.slider { padding: 4px; border-radius: 100px; outline-radius: 100px; @include button(normal); &:hover { @include button(hover); background-image: linear-gradient(to bottom, gtkalpha($selected_fg_color, 0.2)); } &:active { @include button(checked); &:hover { box-shadow: $z-depth-2; } &:insensitive { @include button(checked-insensitive); // do not use any transparentized materials background-color: if($variant == 'light', #F0F2F3, #3F4E56); background-image: none; box-shadow: none; } } &:insensitive { background-color: if($variant == 'light', #F0F2F3, #3F4E56); background-image: none; box-shadow: none; } } .list-row:selected & { // return to monochrome &.trough { background-color: $bg_color; &:active { background-color: $secondary_dark_color; &:insensitive { background-color: $secondary_dark_color; } } } &.slider { background-color: $bg_color; &:hover { background-image: linear-gradient(to bottom, gtkalpha($selected_fg_color, 0.2)); } &:active { background-color: $base_color; &:hover { box-shadow: $z-depth-2; } } } } // special case inside the grid container, // need to protect geometry by using pixmaps images... GtkGrid & { -GtkSwitch-slider-width: 40; -GtkSwitch-slider-height: 20; font-size: 0; outline-color: transparent; &.trough, &.slider { // reset all of default switches &, &:hover, &:active, &:active:hover, &:active:insensitive, &:insensitive { padding: 0; border: 4px solid transparent; color: transparent; background: none; background-image: none; background-size: 40px 20px; background-repeat: no-repeat; background-position: right center; box-shadow: none; &:dir(rtl) { background-position: left center; } } } &.trough { // use ugly pixmaps background-image: -gtk-scaled( url("assets/toggle-off#{$asset_suffix}.png"), url("assets/toggle-off#{$asset_suffix}@2.png")); &:hover { background-image: -gtk-scaled( url("assets/toggle-off-hover#{$asset_suffix}.png"), url("assets/toggle-off-hover#{$asset_suffix}@2.png")); } &:active { background-image: -gtk-scaled(url("assets/toggle-on.png"), url("assets/toggle-on@2.png")); &:hover { background-image: -gtk-scaled(url("assets/toggle-on-hover.png"), url("assets/toggle-on-hover@2.png")); } &:insensitive { background-image: -gtk-scaled( url("assets/toggle-on-insensitive#{$asset_suffix}.png"), url("assets/toggle-on-insensitive#{$asset_suffix}@2.png")); } } &:insensitive { background-image: -gtk-scaled( url("assets/toggle-off-insensitive#{$asset_suffix}.png"), url("assets/toggle-off-insensitive#{$asset_suffix}@2.png")); } } } } /************************* * Check and Radio items * *************************/ // draw regular check and radio items using our PNG assets // all assets are rendered from assets.svg. never add pngs directly @each $w,$a in ('check', 'checkbox'), ('radio','radio') { // standard checks and radios @each $s,$as in ('','-unchecked'), (':hover', '-unchecked-active'), (':active', '-unchecked-active'), (':insensitive','-unchecked-insensitive'), (':inconsistent', '-mixed'), (':inconsistent:hover', '-mixed-active'), (':inconsistent:active', '-mixed-active'), (':inconsistent:insensitive', '-mixed-insensitive'), (':checked', '-checked'), (':checked:hover', '-checked-active'), (':checked:active', '-checked-active'), (':checked:insensitive','-checked-insensitive') { .#{$w}#{$s} { -gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}#{$asset_suffix}.png"), url("assets/#{$a}#{$as}#{$asset_suffix}@2.png")); icon-shadow: none; } } // menu @each $s,$as in ('',''), // (':active', '-checked'), (':insensitive','-insensitive'), (':inconsistent', '-mixed'), // (':inconsistent:active', '-mixed'), (':inconsistent:insensitive', '-mixed-insensitive'), (':checked', '-checked'), // (':checked:active', '-checked'), (':checked:insensitive','-checked-insensitive') { .menu .menuitem.#{$w}#{$s} { -gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}-symbolic#{$asset_suffix}.png"), url("assets/#{$a}#{$as}-symbolic#{$asset_suffix}@2.png")); icon-shadow: none; &:hover { -gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}-symbolic#{$asset_suffix}.png"), url("assets/#{$a}#{$as}-symbolic#{$asset_suffix}@2.png")); } } } } // check/radio inside selected-rows @each $w,$a in ('check', 'checkbox'), ('radio','radio') { // standard checks and radios @each $s,$as in ('','-unchecked'), (':active', '-unchecked'), (':inconsistent', '-mixed'), (':inconsistent:active', '-mixed'), (':checked', '-checked'), (':checked:active', '-checked') { .view, .list-row, .list-row.activatable { .#{$w}:selected#{$s}, .#{$w}:selected:focus#{$s} { -gtk-icon-source: -gtk-scaled(url("assets/#{$a}#{$as}-selected.png"), url("assets/#{$a}#{$as}-selected@2.png")); icon-shadow: none; } // use dark variant for insensitive states #{$w}:selected:insensitive, #{$w}:selected:focus:insensitive { -gtk-icon-source: -gtk-scaled(url("assets/#{$a}-unchecked-insensitive-dark.png"), url("assets/#{$a}-unchecked-insensitive-dark@2.png")); } #{$w}:selected:inconsistent:insensitive, #{$w}:selected:focus:inconsistent:insensitive { -gtk-icon-source: -gtk-scaled(url("assets/#{$a}-mixed-insensitive-dark.png"), url("assets/#{$a}-mixed-insensitive-dark@2.png")); } #{$w}:selected:checked:insensitive, #{$w}:selected:focus:checked:insensitive { -gtk-icon-source: -gtk-scaled(url("assets/#{$a}-checked-insensitive-dark.png"), url("assets/#{$a}-checked-insensitive-dark@2.png")); } } } } // selection-mode @each $s,$as in ('','-selectionmode'), (':hover', '-active-selectionmode'), (':active', '-active-selectionmode'), (':insensitive', '-insensitive-selectionmode'), (':checked', '-checked-selectionmode'), (':checked:hover', '-checked-active-selectionmode'), (':checked:active', '-checked-active-selectionmode'), (':insensitive:checked', '-checked-insensitive-selectionmode') { .view.content-view.check#{$s}:not(.list) { -gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}#{$asset_suffix}.png"), url("assets/checkbox#{$as}#{$asset_suffix}@2.png")); background-color: transparent; } } GtkCheckButton.text-button, GtkRadioButton.text-button { // this is for a nice focus on check and radios text padding: 0.2em 0.5em; outline-offset: 0; color: $secondary_fg_color; &:hover, &:active, &:checked { color: $fg_color; } &:insensitive, &:insensitive:active, &:insensitive:inconsistent { // set insensitive color, which is overriden otherwise color: $insensitive_fg_color; } } /************ * GtkScale * ************/ .scale, .scale.scale-has-marks-above.scale-has-marks-below, .scale.vertical.scale-has-marks-above.scale-has-marks-below { // FIXME: rationalize -GtkScale-slider-length: 20; -GtkRange-slider-width: 20; -GtkRange-trough-border: 2; outline-offset: -8px; outline-radius: 100px; &.fine-tune { // outline-offset: -6px; &.slider { background-size: 80%; } &.trough { // margin: 8px; // border-radius: 100px; } } &.slider { &:not(:hover):not(:active) { background-size: 80%; } // @include entry(normal); // border-radius: 50%; // background-color: $accent_color; @each $s,$as in ('',''), // (':hover','-hover'), (':active','-active'), (':insensitive','-insensitive') { &.slider#{$s} { $_url: 'assets/slider#{$as}#{$asset_suffix}'; border-style: none; border-radius: 0; background-color: transparent; background-image: -gtk-scaled(url('#{$_url}.png'), url('#{$_url}@2.png')); background-repeat: no-repeat; background-position: center; box-shadow: none; } } &:hover { // @include entry(focus); // border-radius: 50%; // needed for double marks scales } &:insensitive { // @include entry(insensitive); // border-radius: 50%; // overridden } // OSD sliders .osd & { } } &.trough { margin: 11px; border-radius: 0; background-color: $track_color; &.highlight { background-color: $accent_color; &:insensitive { background-color: $track_color; } } &:insensitive { color: $insensitive_fg_color; } // OSD troughs .osd & { } } // marks color &.separator { color: $track_color; } // scales on selected list rows .list-row:selected & { } } @each $d,$dn in ('', 'horz'), ('.vertical', 'vert') { @each $w,$we in ('scale-has-marks-below','scale_marks_below'), ('scale-has-marks-above','scale_marks_above') { .scale#{$d}.#{$w} { -GtkScale-slider-length: 20; -GtkRange-slider-width: 25; -GtkRange-trough-border: 1; @extend %#{$we}_#{$dn}; @each $s,$as in ('',''), // (':hover','-hover'), (':active','-active'), (':insensitive','-insensitive') { &.slider#{$s} { $_url: 'assets/slider-#{$dn}-#{$w}#{$as}#{$asset_suffix}'; border-style: none; border-radius: 0; background-color: transparent; background-image: -gtk-scaled(url('#{$_url}.png'), url('#{$_url}@2.png')); background-repeat: no-repeat; background-position: center; box-shadow: none; } } } } } %scale_marks_above_horz { .trough { margin: 15px 10px 10px; } // &.fine-tune .trough { margin: 13px 8px 8px; } } %scale_marks_below_horz { .trough { margin: 10px 10px 15px; } // &.fine-tune .trough { margin: 8px 8px 13px; } } %scale_marks_above_vert { .trough { margin: 10px 10px 10px 15px; } // &.fine-tune .trough { margin: 8px 8px 8px 13px; } } %scale_marks_below_vert { .trough { margin: 10px 15px 10px 10px; } // &.fine-tune .trough { margin: 8px 13px 8px 8px; } } /***************** * Progress bars * *****************/ GtkProgressBar { -GtkProgressBar-min-horizontal-bar-height: 4; -GtkProgressBar-min-vertical-bar-width: 4; padding: 0; font-size: 90%; color: $tertiary_fg_color; &.osd { -GtkProgressBar-xspacing: 0; -GtkProgressBar-yspacing: 0; -GtkProgressBar-min-horizontal-bar-height: 4; } &.trough { // background border-radius: 0; background-color: gtkopacity($accent_color, 0.2); &.osd { border-style: none; box-shadow: none; background-color: gtkopacity($accent_color, 0.2); } } } // moving bit .progressbar { border-radius: 0; background-color: $accent_color; &.left { border-top-left-radius: 0; border-bottom-left-radius: 0; } &.right { border-top-right-radius: 0; border-bottom-right-radius: 0; } &.left.right { box-shadow: none; } &.vertical { &.top { border-top-left-radius: 0; border-top-right-radius: 0; } &.bottom { border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: none; } } &.osd { background-image: none; background-color: $accent_color; border-style: none; border-radius: 0; } } %entry_progressbar { // progress inside .entry border-style: none none solid; border-width: 2px; border-image: -gtk-gradient(radial, center bottom, 0, center bottom, 0.5, to($accent_color), to(transparent)) 0 0 2 / 0 0 2px; border-radius: 0; box-shadow: none; background-color: transparent; background-image: none; } %treeview_progressbar { // progress inside GtkTreeView border-style: none none solid; border-width: 4px; border-radius: 0; box-shadow: none; background-color: transparent; background-image: none; } /************* * Level Bar * *************/ .level-bar { box-shadow: $z-depth-1; // needs to be set here to avoid clipping -GtkLevelBar-min-block-width: 36; -GtkLevelBar-min-block-height: 4; &.vertical { -GtkLevelBar-min-block-width: 4; -GtkLevelBar-min-block-height: 36; } &.trough { padding: 2px; border-radius: 2px; box-shadow: $z-depth-1; &:insensitive { box-shadow: none; } &.indicator-discrete { &.horizontal { padding: 2px 1px; } &.vertical { padding: 1px 2px; } } } &.fill-block { // FIXME: it would be nice to set make fill blocks bigger, but we'd need // :nth-child working on discrete indicators background-color: $accent_color; border-radius: 0; box-shadow: none; &.indicator-discrete { &.horizontal { margin: 0 1px; } &.vertical { margin: 1px 0; } } &.level-high { background-color: $success_color; } &.level-low { background-color: $accent_color; } &.empty-fill-block { background-color: $track_color; } } } /********** * Frames * **********/ .frame { border: 1px solid $borders_color; padding: 0; &.flat { border-style: none; } &.action-bar { padding: 0.4em; border-width: 1px 0 0; } } GtkScrolledWindow { GtkViewport.frame { // avoid double borders when viewport inside // scrolled window border-style: none; } } // vbox and hbox separators .separator { // always disable separators // -GtkWidget-wide-separators: true; color: $borders_color; // Font and File button separators GtkFileChooserButton &.vertical, GtkFontButton &.vertical { // always disable separators -GtkWidget-wide-separators: true; } } /********* * Lists * *********/ .list { border-color: $borders_color; background-color: $base_color; } .list-row, .grid-child { padding: 2px; } .list-row.activatable { // let's take care of background colors background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(gtkalpha(currentColor, 0)), to(transparent)), linear-gradient(to bottom, gtkalpha(currentColor, 0)); background-repeat: no-repeat; background-position: center, center; background-size: 192px * 1 / 0.8 192px * 1 / 0.8, auto; &:hover { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(gtkalpha(currentColor, 0)), to(transparent)), linear-gradient(to bottom, gtkalpha(currentColor, 0.05)); } &:active { animation: list_ripple_effect 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; } &:insensitive {color: $insensitive_fg_color; } } .list-row:selected { @extend %selected_items; .button { &:insensitive { color: $insensitive_secondary_selected_fg_color; } &.flat { color: $secondary_selected_fg_color; &:hover, &:active { color: $selected_fg_color; } &:insensitive { color: $insensitive_secondary_selected_fg_color; } } } } // button spacing .list-row { .button.image-button { padding: 0.4em; background-size: 2em * 1 / 0.8 2em * 1 / 0.8, auto; } } // transition .list-row { &:hover { transition: none; } } /********************* * App Notifications * *********************/ .app-notification, .app-notification.frame { @extend %osd; @extend .toolbar.osd; .button { } } /************* * Expanders * *************/ .expander { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic'); &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); } &:not(:hover):not(:active) { color: gtkalpha(currentColor, 0.75); } &:selected { color: $selected_fg_color; } &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); } } /************ * Calendar * ***********/ GtkCalendar { margin: 0.6em 0; padding: 0.4em 0.1em 0.2em; border: 1px solid $borders_color; color: $fg_color; &:selected { border: none; border-radius: 100px; color: $selected_fg_color; background-color: transparent; background-image: -gtk-scaled(url("assets/calendar-day-selected.png"), url("assets/calendar-day-selected@2.png")); background-size: 2em 2em; background-position: center top; background-repeat: no-repeat; } &.header { border: 1px solid transparent; border-bottom-color: $borders_color; border-radius: 0; } &.button { @include button(flat-normal); color: gtkalpha(currentColor, 0.20); &:hover { @include button(flat-hover); } &:active { @include button(flat-active); } &:insensitive { @include button(flat-insensitive); } } &:inconsistent { color: gtkalpha(currentColor, 0.20); } &.highlight { color: gtkalpha(currentColor, 0.55); font-size: 90%; font-weight: 500; } } /*********** * Dialogs * ***********/ .message-dialog { // Message Dialog styling color: $inverted_fg_color; &.background { background-color: $inverted_dark_color; opacity: 0.9; } .titlebar { border-style: none; color: $inverted_fg_color; background-color: $inverted_dark_color; } .entry { color: $inverted_fg_color; &:focus { color: $selected_fg_color; } &:insensitive { color: $insensitive_inverted_fg_color; } } .button { // set foregrounds for fallback-mode color: $secondary_accent_color; &:hover, &:active, &:checked { color: $accent_color; } &:insensitive { color: $insensitive_inverted_fg_color; } } .linked > .button { border: 2px solid transparent; border-radius: 2px; border-image: none; box-shadow: none; } // always use dark variant for check/radio icons @each $s,$as in ('','-unchecked'), (':hover', '-unchecked-active'), (':active', '-unchecked-active'), (':insensitive','-unchecked-insensitive'), (':inconsistent', '-mixed'), (':inconsistent:hover', '-mixed-active'), (':inconsistent:active', '-mixed-active'), (':inconsistent:insensitive', '-mixed-insensitive'), (':checked', '-checked'), (':checked:hover', '-checked-active'), (':checked:active', '-checked-active'), (':checked:insensitive','-checked-insensitive') { .check#{$s} { -gtk-icon-source: -gtk-scaled(url("assets/checkbox#{$as}-dark.png"), url("assets/checkbox#{$as}-dark@2.png")); } .radio#{$s} { -gtk-icon-source: -gtk-scaled(url("assets/radio#{$as}-dark.png"), url("assets/radio#{$as}-dark@2.png")); } } GtkCheckButton.text-button, GtkRadioButton.text-button { color: $inverted_secondary_fg_color; &:hover, &:active, &:checked { color: $inverted_fg_color; } &:insensitive, &:insensitive:active, &:insensitive:inconsistent { // set insensitive color, which is overriden otherwise color: $insensitive_inverted_fg_color; } } &.csd { // rounded bottom border styling for csd version &.background { // bigger radius for better antialiasing border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; } .dialog-action-area { .button, .linked > .button { @extend .button.flat; padding: 0.7em 1em 0.8em; border: 2px solid transparent; border-radius: 0; color: $secondary_accent_color; background-size: 192px * 1 / 0.8 192px * 1 / 0.8, auto; &:hover { @include button(flat-hover); color: $accent_color; } &:active { @include button(flat-active); color: $accent_color; } &:checked { @include button(flat-checked); color: $secondary_accent_color; } &:insensitive { @include button(flat-insensitive); } &:first-child { border-bottom-left-radius: 2px; border-right-width: 0; } &:last-child { border-bottom-right-radius: 2px; border-left-width: 0; } } } } } GtkFileChooserDialog { .search-bar { // background-color: $base_color; // border-color: $bg_color; } .dialog-action-box { border-top: 1px solid $borders_color; } } /*********** * Sidebar * ***********/ .sidebar { border: none; color: $secondary_fg_color; &, .list { // draw shadows &:dir(ltr) { box-shadow: if($variant == 'light', $sidebar-light-ltr, $sidebar-dark-ltr); } &:dir(rtl) { box-shadow: if($variant == 'light', $sidebar-light-rtl, $sidebar-dark-rtl); } } // remove background from child-elements GtkTreeView.view, .frame, .list { background-color: transparent; } GtkTreeView.view { box-shadow: none; &:selected, .list-row:selected { @extend %selected_items; } } // fill actual background background-color: $secondary_dark_color; .frame .list { box-shadow: none; } // disable shadows on overshoot/undershoot area // of gtk3-demo's sidebar .overshoot, .undershoot { box-shadow: none; } } GtkSidebarRow { &.list-row { padding: 0; // Needs overriding of the GtkListBoxRow padding color: $secondary_fg_color; font-weight: 500; &:hover { color: $fg_color; } &:selected { color: $selected_bg_color; background-color: transparent; } &:backdrop { opacity: 1.0; } } // Using margins/padding directly in the SidebarRow // will make the animation of the new bookmark row jump .sidebar-revealer { padding: 0.2em 1.1em 0.2em 1em; } .sidebar-icon { opacity: 0.75; // dim the device icons &:dir(ltr) { padding-right: 0.6em; } &:dir(rtl) { padding-left: 0.6em; } } .sidebar-label { &:dir(ltr) { padding-right: 0.1em; } &:dir(rtl) { padding-left: 0.1em; } } } GtkPlacesSidebar.sidebar { // in the sidebar case it makes no sense to click the selected row // .list-row:selected:active { box-shadow: none; } // looks like the label doesn't get all the states so work around .list-row:selected:insensitive .label { color: $insensitive_selected_fg_color; } .list-row:selected { // 'eject' button .sidebar-button.button { color: $secondary_selected_bg_color; &:hover, &:active { color: $selected_bg_color; } } } .sidebar-placeholder-row { border: solid 1px $selected_bg_color; } .sidebar-new-bookmark-row { color: $selected_bg_color; } // @at-root needded to not change the specificity making button styling // inheritance broken so istead of // "GtkPlacesSidebar.sidebar .sidebar-button.button" [specificity 0,0,3,1] // the extended selector ".sidebar-button.button" [specificity 0,0,2,0] @at-root .sidebar-button.button { &.image-button { padding: 4px; color: $secondary_fg_color; &:hover, &:active, &:checked { color: $fg_color; } } @extend .button.flat; // border-radius: 100%; // outline-radius: 100%; } // this is for indicating which sidebar row generated a popover // see https://bugzilla.gnome.org/show_bug.cgi?id=754411 .has-open-popup { @extend .list-row.activatable:active; transition: none; } } .sidebar-item { padding: 0.8em 0.6em; > .label { padding-left: 0.4em; padding-right: 0.4em; } &.needs-attention > .label { @extend %needs_attention; } } GtkStackSidebar { .sidebar-item { padding: 0.8em 0.6em; > .label { padding-left: 0.4em; padding-right: 0.4em; } color: $secondary_fg_color; font-weight: 500; &:hover { color: $fg_color; } &:selected { color: $selected_bg_color; background-color: transparent; } &:backdrop { opacity: 1.0; } } .frame .list { // draw shadows // dim background with alpha-blending background-color: if($variant == 'light', rgba(12, 18, 0, 0.01), rgba(18, 22, 0, 0.04)); &:dir(ltr) { box-shadow: if($variant == 'light', $sidebar-light-ltr, $sidebar-dark-ltr); } &:dir(rtl) { box-shadow: if($variant == 'light', $sidebar-light-rtl, $sidebar-dark-rtl); } } // remove unwanted separator .separator { -GtkWidget-wide-separators: true; } } /********* * Paned * *********/ GtkPaned { // this is for the standard paned separator -GtkPaned-handle-size: 1; // sets separator width -gtk-icon-source: none; // removes handle decoration margin: 0 8px 8px 0; // drag area of the separator, not a real margin &:dir(rtl) { margin-right: 0; margin-left: 8px; } .pane-separator { background-color: $borders_color; } } GtkPaned.wide { // this is for the paned with wide separator -GtkPaned-handle-size: 6; // wider separator here margin: 0; // no need of the invisible drag area so, reset margin .pane-separator { background-color: transparent; border-style: none solid; border-color: $borders_color; border-width: 1px; } &.vertical .pane-separator { border-style: solid none; } } /************** * GtkInfoBar * **************/ GtkInfoBar { padding: 0.4em; border-width: 0 0 1px; border-style: solid; // do not use transparentize border-color: $solid_light_borders_color; background-color: $secondary_dark_color; } .info, .question, .warning, .error { // always use dark foreground colour color: $secondary_fixed_fg_color; .button { @extend .button.flat; color: $secondary_fixed_fg_color; &:insensitive { color: $insensitive_fixed_fg_color; } &.flat { color: $secondary_fixed_fg_color; &:hover, &:active { color: $fixed_fg_color; } &:insensitive { color: $insensitive_fixed_fg_color; } } } .label:selected, .label:selected:focus, .label:selected:hover { background-color: darken($selected_bg_color, 10%); } // use 'white' bit and trough GtkProgressBar.trough { background-color: gtkopacity($selected_fg_color, 0.2); } .progressbar { background-color: $selected_fg_color; } } .info { background-color: $info_bg_color; } .question { background-color: $question_bg_color; } .warning { background-color: $warning_bg_color; } .error { // use white text for this color: $selected_fg_color; background-color: $error_bg_color; } /************ * Tooltips * ************/ .tooltip { &.background { // background-color needs to be set this way otherwise it gets drawn twice // see https://bugzilla.gnome.org/show_bug.cgi?id=736155 for details. background-color: gtkopacity($inverted_dark_color, 0.9); } color: $inverted_fg_color; padding: 0.2em; // not working border-radius: 2px; box-shadow: none; // otherwise it gets inherited by windowframe.csd // FIXME: we need a border or tooltips vanish on black background. &.window-frame.csd { background-color: transparent; } } .tooltip * { // Yeah this is ugly padding: 0.2em; background-color: transparent; color: inherit; // just to be sure } /***************** * Color Chooser * *****************/ GtkColorSwatch { // This widget is made of two boxes one on top of the other, // the lower box is GtkColorSwatch {} the other one is // GtkColorSwatch > .overlay {}, GtkColorSwatch has the programmatically // set background, so most of the style is applied to the overlay box. box-shadow: $z-depth-1; // we need to re-set the shadow here since it get axed by the previous bit &:selected { } // base color corners rounding // to avoid the artifacts caused by rounded corner anti-aliasing the base // color sports a bigger radius. // nth-child is needed by the custom color strip. // The :not() madness is needed since actually the overlay is selectable // by GtkColorSwatch > .overlay and GtkColorSwatch.overlay, // I know it's weird, but this is gtk+, not a browser. &.top { border-top-left-radius: 2px; border-top-right-radius: 2px; } &.bottom { border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; } &.left, &:first-child:not(.overlay):not(.top) { border-top-left-radius: 2px; border-bottom-left-radius: 2px; } &.right, &:last-child:not(.overlay):not(.bottom) { border-top-right-radius: 2px; border-bottom-right-radius: 2px; } &:only-child:not(.overlay) { border-radius: 2px; } // overlay corner rounding &.top > .overlay { border-top-left-radius: 2px; border-top-right-radius: 2px; } &.bottom > .overlay { border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; } &:first-child:not(.top) > .overlay { border-top-left-radius: 2px; border-bottom-left-radius: 2px; } &:last-child:not(.bottom) > .overlay { border-top-right-radius: 2px; border-bottom-right-radius: 2px; } &:only-child > .overlay { border-radius: 2px; } // hover effect &:hover { box-shadow: $z-depth-2; } // no hover effect for the colorswatch in the color editor GtkColorEditor & { border-radius: 2px; // same radius as the entry &:hover { box-shadow: $z-depth-1; } } // indicator and keynav outline colors &.color-dark { color: #FFFFFF; } &.color-light { color: gtkopacity(#000000, 0.8); } // border color &.overlay, &.overlay:selected { } // make the add color button looks like, well, a button &#add-color-button { background-image: linear-gradient(to right, $error_bg_color 25%, $warning_bg_color 25%, $warning_bg_color 50%, $info_bg_color 50%, $info_bg_color 75%, $question_bg_color 75%); color: #FFFFFF; } } /******** * Misc * ********/ // content view (grid/list) .content-view { background-color: $bg_color; // &:hover { -gtk-image-effect: highlight; } &.rubberband { @extend .rubberband; } } .scale-popup { .osd & { @extend %osd; } .osd & .button.flat { // FIXME: quick hack, redo properly } .osd & .vertical .button, & .vertical .button { // +/- buttons on GtkVolumeButton popup border-radius: 100px; outline-radius: 100px; background-color: transparent; color: $secondary_fg_color; &:first-child { // '+' button &:hover { @include button(flat-hover); background: none; color: $success_color; } &:insensitive { @include button(flat-insensitive); background: none; color: gtkalpha($success_color, 0.4); } } &:last-child { // '-' button &:hover { @include button(flat-hover); background: none; color: $error_color; } &:insensitive { @include button(flat-insensitive); background: none; color: gtkalpha($error_color, 0.4); } } } .osd & .button, .button { border-radius: 100px; outline-radius: 100px; background-color: transparent; color: $secondary_fg_color; &:first-child { // '-' button &:hover { @include button(flat-hover); background: none; color: $error_color; } &:insensitive { @include button(flat-insensitive); background: none; color: gtkalpha($error_color, 0.4); } } &:last-child { // '+' button &:hover { @include button(flat-hover); background: none; color: $success_color; } &:insensitive { @include button(flat-insensitive); background: none; color: gtkalpha($success_color, 0.4); } } } } GtkScaleButton.button, GtkVolumeButton.button { // I assume both are image-button *by default* // with the image-button/text-button classes automagically applied // depending on the button child these selectors can be deleted. @extend %image_button; @extend .button.flat; border-radius: 100px; outline-radius: 100px; &.text-button { border-radius: 2px; outline-radius: 2px; } } .floating-bar { @extend %osd; padding: 0.1em 0 0.2em; border: 1px solid transparent; border-radius: 0; color: $inverted_secondary_fg_color; background-color: $inverted_dark_color; transition: none; .button { padding: 0.3em; margin: 0 0.3em; color: $secondary_accent_color; &:hover, &:active, &:checked { color: $accent_color; } &:insensitive { color: gtkopacity($accent_color, 0.4); } } } .floating-bar.bottom { &.left { // axes left border and border radius border-width: 1px 1px 0 0; border-radius: 0 2px + 1px 0 0; } &.right { // axes right border and border radius border-width: 1px 0 0 1px; border-radius: 2px + 1px 0 0 0; } } /********************** * Window Decorations * *********************/ .window-frame { transition: none; border-radius: 2px 2px 0 0; box-shadow: $z-depth-4; // FIXME: rationalize window-frame shadows // this is used for the resize cursor area margin: 8px; &:backdrop { box-shadow: $z-depth-2; } &.maximized, &.tiled { border-radius: 0; transition: none; &.ssd .titlebar { box-shadow: none; } } &.popup { box-shadow: none; } // server-side decorations as used by mutter &.ssd { // just doing borders, wm draws actual shadows // otherwise incorrect shadows are appeared box-shadow: 0 0 0 1px transparent; .titlebar { // revive top-edge highlight border box-shadow: inset 0 1px $highlight_color; } .tiled .titlebar { @extend %tiled_integration; transition: none; } .maximized .titlebar { @extend %maxd_integration; transition: none; } } &.csd { &.popup { border-radius: 2px; box-shadow: $z-depth-3; } &.tooltip { border-radius: 2px; box-shadow: $z-depth-2; } &.message-dialog { border-radius: 2px; box-shadow: $z-depth-4; &:backdrop { box-shadow: $z-depth-2; } } } &.solid-csd { border-radius: 2px 2px 0 0; margin: -1px; background-color: $bg_color; border: none; box-shadow: none; } } // Window manager buttons .csd .header-bar, .csd .titlebar { & .button.titlebutton, &.selection-mode .button.titlebutton { @extend %image_button; &.close, &.minimize, &.maximize { &:hover:backdrop, &:active:backdrop { opacity: 1.0; } > GtkImage { color: transparent; background-size: 16px 16px; background-repeat: no-repeat; background-position: center; } } // raised 'Close' button &.close { > GtkImage { background-image: -gtk-scaled(url("assets/window-close.png"), url("assets/window-close@2.png")); } &:hover { @include button(hover); color: $selected_fg_color; background-color: $destructive_color; > GtkImage { background-image: -gtk-scaled(url("assets/window-close-active.png"), url("assets/window-close-active@2.png")); } } &:active { @include button(active); color: $selected_fg_color; background-color: $selected_bg_color; > GtkImage { background-image: -gtk-scaled(url("assets/window-close-active.png"), url("assets/window-close-active@2.png")); } } } &.minimize { > GtkImage { background-image: -gtk-scaled(url("assets/window-minimize.png"), url("assets/window-minimize@2.png")); } &:hover, &:active { > GtkImage { background-image: -gtk-scaled(url("assets/window-minimize-active.png"), url("assets/window-minimize-active@2.png")); } } } &.maximize { > GtkImage { background-image: -gtk-scaled(url("assets/window-maximize.png"), url("assets/window-maximize@2.png")); } &:hover, &:active { > GtkImage { background-image: -gtk-scaled(url("assets/window-maximize-active.png"), url("assets/window-maximize-active@2.png")); } } } } } .maximized.csd .header-bar, .maximized.csd .titlebar { .button.titlebutton, &.selection-mode .button.titlebutton { &.maximize { > GtkImage { background-image: -gtk-scaled(url("assets/window-unmaximize.png"), url("assets/window-unmaximize@2.png")); } &:hover, &:active { > GtkImage { background-image: -gtk-scaled(url("assets/window-unmaximize-active.png"), url("assets/window-unmaximize-active@2.png")); } } } } } // specific button styling for SSDs .ssd .titlebar { .button.titlebutton { padding: 6px; &.close, &.minimize, &.maximize { // reset styling color: transparent; background-size: 28px 28px; background-repeat: no-repeat; background-position: center; background: none; box-shadow: none; &:backdrop, &:hover:backdrop, &:active:backdrop { color: transparent; } } @each $_class, $_state, $_shadow in ('', '', none), (':hover', '-hover', $z-depth-2), (':active', '-active', $z-depth-2), (':backdrop', '-backdrop', none), (':backdrop:hover', '-backdrop-hover', $z-depth-2), (':backdrop:active', '-backdrop-active', $z-depth-2) { &.close#{$_class} { background-image: -gtk-scaled( url("assets/window-close-ssd#{$_state}.png"), url("assets/window-close-ssd#{$_state}@2.png")); box-shadow: #{$_shadow}; } } @each $_class, $_state in ('', ''), (':hover', '-hover'), (':active', '-active'), (':backdrop', '-backdrop'), (':backdrop:hover', '-backdrop-hover'), (':backdrop:active', '-backdrop-active') { &.minimize#{$_class} { background-image: -gtk-scaled( url("assets/window-minimize-ssd#{$_state}.png"), url("assets/window-minimize-ssd#{$_state}@2.png")); } } @each $_class, $_state in ('', ''), (':hover', '-hover'), (':active', '-active'), (':backdrop', '-backdrop'), (':backdrop:hover', '-backdrop-hover'), (':backdrop:active', '-backdrop-active') { &.maximize#{$_class} { background-image: -gtk-scaled( url("assets/window-maximize-ssd#{$_state}.png"), url("assets/window-maximize-ssd#{$_state}@2.png")); } } } } .maximized.ssd .titlebar { .button.titlebutton { @each $_class, $_state in ('', ''), (':hover', '-hover'), (':active', '-active'), (':backdrop', '-backdrop'), (':backdrop:hover', '-backdrop-hover'), (':backdrop:active', '-backdrop-active') { &.maximize#{$_class} { background-image: -gtk-scaled( url("assets/window-unmaximize-ssd#{$_state}.png"), url("assets/window-unmaximize-ssd#{$_state}@2.png")); } } } } // catch all extend :) %selected_items { background-color: $selected_bg_color; color: $selected_fg_color; &:insensitive { color: $insensitive_selected_fg_color; } &:backdrop { &:insensitive { color: $insensitive_selected_fg_color; } } } .monospace { font-family: Monospace; } /********************** * Touch Copy & Paste * *********************/ // touch selection handlebars for the Popover.osd above .entry.cursor-handle, .cursor-handle { border-style: none; background-color: $accent_color; background-image: none; box-shadow: none; @each $s,$as in ('',''), (':hover','-hover'), (':active','-active') { // no need for insensitive and backdrop &.top#{$s}:dir(ltr), &.bottom#{$s}:dir(rtl) { $_url: 'assets/text-select-start#{$as}#{$asset_suffix}'; -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'), url('#{$_url}@2.png')); padding-left: 0.8em; } &.bottom#{$s}:dir(ltr), &.top#{$s}:dir(rtl) { $_url: 'assets/text-select-end#{$as}#{$asset_suffix}'; -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'), url('#{$_url}@2.png')); padding-right: 0.8em; } &.insertion-cursor#{$s}:dir(ltr), &.insertion-cursor#{$s}:dir(rtl) { $_url: 'assets/slider-horz-scale-has-marks-above#{$as}#{$asset_suffix}'; -gtk-icon-source: -gtk-scaled(url('#{$_url}.png'), url('#{$_url}@2.png')); } } } // Decouple the font of context menus from their entry/textview .context-menu { font: initial; } .touch-selection { font: initial; color: $fg_color; background-color: $base_color; box-shadow: $z-depth-2; &:backdrop { box-shadow: $z-depth-1; } .button { } } // This is used by GtkScrolledWindow, when content is touch-dragged past // boundaries. This draws a box on top of the content, the size changes // programmatically. .overshoot { &.top { @include overshoot(top); } &.bottom { @include overshoot(bottom); } &.left { @include overshoot(left); } &.right { @include overshoot(right); } } // Overflow indication, works similarly to the overshoot, // the size if fixed tho. .undershoot { &.top { @include undershoot(top, $base_color); } &.bottom { @include undershoot(bottom, $base_color); } &.left { @include undershoot(left, $base_color); } &.right { @include undershoot(right, $base_color); } GtkBox > GtkScrlledWindow & { &.top { @include undershoot(top, $bg_color); } &.bottom { @include undershoot(bottom, $bg_color); } &.left { @include undershoot(left, $bg_color); } &.right { @include undershoot(right, $bg_color); } } .sidebar & { &.top { @include undershoot(top, $secondary_dark_color); } &.bottom { @include undershoot(bottom, $secondary_dark_color); } &.left { @include undershoot(left, $secondary_dark_color); } &.right { @include undershoot(right, $secondary_dark_color); } } }