WhiteSur-gtk-theme/src/sass/gtk/_common-4.0.scss

5661 lines
125 KiB
SCSS
Raw Normal View History

2021-05-14 23:11:56 +08:00
//This is the RIGHT PLACE to edit the stylesheet
//let's start by telling people not to edit the generated CSS:
$cakeisalie: "This stylesheet is generated, DO NOT EDIT";
/* #{$cakeisalie} */
2020-07-15 00:35:03 +08:00
2024-07-18 23:38:12 +08:00
$side_style_shadow: linear-gradient(to left, rgba(black, if($variant == 'light', 0.02, 0.06)), transparent 6px);
%side_style_left {
background-image: $side_style_shadow;
background-color: rgba($dark_sidebar_bg, 1);
box-shadow: none;
border: none;
}
2021-04-09 20:03:06 +08:00
%side_headerbar_left {
2022-10-09 16:02:36 +08:00
&, &:backdrop {
2024-07-18 23:38:12 +08:00
background-image: $side_style_shadow;
2022-10-09 16:02:36 +08:00
background-color: rgba($dark_sidebar_bg, 1);
border: none;
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
%side_headerbar_right {
2022-10-09 16:02:36 +08:00
&, &:backdrop {
background-image: none;
background-color: rgba($base_color, 1);
2024-07-18 23:38:12 +08:00
border: none;
2022-10-09 16:02:36 +08:00
}
2021-04-09 20:03:06 +08:00
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
%side_searchbar {
> revealer > box {
2021-05-14 23:11:56 +08:00
background-color: rgba($dark_sidebar_bg, 1);
border-color: $dark_sidebar_border;
2021-03-13 21:15:50 +08:00
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
%side_separator {
&, &:backdrop {
background-image: if($variant == 'light', image($solid_borders_color), image($header_border));
background-color: transparent;
border-right: none;
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
$list_shadow: if($variant == 'light',
2024-03-29 00:51:46 +08:00
(inset 0 0 0 1px rgba(black, 0.04), inset 0 1px rgba(black, 0.05)),
(inset 0 0 0 1px rgba(white, 0.04), inset 0 1px rgba(white, 0.06)));
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
%circular_list {
2023-10-13 06:36:42 +08:00
border-radius: $bd_radius;
2021-04-09 20:03:06 +08:00
box-shadow: $list_shadow;
background-color: if($variant == 'light', rgba(black, 0.03), rgba(white, 0.05));
border: none;
2022-05-05 17:53:22 +08:00
color: $text_color;
2020-07-15 00:35:03 +08:00
2023-10-13 06:36:42 +08:00
> separator {
2023-10-13 07:00:27 +08:00
min-height: 0;
background-color: transparent;
2023-10-13 06:36:42 +08:00
}
2021-04-09 20:03:06 +08:00
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
%circular_row {
2021-11-28 11:53:51 +08:00
border: none;
2021-04-09 20:03:06 +08:00
&:first-child {
2023-10-13 06:36:42 +08:00
border-top-left-radius: $bd_radius;
border-top-right-radius: $bd_radius;
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
&:last-child { // Not use ?
2023-10-13 06:36:42 +08:00
border-bottom-left-radius: $bd_radius;
border-bottom-right-radius: $bd_radius;
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
&:only-child {
2023-10-13 06:36:42 +08:00
border-radius: $bd_radius;
}
2023-10-13 07:27:31 +08:00
& + row {
2023-10-13 06:36:42 +08:00
border-top: 1px solid transparent;
border-image: linear-gradient(to right,
transparent 0%,
transparent 2%,
$menu_bd 2%,
$menu_bd 98%,
transparent 98%,
transparent 100%) 1 0 0 0 / 1px 0 0 0 stretch;
2020-07-15 00:35:03 +08:00
}
2023-10-13 07:27:31 +08:00
&:hover, &:active, &:selected {
&, & + row {
border-image: none;
}
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
%sidebar_row {
margin: 2px 4px;
2023-10-13 06:36:42 +08:00
border-radius: $bd_radius;
-gtk-outline-radius : $bd_radius - 2px;
2021-05-14 23:11:56 +08:00
}
// catch all extend
%selected_items {
background-color: $selected_bg_color;
color: $selected_fg_color;
2024-10-30 18:05:53 +08:00
&:disabled {
@if $gnome_version == 'old' {
color: mix($selected_fg_color, $selected_bg_color, 50%);
} @else {
color: color-mix(in srgb, $selected_fg_color 50%, $selected_bg_color);
}
}
2021-05-14 23:11:56 +08:00
}
%nobg_selected_items {
color: $selected_fg_color;
2024-10-30 18:05:53 +08:00
&:disabled {
@if $gnome_version == 'old' {
color: mix($selected_fg_color, $selected_bg_color, 50%);
} @else {
color: color-mix(in srgb, $selected_fg_color 50%, $selected_bg_color);
}
}
2021-05-14 23:11:56 +08:00
}
%linked_middle {
border-radius: 0;
border-right-style: none;
}
%linked {
border-radius: 0;
border-right-style: none;
&:first-child {
border-top-left-radius: $bt_radius;
border-bottom-left-radius: $bt_radius;
}
2023-10-13 07:00:27 +08:00
2021-05-14 23:11:56 +08:00
&:last-child {
border-top-right-radius: $bt_radius;
border-bottom-right-radius: $bt_radius;
border-right-style: solid;
}
2023-10-13 07:00:27 +08:00
2021-05-14 23:11:56 +08:00
&:only-child {
border-radius: $bt_radius;
border-style: solid;
}
}
%linked_vertical_middle {
border-radius: 0;
border-bottom-style: none;
}
%linked_vertical{
border-radius: 0;
border-bottom-style: none;
2023-10-13 07:00:27 +08:00
2021-05-14 23:11:56 +08:00
&:first-child {
border-top-left-radius: $bt_radius;
border-top-right-radius: $bt_radius;
}
2023-10-13 07:00:27 +08:00
2021-05-14 23:11:56 +08:00
&:last-child {
border-bottom-left-radius: $bt_radius;
border-bottom-right-radius: $bt_radius;
border-bottom-style: solid;
}
2023-10-13 07:00:27 +08:00
2021-05-14 23:11:56 +08:00
&:only-child {
border-radius: $bt_radius;
border-style: solid;
}
}
%undecorated_button {
border-color: transparent;
background-color: transparent;
background-image: none;
box-shadow: none;
}
// Buttons on selected backgrounds
%selected-button {
color: $selected_fg_color;
background-color: transparentize($selected_fg_color, 1);
border-color: transparentize($selected_fg_color, 0.5);
background-image: none;
box-shadow: none;
&.flat {
@include button(undecorated);
color: $selected_fg_color;
background-color: transparentize($selected_fg_color, 1);
background-image: none;
}
&.flat:disabled {
&, label { color: transparentize($selected_fg_color, 0.6); }
}
&:hover {
color: $selected_fg_color;
background-color: transparentize($selected_fg_color, 0.8);
border-color: transparentize($selected_fg_color, 0.5);
box-shadow: none;
}
&:active, &:active:hover, &:checked {
color: $selected_fg_color;
background-color: transparentize($selected_fg_color, 0.6);
border-color: transparentize($selected_fg_color, 0.5);
box-shadow: none;
}
&:disabled {
&, label { color: transparentize($selected_fg_color, 0.5); }
background-color: transparentize($selected_fg_color, 1);
border-color: transparentize($selected_fg_color, 0.6);
box-shadow: none;
}
&:disabled:active, &:disabled:checked {
color: $selected_bg_color;
background-color: transparentize($selected_fg_color, 0.5);
border-color: transparentize($selected_fg_color, 0.6);
}
}
%normal_selected_button {
color: $selected_fg_color;
background-color: transparentize($selected_fg_color, 1);
border-color: transparentize($selected_fg_color, 0.5);
background-image: none;
2021-01-22 14:57:44 +08:00
}
2021-04-09 20:03:06 +08:00
//
// Base States
//
.background {
color: $fg_color;
background-color: rgba($bg_color, 1);
2021-01-22 14:57:44 +08:00
2021-04-09 20:03:06 +08:00
// > box > stack { background-color: $bg_color; }
2021-01-22 14:57:44 +08:00
2021-04-09 20:03:06 +08:00
&.csd {
border-radius: $wm_radius; // Set csd windows botttom border radius
2021-01-22 14:57:44 +08:00
2021-04-09 20:03:06 +08:00
&.maximized, &.tiled, &.fullscreen {
border-radius: $maximized_radius; // Set csd windows botttom border radius
}
2021-01-22 14:57:44 +08:00
}
2021-04-09 20:03:06 +08:00
&.solid-csd { border-radius: 0; }
2021-01-22 14:57:44 +08:00
}
2021-04-09 20:03:06 +08:00
dnd {
color: $fg_color;
2021-01-22 14:57:44 +08:00
}
2021-04-09 20:03:06 +08:00
.normal-icons {
-gtk-icon-size: 16px;
}
2021-01-22 14:57:44 +08:00
2021-04-09 20:03:06 +08:00
.large-icons {
-gtk-icon-size: 32px;
2021-01-22 14:57:44 +08:00
}
2021-04-09 20:03:06 +08:00
spinner:disabled,
arrow:disabled,
scrollbar:disabled,
check:disabled,
radio:disabled,
treeview.expander:disabled { -gtk-icon-filter: opacity(0.5); }
2020-07-15 00:35:03 +08:00
%view, .view {
color: $text_color;
background-color: $base_color;
transition: all 200ms $ease-out-quad;
2021-04-09 20:03:06 +08:00
// &:hover { background-color: if($variant=='light', darken($base_color, 3%), lighten($base_color, 3%)); }
2020-07-15 00:35:03 +08:00
&:selected {
color: $selected_fg_color;
background-color: $selected_bg_color;
transition: all 350ms $ease-out-quad;
&:focus {
@extend %selected_items;
}
}
}
textview {
background-color: $base_color; // This will get overridden by .view, needed by gedit line numbers
2021-04-09 20:03:06 +08:00
> text {
2020-07-15 00:35:03 +08:00
background-color: $base_color;
// @extend %view;
selection { &:focus, & { @extend %selected_items; }}
}
border {
background-color: mix($bg_color, $base_color, 50%);
}
2021-04-09 20:03:06 +08:00
&:drop(active) {
caret-color: $drop_target_color;
}
2020-07-15 00:35:03 +08:00
}
iconview {
@extend %view;
&, &:hover, &:selected { border-radius: $bt_radius; }
}
%rubberband,
2021-04-09 20:03:06 +08:00
rubberband {
2024-10-30 18:05:53 +08:00
@if $gnome_version == 'old' {
border: 1px solid darken($selected_bg_color, 10%);
background-color: transparentize(darken($selected_bg_color, 10%), 0.8);
} @else {
border: 1px solid color-mix(in srgb, black 10%, $selected_bg_color);
background-color: RGB(color-mix(in srgb, black 10%, $selected_bg_color), 80%);
}
2020-07-15 00:35:03 +08:00
}
flowbox {
2021-04-09 20:03:06 +08:00
> rubberband { @extend %rubberband; }
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> flowboxchild {
2020-07-15 00:35:03 +08:00
padding: 3px;
border-radius: $bt_radius;
&:selected {
@extend %selected_items;
outline-offset: -2px;
}
}
&.search-bar { border-bottom: 1px solid $header_border; }
}
2021-04-09 20:03:06 +08:00
gridview {
> rubberband { @extend rubberband; }
> child {
padding: 3px;
&:selected {
2024-10-30 18:05:53 +08:00
@if $gnome_version == 'old' {
outline-color: darken($selected_bg_color, 15%);
} @else {
outline-color: color-mix(in srgb, black 15%, $selected_bg_color);
}
2021-04-09 20:03:06 +08:00
@extend %selected_items;
}
box { //cells
border-spacing: 8px; //label separation
margin: 12px;
}
}
}
coverflow cover {
color: $text_color;
background-color: $base_color;
border: 1px solid black;
}
2021-05-14 23:11:56 +08:00
%dim-label, .dim-label {
opacity: 0.55;
text-shadow: none;
}
2020-07-15 00:35:03 +08:00
label {
&.separator {
@extend %dim-label;
color: $fg_color;
}
2021-04-09 20:03:06 +08:00
> selection {
2020-07-15 00:35:03 +08:00
color: $selected_fg_color;
background-color: $selected_bg_color;
}
&:disabled {
2022-10-09 16:02:36 +08:00
opacity: 1;
2020-07-15 00:35:03 +08:00
color: $disabled_fg_color;
2023-10-13 06:36:42 +08:00
2024-10-30 18:05:53 +08:00
selection {
@if $gnome_version == 'old' {
color: mix($selected_fg_color, $selected_bg_color, 50%);
} @else {
color: color-mix(in srgb, $selected_fg_color 50%, $selected_bg_color);
}
}
2020-07-15 00:35:03 +08:00
}
}
2022-04-17 22:49:54 +08:00
.accent {
color: $selected_bg_color;
}
.success {
color: $success_color;
}
.warning {
color: $warning_color;
}
.error {
color: $error_color;
}
2021-04-09 20:03:06 +08:00
window.assistant {
2020-07-15 00:35:03 +08:00
.sidebar {
background-color: $base_color;
}
&.csd .sidebar { border-top-style: none; }
2021-05-15 13:02:37 +08:00
.sidebar > label { padding: $container_padding $container_padding * 2; }
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
.sidebar > label.highlight {
2020-07-15 00:35:03 +08:00
background-color: $selected_bg_color;
color: $selected_fg_color;
}
}
2021-04-09 20:03:06 +08:00
%osd {
2020-07-15 00:35:03 +08:00
color: $osd_fg_color;
border: none;
background-color: $osd_bg_color;
background-clip: padding-box;
2021-04-09 20:03:06 +08:00
border-radius: $bt_radius;
}
.osd {
@extend %osd;
padding: $container_padding;
margin: $container_padding;
box-shadow: 0 3px 8px rgba(black, 0.35);
&.circular { border-radius: 100%; }
2020-07-15 00:35:03 +08:00
}
//
// Spinner Animations
//
@keyframes spin {
2021-04-09 20:03:06 +08:00
to { transform: rotate(1turn); }
2020-07-15 00:35:03 +08:00
}
spinner {
background: none;
opacity: 0; // non spinning spinner makes no sense
-gtk-icon-source: -gtk-icontheme('process-working-symbolic');
&:checked {
opacity: 1;
animation: spin 1s linear infinite;
&:disabled {
opacity: 0.5;
}
}
}
2020-12-26 09:04:47 +08:00
// General Typography
.large-title {
font-weight: 300;
font-size: 24pt;
}
2021-04-09 20:03:06 +08:00
.title {
&-1 {
font-weight: 800;
font-size: 20pt;
}
2020-12-26 09:04:47 +08:00
2021-04-09 20:03:06 +08:00
&-2 {
font-weight: 800;
font-size: 15pt;
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&-3 {
font-weight: 700;
font-size: 15pt;
}
2020-12-26 09:04:47 +08:00
2021-04-09 20:03:06 +08:00
&-4 {
font-weight: 700;
font-size: 13pt;
}
2020-12-26 09:04:47 +08:00
}
.heading {
font-weight: 700;
font-size: 11pt;
}
.body {
font-weight: 400;
font-size: 11pt;
}
.caption {
font-weight: 400;
font-size: 9pt;
2021-04-09 20:03:06 +08:00
&-heading {
font-weight: 700;
font-size: 9pt;
}
2020-12-26 09:04:47 +08:00
}
2022-04-17 22:49:54 +08:00
.numeric {
font-feature-settings: "tnum";
}
2020-12-26 09:04:47 +08:00
//
// Text Entries
//
2020-07-15 00:35:03 +08:00
%Linked_entrys {
@include entry(normal);
border: none;
&:focus {
@include entry(focus);
}
&:disabled {
@include entry(insensitive);
}
}
2021-04-09 20:03:06 +08:00
%entry,
2020-07-15 00:35:03 +08:00
entry {
2021-05-15 13:02:37 +08:00
min-height: $menuitem_size - 4px;
2020-07-15 00:35:03 +08:00
border: none;
2021-05-15 13:02:37 +08:00
padding: 2px $container_padding + 2px;
2020-07-15 00:35:03 +08:00
border-radius: $bt_radius;
caret-color: currentColor;
2022-05-05 17:53:22 +08:00
transition: all 300ms $ease-out-quad;
animation-timing-function: ease-in-out;
2020-07-15 00:35:03 +08:00
&.search { border-radius: $bt_radius; }
@include entry(normal);
2021-04-09 20:03:06 +08:00
> image { // icons inside the entry
2020-07-15 00:35:03 +08:00
color: mix($fg_color, $base_color, 80%);
2024-08-17 20:25:49 +08:00
&:first-child { padding-left: 0; padding-right: $container_padding; }
&:last-child { padding-right: 0; padding-left: $container_padding; }
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
> text > placeholder {
@extend .dim-label;
}
2020-07-15 00:35:03 +08:00
@at-root %flat_entry, &.flat {
2021-04-09 20:03:06 +08:00
&:focus-within, &:backdrop, &:disabled, &:backdrop:disabled, & {
2020-07-15 00:35:03 +08:00
min-height: 0;
background-image: none;
border-color: transparent;
border-radius: 0;
}
}
2020-07-23 10:11:42 +08:00
&:hover {
@include entry(hover);
}
2021-04-09 20:03:06 +08:00
&:focus-within {
2020-07-15 00:35:03 +08:00
@include entry(focus);
2021-04-09 20:03:06 +08:00
> placeholder {
opacity: 0; // We hide placeholders on focus
}
2020-07-15 00:35:03 +08:00
}
&:disabled {
@include entry(insensitive);
}
2021-04-09 20:03:06 +08:00
> text > selection { @extend %selected_items; }
2020-07-15 00:35:03 +08:00
// error and warning style
@each $e_type, $e_color, $e_fg_color in (warning, $warning_color, $light_fg_color),
(error, $error_color, $light_fg_color),
(search-missing, $error_color, $light_fg_color) { // entry.search-missing for Gnome-Builder
&.#{$e_type} {
color: $e_fg_color;
background-color: mix($e_color, $base_color, 60%);
border-image: none;
image { color: $e_fg_color; }
2021-04-09 20:03:06 +08:00
&:focus-within {
2020-07-15 00:35:03 +08:00
color: $e_fg_color;
background-color: $e_color;
box-shadow: none;
}
2021-04-09 20:03:06 +08:00
> selection {
2020-07-15 00:35:03 +08:00
background-color: $e_fg_color;
color: $e_color;
}
}
}
&:drop(active) {
&:focus, & {
border-color: $drop_target_color;
box-shadow: none;
border-image: none;
}
}
.osd & {
@include entry(osd);
border-image: none;
&:focus { @include entry(osd-focus); border-image: none; }
&:disabled { @include entry(osd-insensitive); border-image: none; }
selection {
&:focus, & {
color: $selected_bg_color;
background-color: $selected_fg_color;
}
}
}
2021-04-09 20:03:06 +08:00
> progress {
2020-07-15 00:35:03 +08:00
margin: 0 -6px;
border-radius: 0;
border-width: 0 0 2px;
border-color: $progress_color;
border-style: solid;
background-image: none;
background-color: transparent;
box-shadow: none;
}
2021-04-09 20:03:06 +08:00
progress > trough > progress {
background-color: transparent;
background-image: none;
border-radius: 0;
border-width: 0 0 2px;
border-color: $progress_color;
border-style: solid;
box-shadow: none;
}
2020-07-15 00:35:03 +08:00
// linked entries
.linked:not(.vertical) > &,
2021-04-09 20:03:06 +08:00
.linked:not(.vertical) > &:focus-within {
2020-07-15 00:35:03 +08:00
@extend %linked;
min-height: 20px;
}
.linked.vertical > &,
2021-04-09 20:03:06 +08:00
.linked.vertical > &:focus-within {
2020-07-15 00:35:03 +08:00
@extend %linked_vertical;
}
.linked > &:not(:only-child) {
@extend %Linked_entrys;
}
.linked:not(.vertical) > & + button.combo { padding-left: 0; }
.linked.vertical > & + button.combo { padding: 0; }
}
.entry-tag {
2022-10-09 17:27:14 +08:00
margin: 0;
min-height: 16px;
border-radius: $circular_radius;
2020-07-15 00:35:03 +08:00
box-shadow: none;
2022-10-09 17:27:14 +08:00
background-color: $suggested_color;
2020-07-15 00:35:03 +08:00
color: $light_fg_color;
border: none;
2022-10-09 17:27:14 +08:00
padding: 2px;
2020-07-15 00:35:03 +08:00
2022-10-09 17:27:14 +08:00
&:hover { box-shadow: $shadow_4; }
2020-07-15 00:35:03 +08:00
// side margins: compensate the entry padding with a negative margin
// then the negative margin itself
:dir(ltr) & {
2022-10-09 17:27:14 +08:00
margin-left: $container_padding / 2;
margin-right: 0;
2020-07-15 00:35:03 +08:00
}
:dir(rtl) & {
2022-10-09 17:27:14 +08:00
margin-left: 0;
margin-right: $container_padding / 2;
2020-07-15 00:35:03 +08:00
}
// seems any sizing doesn't work
2022-10-09 17:27:14 +08:00
> button {
min-height: 20px;
min-width: 20px;
padding: 0;
border-radius: $circular_radius;
@extend %selected-button;
2020-07-15 00:35:03 +08:00
}
}
2021-04-09 20:03:06 +08:00
treeview entry {
&:focus-within {
&:dir(rtl), &:dir(ltr) { // specificity bump hack
background-color: $base_color;
transition-property: color, background;
}
}
&.flat, & {
border-radius: 0;
background-image: none;
background-color: $base_color;
&:focus-within { border-color: $selected_bg_color; }
}
}
// Editable Labels
editablelabel > stack > text {
@include entry(normal);
}
2020-07-15 00:35:03 +08:00
//
// Buttons
//
// stuff for .needs-attention
2024-10-30 18:05:53 +08:00
$_dot_color: '';
@if $gnome_version == 'old' {
$_dot_color: if($variant=='light', $selected_bg_color, lighten($selected_bg_color, 15%));
} @else {
$_dot_color: if($variant=='light', $selected_bg_color, color-mix(in srgb, white 15%, $selected_bg_color));
}
2020-07-15 00:35:03 +08:00
@keyframes needs_attention {
2024-10-30 18:05:53 +08:00
from { background-image: radial-gradient(farthest-side, $_dot_color 0%, $_dot_color 0%); }
to { background-image: radial-gradient(farthest-side, $_dot_color 95%, $_dot_color); }
2021-04-09 20:03:06 +08:00
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
%needs_attention {
// the dot is drawn by using two radial gradient, the first one is the actual dot, the other
// simulates the shadow labels and icons normally have in buttons.
animation: needs_attention 150ms ease-in;
2024-10-30 18:05:53 +08:00
background-image: radial-gradient(farthest-side, $_dot_color 96%, $_dot_color);
2021-04-09 20:03:06 +08:00
background-size: 6px 6px, 6px 6px;
background-repeat: no-repeat;
@if $variant == 'light' { background-position: right 3px, right 4px; }
@else { background-position: right 3px, right 2px; }
&:backdrop { background-size: 6px 6px, 0 0;}
&:dir(rtl) {
@if $variant == 'light' { background-position: left 3px, left 4px; }
@else { background-position: left 3px, left 2px; }
2020-07-15 00:35:03 +08:00
}
}
2020-12-22 17:38:59 +08:00
%flat_button {
@include button(flat-normal);
&:hover { @include button(flat-hover); }
&:active { @include button(flat-active); }
2022-10-09 16:02:36 +08:00
&:checked, &:selected { @include button(flat-checked); }
2020-12-22 17:38:59 +08:00
&:disabled { @include button(flat-insensitive); }
}
2022-04-17 22:49:54 +08:00
%opaque_button {
box-shadow: none;
transition: $button_transition;
.osd &:focus:focus-visible {
outline-color: rgba(white, 0.15)
}
&:hover {
background-image: image(gtkalpha(currentColor, .1));
}
&.keyboard-activating,
&:active {
background-image: image(transparentize(black, .8));
}
&:checked {
background-image: image(transparentize(black, .85));
&:hover {
background-image: image(transparentize(black, .95));
}
&.keyboard-activating,
&:active {
background-image: image(transparentize(black, .7));
}
}
}
2021-04-09 20:03:06 +08:00
%button,
2020-07-15 00:35:03 +08:00
button {
2024-06-19 18:50:25 +08:00
@at-root %button_basic, & {
min-height: $menuitem_size - 4px;
min-width: $menuitem_size - 10px;
transition: $button_transition;
border: 1px solid;
border-radius: $bt_radius;
padding: 0 $container_padding + 2px;
background-clip: if($variant=='light', border-box, padding-box);
@include button(normal);
&:hover {
@include button(hover);
background-clip: if($variant=='light', border-box, padding-box);
-gtk-icon-filter: brightness(1.2);
}
&.keyboard-activating, &:active, &:checked {
@include button(active);
background-clip: if($variant=='light', border-box, padding-box);
transition-duration: 200ms;
&:not(:disabled) label:disabled { color: inherit; opacity: 0.6; }
}
&:disabled {
@include button(insensitive);
background-clip: if($variant=='light', border-box, padding-box);
&:active, &:checked {
@include button(insensitive-active);
background-clip: if($variant=='light', border-box, padding-box);
}
}
}
2020-07-15 00:35:03 +08:00
separator { margin: 4px 1px; }
2020-12-22 17:38:59 +08:00
&.flat {
@extend %flat_button;
2021-05-15 13:02:37 +08:00
min-height: $menuitem_size - 4px;
2020-07-15 00:35:03 +08:00
transition: none;
&:hover {
transition: $button_transition;
transition-duration: 350ms;
&:active { transition: $button_transition; }
}
&:checked:hover { background-image: none; }
&.toggle.popup {
2021-05-15 13:02:37 +08:00
min-width: $menuitem_size - 8px;
2020-07-15 00:35:03 +08:00
}
}
2022-04-17 22:49:54 +08:00
&.opaque {
@extend %opaque_button;
background-color: mix($bg_color, $fg_color, 80%);
color: $fg_color;
}
2020-07-15 00:35:03 +08:00
&.image-button {
2021-05-15 13:02:37 +08:00
min-height: $menuitem_size - 4px;
padding-left: $container_padding;
padding-right: $container_padding;
2020-07-15 00:35:03 +08:00
}
&.text-button {
2021-05-15 13:02:37 +08:00
min-height: $menuitem_size - 4px;
padding-left: $container_padding * 2;
padding-right: $container_padding * 2;
2020-07-15 00:35:03 +08:00
}
2022-04-17 22:49:54 +08:00
&.text-button.image-button,
&.image-text-button {
2021-05-15 13:02:37 +08:00
min-height: $menuitem_size - 4px;
padding-left: $container_padding;
padding-right: $container_padding;
2020-07-15 00:35:03 +08:00
2022-04-17 22:49:54 +08:00
> box,
> box > box {
border-spacing: $container_padding - 2px;
> label {
padding-left: 2px;
padding-right: 2px;
}
}
2020-07-15 00:35:03 +08:00
label {
&:first-child {
2021-05-15 13:02:37 +08:00
padding-left: $container_padding + 2;
padding-right: $container_padding / 2;
2020-07-15 00:35:03 +08:00
}
&:last-child {
2021-05-15 13:02:37 +08:00
padding-right: $container_padding + 2;
padding-left: $container_padding / 2;
2020-07-15 00:35:03 +08:00
}
&:only-child {
2021-05-15 13:02:37 +08:00
padding-left: $container_padding + 2px;
padding-right: $container_padding + 2px;
2020-07-15 00:35:03 +08:00
}
}
2021-05-15 13:02:37 +08:00
&.popup { padding-right: $container_padding; padding-left: $container_padding; }
2020-07-15 00:35:03 +08:00
}
2022-04-17 22:49:54 +08:00
&.arrow-button {
padding-left: $container_padding * 1.5;
padding-right: $container_padding * 1.5;
> box { border-spacing: $container_padding - 2px; }
&.text-button {
> box { border-spacing: $container_padding - 2px; }
}
}
// hide separators
&.font {
separator { background-color: transparent; background-image: none; }
> box { border-spacing: $container_padding; }
> box > box > label { font-weight: bold; }
}
@at-root %circular_button, &.circular, &.close { // The Bloody Circul Button
2021-05-14 23:56:56 +08:00
border-radius: $circular_radius;
2022-04-17 22:49:54 +08:00
padding: 0;
2021-05-14 23:56:56 +08:00
min-height: $menuitem_size;
min-width: $menuitem_size;
2022-04-17 22:49:54 +08:00
label { padding: 0; }
2021-05-14 23:56:56 +08:00
&:active, &:checked {
@if $variant=='light' {
@include button(flat-active);
border-color: rgba(black, 0.2);
}
}
2020-07-15 00:35:03 +08:00
}
2022-04-17 22:49:54 +08:00
@at-root %pill_button,
&.pill {
2024-04-19 19:44:17 +08:00
min-height: $menuitem_size - 4px;
min-width: $menuitem_size - 4px;
padding: $container_padding;
2022-04-17 22:49:54 +08:00
border-radius: $circular_radius;
2024-04-24 10:54:19 +08:00
2024-10-30 22:58:06 +08:00
&.text-button, &.image-text-button {
2024-04-24 10:54:19 +08:00
padding-left: $container_padding * 3;
padding-right: $container_padding * 3;
}
2022-04-17 22:49:54 +08:00
}
&.card {
background-color: $fill_color;
background-clip: padding-box;
font-weight: inherit;
2022-05-05 17:53:22 +08:00
padding: $container_padding;
2022-04-17 22:49:54 +08:00
transition: $button_transition;
&:hover {
background-image: image(gtkalpha(currentColor, 0.03));
}
&.keyboard-activating,
&:active {
background-image: image(gtkalpha(currentColor, 0.08));
}
&:checked {
background-color: $fill_color;
background-image: image(gtkalpha(currentColor, 0.1));
&:hover { background-image: image(gtkalpha(currentColor, 0.13)); }
&.keyboard-activating,
&:active { background-image: image(gtkalpha(currentColor, 0.19)); }
&.has-open-popup { background-image: image(gtkalpha(currentColor, 0.13)); }
}
&:drop(active) {
color: $drop_target_color;
box-shadow: inset 0 0 0 1px $drop_target_color;
}
}
2021-04-09 20:03:06 +08:00
@at-root %button_basic_drop_active,
2020-07-15 00:35:03 +08:00
&:drop(active) {
color: $drop_target_color;
border-color: $drop_target_color;
2021-04-09 20:03:06 +08:00
box-shadow: inset 0 0 0 1px $drop_target_color;
2020-07-15 00:35:03 +08:00
}
// big standalone buttons like in Documents pager
&.osd {
2023-10-13 06:36:42 +08:00
color: white;
background-color: rgba(black, 0.65);
border: none;
2022-05-05 17:53:22 +08:00
box-shadow: none;
2020-07-15 00:35:03 +08:00
&.image-button {
2024-01-18 00:01:43 +08:00
padding: 3px;
2023-10-13 06:36:42 +08:00
min-height: 28px;
min-width: 28px;
2024-01-18 00:01:43 +08:00
&.remove-button {
padding: 0;
}
2023-10-13 06:36:42 +08:00
}
2020-10-11 11:40:05 +08:00
&:hover {
2023-10-13 06:36:42 +08:00
color: white;
background-color: rgba(black, 0.75);
2020-10-11 11:40:05 +08:00
box-shadow: none;
}
2023-10-13 06:36:42 +08:00
&.keyboard-activating, &:active, &:checked {
color: white;
background-color: rgba(black, 0.85);
}
&:disabled {
opacity: 0.35;
}
2020-07-15 00:35:03 +08:00
}
//overlay / OSD style
2021-04-09 20:03:06 +08:00
@at-root %osd_button,
2020-07-15 00:35:03 +08:00
.osd & {
@include button(osd);
&:hover { @include button(osd-hover); }
2022-04-17 22:49:54 +08:00
&.keyboard-activating, &:active, &:checked { @include button(osd-active); }
2020-07-15 00:35:03 +08:00
&:disabled { @include button(osd-insensitive); }
&.flat {
@include button(undecorated);
box-shadow: none;
&:hover { @include button(osd-hover); }
&:disabled {
@include button(osd-insensitive);
background-image: none;
}
&:active, &:checked { @include button(osd-active); }
}
}
.osd .linked:not(.vertical):not(.path-bar) > &:hover:not(:checked):not(:active):not(:only-child),
.osd .linked:not(.vertical):not(.path-bar) > &:hover:not(:checked):not(:active) + &:not(:checked):not(:active) { box-shadow: none; }
// Suggested and Destructive Action buttons
@each $b_type, $b_color, $b_fg in (suggested-action, $suggested_color, $light_fg_color),
(destructive-action, $destructive_color, $light_fg_color) {
&.#{$b_type} {
@include button(suggested_destructive, $b_color, $b_fg);
&.flat {
@include button(undecorated);
color: $b_color;
}
&:hover {
@include button(suggested_destructive, lighten($b_color, 5%), $b_fg);
}
&:active, &:checked {
2022-05-05 17:53:22 +08:00
@include button(suggested_destructive, darken($b_color, 5%), $b_fg);
2020-07-15 00:35:03 +08:00
box-shadow: none;
}
&.flat:disabled {
@include button(undecorated);
color: $disabled_fg_color;
}
&:disabled { @include button(insensitive); }
}
}
2021-04-12 17:34:20 +08:00
stackswitcher > & {
2020-07-15 00:35:03 +08:00
// 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: -3px; // needs to be set or it gets overridden by GtkRadioButton outline-offset
> label {
2021-05-15 13:02:37 +08:00
padding-left: $container_padding; // label padding
padding-right: $container_padding; //
2020-07-15 00:35:03 +08:00
}
2022-05-05 17:53:22 +08:00
2020-07-15 00:35:03 +08:00
> image {
2021-05-15 13:02:37 +08:00
padding-left: $container_padding;
padding-right: $container_padding;
2020-07-15 00:35:03 +08:00
}
2022-05-05 17:53:22 +08:00
2020-07-15 00:35:03 +08:00
&.text-button {
2021-05-15 13:02:37 +08:00
padding-left: $container_padding + 4px;
padding-right: $container_padding + 4px;
2020-07-15 00:35:03 +08:00
}
2022-05-05 17:53:22 +08:00
2020-07-15 00:35:03 +08:00
&.image-button {
padding-left: 2px;
padding-right: 2px;
}
&.needs-attention {
> label, > image { @extend %needs_attention; }
&:active, &:checked {
> label, > image {
animation: none;
background-image: none;
}
}
}
}
// hide separators
&.font,
&.file { separator { background-color: transparent; }}
.linked:not(.vertical) > & { @extend %linked; }
.linked.vertical > & { @extend %linked_vertical; }
}
2022-04-17 22:49:54 +08:00
menubutton {
2022-05-05 17:53:22 +08:00
margin: 0;
2022-04-17 22:49:54 +08:00
&.osd {
background: none;
color: inherit;
> button { @extend %osd_button; }
}
&.circular > button { @extend %circular_button; }
&.flat > button { @extend %flat_button; }
&.pill > button { @extend %pill_button; }
&.suggested-action {
background-color: $suggested_color;
color: white;
}
&.destructive-action {
background-color: $destructive_color;
color: white;
}
&.opaque {
background-color: mix($bg_color, $fg_color, 80%);
color: $fg_color;
}
&.suggested-action,
&.destructive-action,
&.opaque {
border-radius: $bt_radius;
&.circular, &.pill {
border-radius: $circular_radius;
}
> button {
@extend %flat_button;
&, &:checked {
background-color: transparent;
color: inherit;
}
}
}
&.image-button > button {
min-width: 24px;
padding-left: 5px;
padding-right: 5px;
}
arrow {
min-height: 16px;
min-width: 16px;
&.none {
-gtk-icon-source: -gtk-icontheme('open-menu-symbolic');
}
&.down {
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
}
&.up {
-gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
}
&.left {
-gtk-icon-source: -gtk-icontheme('pan-start-symbolic');
}
&.right {
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
}
}
2022-05-05 17:53:22 +08:00
.linked > &:not(:only-child) > button {
@extend %linked_middle;
}
.linked > &:first-child > button {
border-top-left-radius: $bt_radius;
border-bottom-left-radius: $bt_radius;
}
.linked > &:last-child > button {
border-top-right-radius: $bt_radius;
border-bottom-right-radius: $bt_radius;
}
2022-04-17 22:49:54 +08:00
}
splitbutton {
border-radius: $bt_radius;
&, & > separator {
transition: $button_transition;
transition-property: background;
}
> separator {
margin-top: $container_padding;
margin-bottom: $container_padding;
background: none;
}
> menubutton > button {
padding-left: $container_padding - 2px;
padding-right: $container_padding - 2px;
}
// Since the inner button doesn't have any style classes on it,
// we have to add them manually
&.image-button > button {
min-width: 24px;
padding-left: $container_padding;
padding-right: $container_padding;
}
&.text-button.image-button > button,
&.image-text-button > button {
padding-left: $container_padding * 1.5;
padding-right: $container_padding * 1.5;
> box {
border-spacing: $container_padding;
}
}
// Reimplementing linked so we don't blow up css
> button:dir(ltr),
> menubutton > button:dir(rtl) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
margin-right: -1px;
}
> button:dir(rtl),
> menubutton > button:dir(ltr) {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
margin-left: -1px;
}
@at-root %flat_split_button,
&.flat {
> separator {
background: $borders_color;
}
&:hover,
&:active,
&:checked {
background: gtkalpha(currentColor, 0.07);
> separator {
background: none;
}
}
&:focus-within:focus-visible > separator {
background: none;
}
> button,
> menubutton > button {
@extend %flat_button;
border-radius: $bt_radius;
}
}
&.suggested-action {
background-color: $suggested_color;
color: white;
}
&.destructive-action {
background-color: $destructive_color;
color: white;
}
&.opaque {
background-color: mix($bg_color, $fg_color, 80%);
color: $fg_color;
}
&.suggested-action,
&.destructive-action,
&.opaque {
> button, > menubutton > button {
@extend %flat_button;
&, &:checked {
color: inherit;
background-color: transparent;
}
}
> menubutton > button {
&:dir(ltr) { box-shadow: inset 1px 0 $borders_color; }
&:dir(rtl) { box-shadow: inset -1px 0 $borders_color; }
}
}
> menubutton > button > arrow.none {
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
}
}
buttoncontent {
border-spacing: $container_padding;
> label {
font-weight: bold;
&:dir(ltr) { padding-right: 2px; }
&:dir(rtl) { padding-left: 2px; }
}
.arrow-button > box > &,
splitbutton > button > & {
> label {
&:dir(ltr) { padding-right: 0; }
&:dir(rtl) { padding-left: 0; }
}
}
}
2020-07-15 00:35:03 +08:00
// Some crazy linking stuff
@mixin linking_rules($a:0.7, $var:$variant, $vert:'false', $entry_rules:'true', $button_rules:'true',
$e_border:$entry_border, $b_border:$button_border) {
$_border: if($vert=='false', left, top);
@if $entry_rules=='true' {
2021-04-09 20:03:06 +08:00
@each $e_type, $e_color in (':focus-within', $entry_highlight),
2020-07-15 00:35:03 +08:00
(':drop(active)', $drop_target_color),
2021-04-09 20:03:06 +08:00
('.warning:focus-within', $warning_color),
('.error:focus-within', $error_color) {
2020-07-15 00:35:03 +08:00
> entry#{$e_type}:not(:only-child) {
box-shadow: inset 0 0 0 2px $e_color;
}
}
}
@if $button_rules=='true' {
$_uncolored_button: 'button:not(:checked):not(:active):not(.suggested-action):not(.destructive-action)';
> button + button { border-#{$_border}-style: none; }
}
}
// special case, because path-bars are bugged
@mixin pathbar_linking_rules ($sep_color: $button_border, $button_rules: 'true') {
@if $button_rules == 'true' {
> button + button {
border-left-style: none;
}
}
}
// Apply the rules defined above
.linked:not(.vertical) {
&:not(.path-bar) { @include linking_rules(); }
&.path-bar { @include pathbar_linking_rules(); }
}
.linked.vertical { @include linking_rules($vert:'true'); }
// menu buttons
modelbutton.flat {
transition: $shorter_transition;
2021-05-15 13:02:37 +08:00
min-height: 20px + $container_padding;
padding-left: $container_padding + 2px;
padding-right: $container_padding + 2px;
2020-07-15 00:35:03 +08:00
outline-offset: -3px;
border-radius: $bt_radius;
@extend %undecorated_button;
&:hover {
background-color: if($variant=='light', mix($fg_color,$bg_color,5%), mix($fg_color,$bg_color,10%));
transition-duration: 50ms;
}
&:active, &:selected {
&, arrow {
2021-05-15 13:02:37 +08:00
background-color: $selected_bg_color;
color: $selected_fg_color;
2020-07-15 00:35:03 +08:00
transition: none;
animation: none;
}
}
&:checked { color: $fg_color; }
&:disabled { color: $disabled_fg_color; }
// FIXME: temporary workaround
check:last-child,
radio:last-child { margin-left: 8px; }
check:first-child,
radio:first-child { margin-right: 8px; }
2022-05-05 18:47:20 +08:00
arrow.left, arrow.right {
background-color: transparent;
background-image: none;
min-width: 16px;
min-height: 16px;
transition: none;
color: $alt_fg_color;
opacity: 1;
2021-04-09 20:03:06 +08:00
2022-05-05 18:47:20 +08:00
&:hover, &:selected, &:focus {
background-color: transparent;
background-image: none;
transition: none;
color: $selected_fg_color;
}
2021-04-09 20:03:06 +08:00
2022-05-05 18:47:20 +08:00
&.left { -gtk-icon-source: -gtk-icontheme("go-previous-symbolic"); }
2021-04-09 20:03:06 +08:00
2022-05-05 18:47:20 +08:00
&.right { -gtk-icon-source: -gtk-icontheme("go-next-symbolic"); }
}
2021-04-09 20:03:06 +08:00
}
%list_button,
list > row button.image-button:not(.flat) {
@extend %undecorated_button;
border: 1px solid transparentize($borders_color, .5);
&:hover { @include button(hover); }
&:active,
&:checked { @include button(active); }
@each $b_type, $b_color in (suggested-action, $selected_bg_color),
(destructive-action, $destructive_color) {
&.#{$b_type} { // allow colored buttons in lists #3643
@include button(suggested_destructive, $b_color, white);
}
}
2020-07-15 00:35:03 +08:00
}
//
// Links
//
2024-10-30 18:05:53 +08:00
%links,
link,
button.link {
2020-07-15 00:35:03 +08:00
color: $link_color;
2024-10-30 18:05:53 +08:00
text-decoration: underline;
font-weight: inherit;
2020-07-15 00:35:03 +08:00
&:visited {
color: $link_visited_color;
}
2024-10-30 18:05:53 +08:00
2020-07-15 00:35:03 +08:00
&:hover {
2025-04-05 10:26:27 +07:00
color: hsl(hue($link_color), saturation($link_color) * 1.1, lightness($link_color) * 1.1);
2020-07-15 00:35:03 +08:00
}
2024-10-30 18:05:53 +08:00
2020-07-15 00:35:03 +08:00
&:active {
color: $link_color;
}
2024-10-30 18:05:53 +08:00
&:disabled { color: gtkalpha(currentColor, 0.35); }
2020-07-15 00:35:03 +08:00
@at-root %link_selected,
2024-10-30 18:05:53 +08:00
&:selected {
@if $gnome_version == 'old' {
color: mix($selected_fg_color, $selected_bg_color, 80%);
} @else {
color: color-mix(in srgb, $selected_fg_color 80%, $selected_bg_color);
}
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
button.link {
&, &:hover, &:active, &:checked {
2020-07-15 00:35:03 +08:00
@extend %undecorated_button;
}
2021-04-09 20:03:06 +08:00
2020-07-15 00:35:03 +08:00
> label { text-decoration-line: underline; }
}
//
// Spinbuttons
//
spinbutton {
2022-10-09 16:02:36 +08:00
background: none;
2024-11-07 10:44:13 +08:00
min-height: $small_size;
2022-10-09 16:02:36 +08:00
2020-07-15 00:35:03 +08:00
&:drop(active) { box-shadow: none; }
&:disabled { color: $disabled_fg_color; }
2022-10-09 16:02:36 +08:00
button:active { color: $selected_fg_color; }
&:focus-within { outline: none; }
2021-04-09 20:03:06 +08:00
> text {
2021-05-15 13:02:37 +08:00
padding: $container_padding;
2020-07-15 00:35:03 +08:00
@extend %Linked_entrys;
2021-04-09 20:03:06 +08:00
border: 1px solid $dark_borders_color;
2022-10-09 16:02:36 +08:00
background-clip: padding-box;
> selection {
background-color: $selected_bg_color;
color: $selected_fg_color;
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&:focus-within {
2022-10-09 16:02:36 +08:00
outline: none;
@if $variant == 'dark' { box-shadow: inset 0 0 0 2px $entry_highlight; }
@if $variant == 'light' {
border-color: $entry_highlight;
box-shadow: 0 1px 1px 0 transparent, inset 0 0 0 1px $entry_highlight;
}
2020-07-15 00:35:03 +08:00
}
&:drop(active) {
2022-10-09 16:02:36 +08:00
outline: none;
@if $variant == 'dark' { box-shadow: inset 0 0 0 2px $drop_target_color; }
@if $variant == 'light' {
border-color: $drop_target_color;
box-shadow: 0 1px 1px 0 transparent, inset 0 0 0 1px $drop_target_color;
}
2020-07-15 00:35:03 +08:00
}
}
&:not(.vertical) {
2021-04-09 20:03:06 +08:00
padding: 0;
border-spacing: 0;
> text {
2020-07-15 00:35:03 +08:00
padding-top: 2px;
padding-bottom: 2px;
2021-05-15 13:02:37 +08:00
min-width: $menuitem_size;
2024-11-07 10:44:13 +08:00
min-height: $small_size - 4px;
2020-07-15 00:35:03 +08:00
}
2024-11-07 10:44:13 +08:00
> button { min-height: $small_size; }
> button, > text { @extend %linked; }
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&:dir(ltr) > text,
&:dir(rtl) > button.up { border-radius: $bt_radius 0 0 $bt_radius; }
2020-07-15 00:35:03 +08:00
> button + button { border-left-style: none; }
> button:hover:not(:active),
> button:hover + button { box-shadow: inset 1px 0 $button_border; }
> button:disabled + button:not(:disabled):not(:active):not(:checked):not(:hover),
> button:not(:disabled):not(:active):not(:checked):not(:hover) + button:disabled { box-shadow: inset 1px 0 transparentize($button_border, 0.5); }
> button:first-child:hover:not(:active),
> button.up:dir(rtl):hover:not(:active),
2021-04-09 20:03:06 +08:00
> text + button:not(:active):hover { box-shadow: none; }
2020-07-15 00:35:03 +08:00
2022-10-09 16:02:36 +08:00
@if $variant == 'light' {
> text:focus-within + button { border-left-color: $entry_highlight; }
> text:drop(active) + button { border-left-color: $drop_target_color; }
}
2020-07-15 00:35:03 +08:00
.osd & {
2021-04-24 23:14:31 +08:00
&, &:focus-within, &:drop(active) { border-image: none; }
2020-07-15 00:35:03 +08:00
> button:hover:not(:active),
> button:hover + button { box-shadow: inset 1px 0 $osd_button_border; }
> button:first-child:hover:not(:active),
> button.up:dir(rtl):hover:not(:active),
2021-04-09 20:03:06 +08:00
> text + button:not(:active):hover { box-shadow: none; }
2020-07-15 00:35:03 +08:00
2021-04-24 23:14:31 +08:00
> text:focus-within + button { border-left-color: $entry_highlight; }
2020-07-15 00:35:03 +08:00
}
}
&.vertical {
2021-04-09 20:03:06 +08:00
> button, > text {
2021-05-15 13:02:37 +08:00
padding-left: $container_padding - 2px;
padding-right: $container_padding - 2px;
2020-07-15 00:35:03 +08:00
min-width: 0;
@extend %linked_vertical;
}
2021-04-09 20:03:06 +08:00
> button.up { border-radius: $bt_radius $bt_radius 0 0; }
2020-07-15 00:35:03 +08:00
2022-10-09 16:02:36 +08:00
@if $variant == 'light' {
> text:focus-within + button { border-top-color: $entry_highlight; }
> text:drop(active) + button { border-top-color: $drop_target_color; }
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
// Misc
treeview &:not(.vertical),
row &:not(.vertical) {
min-height: 0;
2021-05-15 13:02:37 +08:00
padding: 0 $container_padding / 2;
2021-04-09 20:03:06 +08:00
border-style: none;
border-radius: $bt_radius;
background-color: rgba($fg_color, 0.08);
&:focus, &:hover, &:selected { background-color: rgba($fg_color, 0.12); }
2022-05-05 17:53:22 +08:00
&:focus-within {
box-shadow: inset 0 0 0 2px $entry_highlight;
transition: $shadow_transition;
}
2021-04-09 20:03:06 +08:00
> text {
&, &:hover, &:focus {
background: none;
border: none;
box-shadow: none;
}
}
> button.up,
> button.down {
border: none;
border-color: transparent;
box-shadow: none;
border-radius: 100px;
min-height: 22px;
min-width: 22px;
padding: 0;
margin: 4px 2px;
background-color: transparent;
&:hover { background-color: rgba($fg_color, 0.1); }
&:active { background-color: rgba($fg_color, 0.15); color: $fg_color; }
}
> button:hover:not(:active),
> button:hover + button { box-shadow: none; }
> button:disabled + button:not(:disabled):not(:active):not(:checked):not(:hover),
> button:not(:disabled):not(:active):not(:checked):not(:hover) + button:disabled { box-shadow: none; }
> text:focus + button { border-left-color: transparent; }
> text:drop(active) + button { border-left-color: transparent; }
}
font-feature-settings: "tnum";
2020-07-15 00:35:03 +08:00
}
//
// Comboboxes
//
2021-04-09 20:03:06 +08:00
dropdown > popover.menu.background > contents { padding: 0; }
dropdown > button > box {
2022-04-17 22:49:54 +08:00
border-spacing: $container_padding;
2021-04-09 20:03:06 +08:00
}
dropdown,
2020-07-15 00:35:03 +08:00
combobox {
2021-05-15 13:02:37 +08:00
min-height: $menuitem_size - 4px;
2020-07-15 00:35:03 +08:00
button.combo {
min-width: 0; // otherwise the arrow placement is unsymmetric
2021-05-15 13:02:37 +08:00
min-height: $menuitem_size - 4px;
2020-07-15 00:35:03 +08:00
// margin: 0;
2021-05-15 13:02:37 +08:00
padding-left: $container_padding * 2;
padding-right: $container_padding * 2;
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
// align menu labels with the button label
> popover.menu > contents modelbutton {
2021-05-15 13:02:37 +08:00
padding-left: $container_padding + 4px;
padding-right: $container_padding + 4px;
2021-04-09 20:03:06 +08:00
}
2022-05-05 17:53:22 +08:00
button.combo arrow {
2020-07-15 00:35:03 +08:00
@include button(active);
-gtk-icon-source: -gtk-scaled(
url("assets/combobox-arrow-dark.png"),
url("assets/combobox-arrow-dark@2.png"));
min-height: 16px;
2021-05-15 13:02:37 +08:00
min-width: $menuitem_size - 10px;
2020-07-15 00:35:03 +08:00
padding: 0;
2021-05-15 13:02:37 +08:00
margin: 2px (-$menuitem_size + 18px) 2px 0;
2020-07-15 00:35:03 +08:00
border-radius: $bt_radius - 1px;
border: none;
@if $variant == 'dark' {
box-shadow: inset 0 1px $button_highlight, 0 0 0 1px $dark_borders_color, 0 1px 2px 0 rgba(black, 0.05);
}
2020-07-15 00:35:03 +08:00
}
2021-12-07 12:31:09 +08:00
.background & button.combo:disabled arrow,
.background & button.combo:backdrop arrow {
background-color: if($variant=='light', rgba(black, 0.35), rgba(white, 0.25));
}
2020-07-15 00:35:03 +08:00
button.combo:checked,
.background & button.combo:checked { transition: none; } // workaround for menuitem selection
&:drop(active) button.combo {
color: $drop_target_color;
border-color: $drop_target_color;
box-shadow: none;
}
2021-04-09 20:03:06 +08:00
// newstyle
popover {
2021-05-15 13:02:37 +08:00
margin-top: $container_padding / 2;
2021-04-09 20:03:06 +08:00
padding: 0;
// drodowns with searchboxes on top
.dropdown-searchbar {
2021-05-15 13:02:37 +08:00
padding: $container_padding;
2021-04-09 20:03:06 +08:00
border-bottom: 1px solid $borders_color;
}
}
2020-07-15 00:35:03 +08:00
.linked:not(.vertical) > entry + button.combo,
.linked:not(.vertical) > & > box > button.combo {
arrow {
background-color: transparent;
2020-12-25 21:36:30 +08:00
box-shadow: none;
2020-07-15 00:35:03 +08:00
-gtk-icon-source: -gtk-scaled(
url("assets/combobox-arrow#{$asset_suffix}.png"),
url("assets/combobox-arrow#{$asset_suffix}@2.png"));
}
2022-05-05 17:53:22 +08:00
&:checked, &:active {
arrow {
border-radius: 0;
background-color: transparent;
-gtk-icon-source: -gtk-scaled(
url("assets/combobox-arrow-dark.png"),
url("assets/combobox-arrow-dark@2.png"));
}
2020-07-15 00:35:03 +08:00
}
}
.linked:not(.vertical) > & > box > button.combo {
// the combobox is a composite widget so the way we do button linking doesn't
// work, special case needed.
&:dir(ltr),
&:dir(rtl) { @extend %linked_middle; } // specificity bump
}
.linked:not(.vertical) > &:first-child > box > button.combo {
border-top-left-radius: $bt_radius;
2022-05-05 17:53:22 +08:00
border-bottom-left-radius: $bt_radius;
2020-07-15 00:35:03 +08:00
}
.linked:not(.vertical) > &:last-child > box > button.combo {
border-top-right-radius: $bt_radius;
border-bottom-right-radius: $bt_radius;
border-right: 1px solid $button_borders;
}
.linked:not(.vertical) > &:only-child > box > button.combo {
border-radius: $bt_radius;
}
// .linked.vertical > & > box > button.combo { @extend %linked_vertical_middle; }
.linked.vertical > &:first-child > box > button.combo {
border-top-left-radius: $bt_radius;
border-top-right-radius: $bt_radius;
}
.linked.vertical > &:last-child > box > button.combo {
border-bottom-left-radius: $bt_radius;
border-bottom-right-radius: $bt_radius;
}
.linked.vertical > &:only-child > box > button.combo {
border-radius: $bt_radius;
}
}
//
// Toolbars
//
2021-04-09 20:03:06 +08:00
2022-05-05 17:53:22 +08:00
.toolbar {
2024-04-19 16:28:28 +08:00
padding: $container_padding;
border-spacing: $container_padding;
2023-02-14 23:52:32 +08:00
background-color: $bg_color;
color: $text_color;
2020-07-15 00:35:03 +08:00
separator { background: none; }
2023-02-14 23:52:32 +08:00
2022-05-05 17:53:22 +08:00
&.horizontal separator { margin: 0 $container_padding; }
&.vertical separator { margin: $container_padding 0; }
// oldstyle toolbar buttons
2024-04-19 16:28:28 +08:00
> button {
2022-05-05 17:53:22 +08:00
@extend %flat_button;
}
2020-07-15 00:35:03 +08:00
.osd & { background-color: transparent; }
&.osd {
2021-05-15 13:02:37 +08:00
padding: $container_padding;
2020-10-11 11:40:05 +08:00
border: none;
border-radius: $bt_radius + 4px;
background-color: $osd_bg_color;
box-shadow: $shadow_4;
2022-05-05 17:53:22 +08:00
scalebutton {
margin: 0;
2020-10-11 11:40:05 +08:00
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&.left,
&.right,
&.top,
&.bottom { border-radius: 0; } // positional classes for `attached` osd toolbars
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&.top { border-width: 0 0 1px 0; }
&.bottom { border-width: 1px 0 0 0; }
&.left { border-width: 0 1px 0 0; }
&.right { border-width: 0 0 0 1px; }
2020-07-15 00:35:03 +08:00
}
}
2021-04-09 20:03:06 +08:00
searchbar {
2022-05-05 17:53:22 +08:00
> revealer > box {
padding: $container_padding;
border-spacing: $container_padding;
}
2023-10-13 06:36:42 +08:00
&:not(.inline) > revealer > box {
border-style: solid;
border-color: $solid_borders_color;
background-color: $header_bg;
border-width: 0 0 1px;
box-shadow: none;
color: $header_fg;
}
// Close button on searchbar
2024-11-18 00:50:20 +08:00
button.flat, .close {
min-width: 18px;
min-height: 18px;
padding: 4px;
border-radius: 50%;
2023-10-13 06:36:42 +08:00
}
2024-10-16 16:08:24 +08:00
.top-bar &:not(.inline) > revealer > box,
.bottom-bar &:not(.inline) > revealer > box {
background-color: transparent;
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
actionbar > revealer > box {
2021-05-15 13:02:37 +08:00
padding: $container_padding;
border-spacing: $container_padding;
2020-07-15 00:35:03 +08:00
border-top: 1px solid $borders_color;
background-color: darken($bg_color, 3%);
2022-05-05 17:53:22 +08:00
box-shadow: none;
2022-10-09 16:02:36 +08:00
color: $text_color;
2022-05-05 17:53:22 +08:00
&, > box.start, > box.end {
border-spacing: $container_padding;
2021-04-08 12:12:34 +08:00
}
2024-11-18 00:50:20 +08:00
&:backdrop {
background-color: $bg_color;
> * {
filter: opacity(.5);
}
}
}
%actionbar-inline > revealer > box {
background-color: transparent;
color: inherit;
box-shadow: none;
padding-top: $container_padding;
&:backdrop {
background-color: transparent;
transition: none;
> * {
filter: none;
transition: none;
}
}
2020-07-15 00:35:03 +08:00
}
//
// Headerbars
//
2021-05-15 13:02:37 +08:00
%header_separator {
min-width: 0;
min-height: 0;
background-color: transparent;
border: none;
&:backdrop { opacity: 0.65; }
}
// Headerbar Entries
%headerbar_entrys {
// min-height: $menuitem_size - 6px;
@include entry(header-normal);
&:backdrop { opacity: 0.65; background-image: none; }
&:hover {
@include entry(header-hover);
}
&:focus {
@include entry(header-focus);
}
&:disabled {
2022-10-09 16:02:36 +08:00
opacity: 1;
2021-05-15 13:02:37 +08:00
@include entry(header-insensitive);
}
selection:focus {
background-color: $selected_bg_color;
color: $selected_fg_color;
}
progress {
border-color: $progress_color;
background-image: none;
background-color: transparent;
}
@each $e_type, $e_color, $e_fg_color in (warning, $warning_color, $light_fg_color),
(error, $error_color, $light_fg_color) {
&.#{$e_type} {
color: $e_fg_color;
border-color: if($variant=='light', $e_color, $entry_border);
background-color: mix($e_color, $header_bg, 60%);
&:focus {
color: $e_fg_color;
background-color: $e_color;
}
selection, selection:focus {
background-color: $e_fg_color;
color: $e_color;
}
}
}
}
// Headerbar Buttons
%headerbar_buttons {
@include button(header-normal);
&:backdrop { opacity: 0.65; background-image: none; }
&:hover {
@include button(header-hover);
transition: $button_transition;
}
&:active {
@include button(header-active);
transition: $button_transition;
transition-duration: 300ms;
}
&:checked {
@include button(header-checked);
transition: $button_transition;
transition-duration: 300ms;
&:hover { background-image: none; }
}
&:disabled {
2022-10-09 16:02:36 +08:00
opacity: 1;
2021-05-15 13:02:37 +08:00
&, &:checked, &:active { @include button(header-insensitive); }
}
&.flat {
@include button(undecorated);
}
}
headerbar {
2022-05-05 17:53:22 +08:00
min-height: $headerbar_size;
2022-10-09 16:02:36 +08:00
padding: 0;
2024-11-18 00:50:20 +08:00
margin: 0;
2020-07-15 00:35:03 +08:00
color: $header_fg;
background-color: $header_bg;
border-bottom: 1px solid $header_border;
2021-11-28 11:53:51 +08:00
box-shadow: none;
2020-07-15 00:35:03 +08:00
&:backdrop {
2023-10-13 06:36:42 +08:00
opacity: 1;
2020-07-15 00:35:03 +08:00
transition: $backdrop_transition;
color: transparentize($header_fg, 0.3);
background-color: $header_bg_backdrop;
border-color: if($variant=='light', lighten($header_border, 5%), darken($header_border, 3%));
2021-11-28 11:53:51 +08:00
box-shadow: none;
2020-07-15 00:35:03 +08:00
}
2022-10-09 16:02:36 +08:00
&.flat {
2023-06-30 18:09:28 +08:00
&, &:backdrop {
border: none;
background: none;
}
2022-10-09 16:02:36 +08:00
windowcontrols {
padding: 0 $container_padding / 2;
}
}
2020-07-15 00:35:03 +08:00
.title {
2022-10-09 16:02:36 +08:00
padding: 2px $container_padding * 2;
2020-07-15 00:35:03 +08:00
}
.subtitle {
font-size: smaller;
2022-10-09 16:02:36 +08:00
padding: 2px $container_padding * 2;
2020-07-15 00:35:03 +08:00
margin-top: -3px;
@extend %dim-label;
}
2022-05-05 17:53:22 +08:00
> windowhandle > box {
2025-02-14 12:29:06 +08:00
padding: 0 8px;
margin-top: 8px;
margin-bottom: 8px;
2022-05-05 17:53:22 +08:00
&,
> box.start,
> box.end {
border-spacing: $container_padding;
}
2025-02-14 12:29:06 +08:00
&, > widget {
> box.start:dir(ltr),
> box.end:dir(rtl) {
margin-right: $container_padding;
}
> box.start:dir(rtl),
> box.end:dir(ltr) {
margin-left: $container_padding;
}
}
2022-05-05 17:53:22 +08:00
}
2022-10-08 13:57:46 +08:00
entry {
@extend %headerbar_entrys;
2024-11-18 00:50:20 +08:00
border-spacing: 4px;
2022-10-08 13:57:46 +08:00
}
2020-07-15 00:35:03 +08:00
2022-10-08 13:57:46 +08:00
button {
@extend %headerbar_buttons;
2023-10-13 06:36:42 +08:00
&.star {
min-width: 24px;
padding: 2px;
border-radius: $circular_radius;
}
2022-10-08 13:57:46 +08:00
}
2020-07-15 00:35:03 +08:00
// Reset linked buttons
2021-04-09 20:03:06 +08:00
.linked.raised > & {
2021-05-15 13:02:37 +08:00
// min-width: 16px;
2020-07-15 00:35:03 +08:00
border-radius: $bt_radius;
border: none;
box-shadow: none;
&:disabled { background: none; }
}
2021-04-09 20:03:06 +08:00
stackswitcher.linked:not(.vertical) > button {
2021-05-15 13:02:37 +08:00
min-width: $menuitem_size - 4px;
2020-07-15 00:35:03 +08:00
border-radius: $bt_radius;
}
// Reset linking entrys
.linked:not(.vertical) > entry {
@include entry(header-normal);
2021-05-15 13:02:37 +08:00
padding: 0 $container_padding * 2;
2020-07-15 00:35:03 +08:00
border: none;
&:focus {
@include entry(header-focus);
}
&:disabled {
@include entry(header-insensitive);
}
&:backdrop { opacity: 0.65; background-image: none; }
}
2021-04-09 20:03:06 +08:00
stackswitcher {
2020-07-15 00:35:03 +08:00
box-shadow: inset 0 0 0 1px $light_borders_color;
border-radius: $bt_radius;
padding: 0;
2021-04-09 20:03:06 +08:00
> button {
2020-07-15 00:35:03 +08:00
font-weight: 500;
&:not(:first-child) {
border-width: 0 0 0 1px;
border-style: none solid none none;
border-radius: 0;
border-image: linear-gradient(to bottom,
transparent 16%,
$light_borders_color 16%,
$light_borders_color 84%,
transparent 84%) 0 0 0 1 / 0 0 0 1px stretch;
}
2023-03-13 08:50:24 +08:00
&:hover, &:active, &:checked {
2020-07-15 00:35:03 +08:00
border-image: none;
}
}
2023-03-13 08:50:24 +08:00
button:hover + button,
button:active + button,
2020-07-15 00:35:03 +08:00
button:checked + button { border-image: none; }
}
// Headerbar Switches
switch {
2025-02-14 12:29:06 +08:00
// margin-top: ($headerbar_size - 24px) / 2;
// margin-bottom: ($headerbar_size - 24px) / 2;
2020-07-15 00:35:03 +08:00
&:backdrop { opacity: 0.75; }
}
&.titlebar headerbar:not(.titlebar) {
background: none;
box-shadow: none;
}
2021-11-28 11:53:51 +08:00
windowhandle {
2021-11-30 16:50:07 +08:00
box.linked > button {
background-color: $fill_color;
&:hover { background-color: $divider_color; }
&:active { background-color: $track_color; }
&:checked { background-color: $visit_color; }
}
2021-04-04 16:39:10 +08:00
}
2020-07-15 00:35:03 +08:00
// Selectionmode
.selection-mode &,
&.selection-mode {
color: $light_fg_color;
background-color: $selection_mode_bg;
box-shadow: none;
background-image: none;
text-shadow: none;
2024-10-30 18:05:53 +08:00
@if $gnome_version == 'old' {
border-color: darken($selection_mode_bg, 5%);
} @else {
border-color: color-mix(in srgb, black 15%, $selection_mode_bg)
}
2020-07-15 00:35:03 +08:00
&:backdrop {
background-color: $selection_mode_bg;
color: transparentize($light_fg_color, 0.4);
2024-10-30 18:05:53 +08:00
@if $gnome_version == 'old' {
border-color: darken($selection_mode_bg, 5%);
} @else {
border-color: color-mix(in srgb, black 15%, $selection_mode_bg)
}
2020-07-15 00:35:03 +08:00
}
button {
@include button(undecorated);
@extend %selected-button;
}
.subtitle:link { @extend %link_selected; }
.selection-menu {
box-shadow: none;
padding-left: 10px;
padding-right: 10px;
.arrow {
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
}
}
.maximized & { background-color: $selection_mode_bg; }
}
.tiled &, .tiled &:backdrop,
.maximized &, .maximized &:backdrop {
2021-02-09 09:11:10 +08:00
border-radius: $maximized_radius $maximized_radius 0 0; // squared corners when the window is max'd or tiled
2020-07-15 00:35:03 +08:00
box-shadow: none;
}
.maximized & {
background-color: $header_bg;
border-color: opacify($header_border, 1);
box-shadow: none;
&:backdrop {
background-color: $header_bg_backdrop;
border-color: if($variant=='light', lighten($header_border, 15%), darken($header_border, 3%));
}
2023-09-04 00:13:44 +08:00
&.flat {
&, &:backdrop {
border: none;
background: none;
}
}
2020-07-15 00:35:03 +08:00
}
separator.titlebutton { @extend %header_separator; }
2024-10-30 18:41:44 +08:00
// Titlebuttons
windowcontrols {
2024-11-18 00:50:20 +08:00
border-spacing: $container_padding;
2024-10-30 18:41:44 +08:00
padding: 0 10px;
&:not(.empty) {
&.start:dir(ltr),
&.end:dir(rtl) {
margin-right: $container_padding + 2px;
}
&.start:dir(rtl),
&.end:dir(ltr) {
margin-left: $container_padding + 2px;
}
}
headerbar.titlebar & {
border-spacing: $container_padding;
}
button {
> image {
padding: 0;
margin: 0;
background-color: transparent;
background-image: none;
}
&.close, &.maximize, &.minimize {
min-width: 16px;
min-height: 16px;
2025-02-14 12:44:33 +08:00
padding: ($menuitem_size - 20px) / 2 1px;
2024-10-30 18:41:44 +08:00
background-position: center;
background-repeat: no-repeat;
background-size: 16px 16px;
&, &:hover, &:focus, &:active, &:backdrop {
@include button(undecorated);
color: transparent;
}
&:backdrop { opacity: 1; }
}
// Load png assets for each button, Fix the Chrome window restore button bug
@each $k in ('close', 'maximize', 'minimize') {
@each $l, $m in ('',''), (':backdrop','-backdrop'), (':backdrop:hover','-backdrop-hover'), (':hover','-hover'), (':active','-active') {
&.#{$k}#{$l} {
background-image: -gtk-scaled(url('windows-assets/titlebutton-#{$k}#{$m}#{$asset_suffix}.png'),
url('windows-assets/titlebutton-#{$k}#{$m}#{$asset_suffix}@2.png'));
}
}
}
}
}
.fullscreen & windowcontrols,
.maximized & windowcontrols {
button {
@each $l, $m in ('',''), (':backdrop','-backdrop'), (':backdrop:hover','-backdrop-hover'), (':hover','-hover'), (':active','-active') {
&.maximize#{$l} {
background-image: -gtk-scaled(url('windows-assets/titlebutton-restore#{$m}#{$asset_suffix}.png'),
url('windows-assets/titlebutton-restore#{$m}#{$asset_suffix}@2.png'));
}
}
}
}
2024-10-30 19:00:25 +08:00
&.default-decoration {
min-height: $medium_size;
padding: 0;
background-color: $header_bg;
border: none;
box-shadow: none;
> windowhandle > box {
padding: 0 $container_padding / 2;
}
.tiled &,
.maximized &,
.fullscreen & { box-shadow: none; }
windowcontrols {
button,
menubutton {
border: none;
min-width: 16px;
min-height: 16px;
margin: 0;
padding: 0;
}
menubutton button {
min-height: 20px;
min-width: 20px;
margin: 0;
padding: $container_padding - 2px;
}
button.close, button.maximize, button.minimize {
min-width: 16px;
min-height: 16px;
2025-02-14 12:44:33 +08:00
margin: 0 1px;
2024-10-30 19:00:25 +08:00
padding: 0;
}
}
}
2020-07-15 00:35:03 +08:00
}
.titlebar {
> box.left.horizontal,
> box.right.horizontal {
2021-05-15 13:02:37 +08:00
padding: 0 $container_padding;
}
2020-07-15 00:35:03 +08:00
}
// Fixes split headerbars too
.titlebar:not(headerbar) {
window > &,
window.csd > & {
&, &:backdrop {
padding: 0;
background: none;
border: none;
box-shadow: none;
}
}
> separator {
min-width: 1px;
@extend %side_separator;
}
}
//
// Pathbars
//
2022-04-17 22:49:54 +08:00
$pathbar_button_checked_bg: if($variant == 'light', #808080, #b8b8b8);
pathbar > button {
min-width: $container_padding * 2;
2020-07-15 00:35:03 +08:00
min-height: if($variant == 'light', 24px, 26px);
&.text-button, &.image-button, & {
2022-04-17 22:49:54 +08:00
padding-left: $container_padding;
padding-right: $container_padding;
2020-07-15 00:35:03 +08:00
}
&:hover { box-shadow: none; }
&:active, &:checked {
2022-04-17 22:49:54 +08:00
background-color: $pathbar_button_checked_bg;
color: if($variant == 'light', rgba(white, 1), rgba(black, 0.75));
2020-07-15 00:35:03 +08:00
border-color: $button_borders;
}
&:disabled {
border-color: $button_borders;
}
&.text-button.image-button label { padding-left: 0; padding-right: 0; }
&.text-button.image-button, & {
2022-04-17 22:49:54 +08:00
label:last-child { padding-right: $container_padding + 4px; }
label:first-child { padding-left: $container_padding + 4px; }
2020-07-15 00:35:03 +08:00
}
&.slider-button,
&:not(.image-button):not(.text-button) {
padding-left: 1px;
padding-right: 1px;
}
image {
2021-05-15 13:02:37 +08:00
padding-left: $container_padding;
padding-right: $container_padding;
2020-07-15 00:35:03 +08:00
}
}
//
// Tree Views
//
2021-04-10 22:07:27 +08:00
columnview.view,
treeview.view {
border-left-color: $solid_borders_color; // this is actually the tree lines color,
border-top-color: $solid_borders_color; // while this is the grid lines color, better then nothing
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> rubberband { @extend %rubberband; } // to avoid borders being overridden by the previously set props
2020-07-15 00:35:03 +08:00
acceleditor > label { background-color: $selected_bg_color; }
&:selected {
&, &:focus {
border-radius: 0;
@extend %selected_items;
}
}
&:disabled {
color: $disabled_fg_color;
&:selected {
2024-10-30 18:05:53 +08:00
color: rgba($selected_fg_color, 0.45);
2020-07-15 00:35:03 +08:00
}
}
&.separator {
min-height: 2px;
color: $borders_color;
}
2021-04-09 20:03:06 +08:00
> dndtarget:drop(active) {
border-style: solid none;
border-width: 1px;
2024-10-30 18:05:53 +08:00
border-color: $drop_target_color;
2021-04-09 20:03:06 +08:00
&.after { border-top-style: none; }
&.before { border-bottom-style: none; }
}
2020-07-15 00:35:03 +08:00
&.expander {
2021-04-10 22:07:27 +08:00
min-width: 16px;
min-height: 16px;
2020-07-15 00:35:03 +08:00
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
2024-10-30 18:05:53 +08:00
color: $alt_fg_color;
2020-07-15 00:35:03 +08:00
&:hover { color: $fg_color; }
&:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
2024-10-30 18:05:53 +08:00
&:disabled { color: $alt_disabled_fg_color; }
2020-07-15 00:35:03 +08:00
}
2021-04-10 22:07:27 +08:00
&.progressbar { // progress bar in treeviews
2020-07-15 00:35:03 +08:00
color: $selected_fg_color;
border-radius: $bt_radius;
background-color: $progress_color;
&:selected, &:selected:focus {
color: $selected_bg_color;
box-shadow: none;
background-color: $selected_fg_color;
}
}
&.trough { // progress bar trough in treeviews
color: $fg_color;
background-color: $button_border;
border-radius: $bt_radius;
border-width: 0;
&:selected, &:selected:focus {
color: $selected_fg_color;
background-color: transparentize(black, 0.8);
border-radius: $bt_radius;
border-width: 0;
}
}
2021-04-09 20:03:06 +08:00
> header {
> button {
2020-07-15 00:35:03 +08:00
$_column_header_color: mix($fg_color,$base_color,80%);
min-height: if($variant =='light', 24px, 26px);
min-width: 38px;
2021-05-15 13:02:37 +08:00
padding: 0 $container_padding;
2020-07-15 00:35:03 +08:00
font-weight: bold;
color: $_column_header_color;
background-color: $base_color;
background-image: none;
box-shadow: none;
border-style: none solid none none;
border-radius: 0;
border-image: linear-gradient(to bottom,
$base_color 20%,
transparentize(if($variant == 'light', black, white), 0.89) 20%,
transparentize(if($variant == 'light', black, white), 0.89) 80%,
$base_color 80%) 0 1 0 0 / 0 1px 0 0 stretch;
&:hover { color: $selected_bg_color; }
&:active { color: $fg_color; }
&:active, &:hover { background-color: $base_color; }
&:disabled {
border-color: $bg_color;
background-image: none;
}
&:last-child {
border-right-style: none;
border-image: none;
}
}
}
button.dnd,
header.button.dnd {
&, &:selected, &:hover, &:active {
2021-05-15 13:02:37 +08:00
padding: 0 $container_padding;
2020-07-15 00:35:03 +08:00
transition: none;
color: $selected_fg_color;
background-color: $selected_bg_color;
border-radius: 0;
border-style: none;
}
}
}
2024-04-19 16:22:08 +08:00
treeview.navigation-sidebar {
padding: 0;
}
2020-07-15 00:35:03 +08:00
//
// Menus
//
2021-04-09 20:03:06 +08:00
menubar {
2020-07-15 00:35:03 +08:00
padding: 0;
background-color: $header_bg;
color: $header_fg;
box-shadow: inset 0 -1px $borders_color;
&:backdrop {
color: transparentize($header_fg, 0.2);
// background-image: none;
// background-color: opacify($header_bg_backdrop, 1);
}
2021-04-09 20:03:06 +08:00
> item {
2020-07-15 00:35:03 +08:00
transition: all 0.2s cubic-bezier(0.0, 0.0, 0.2, 1);
2021-05-15 13:02:37 +08:00
padding: ($container_padding - 2px) $container_padding;
2020-07-15 00:35:03 +08:00
border: none;
2021-04-09 20:03:06 +08:00
border-radius: $bt_radius / 2;
2020-07-15 00:35:03 +08:00
&:hover { //Seems like it :hover even with keyboard focus
transition: none;
@include button(header-hover);
}
&:disabled {
color: transparentize($header_fg, 0.6);
}
}
2021-04-09 20:03:06 +08:00
& > item popover.menu.background > contents {
2021-05-15 13:02:37 +08:00
padding: $container_padding;
2021-04-09 20:03:06 +08:00
border-radius: $mn_radius;
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
//nested submenus
& > item popover.menu popover.menu {
2021-05-15 13:02:37 +08:00
padding: 0 0 $container_padding 0;
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
& > item popover.menu.background popover.menu.background > contents {
margin: 0;
border-radius: $mn_radius; //including top
2020-07-15 00:35:03 +08:00
}
}
//
// Popovers
//
2022-05-05 17:53:22 +08:00
popover {
&.background {
background-color: transparent;
font: initial;
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> arrow,
> contents {
2021-11-28 11:53:51 +08:00
color: $fg_color;
2023-10-13 06:36:42 +08:00
background-clip: padding-box;
2021-04-09 20:03:06 +08:00
background-color: $menu_bg;
box-shadow: 0 3px 6px 0 if($variant=='light', transparentize(black, 0.85), transparentize(black, 0.85)),
0 0 0 1px if($variant=='light', rgba($borders_color, 0.03), rgba($dark_borders_color, 0.55));
2020-07-15 00:35:03 +08:00
border: 1px solid if($variant=='light', rgba($borders_color, 0.2), lighten($menu_bg, 6%));
}
2021-04-09 20:03:06 +08:00
&, &:backdrop {
2020-07-15 00:35:03 +08:00
background-color: transparent;
}
2021-04-09 20:03:06 +08:00
> contents {
2021-05-15 13:02:37 +08:00
padding: $container_padding;
2023-03-29 14:48:35 +08:00
border-radius: $mn_radius;
2021-04-09 20:03:06 +08:00
2022-10-09 16:02:36 +08:00
list,
.view,
2021-04-09 20:03:06 +08:00
> toolbar {
2022-10-09 16:02:36 +08:00
border: none;
2021-04-09 20:03:06 +08:00
background-color: transparent;
}
separator {
background-color: $menu_bd;
2021-05-15 13:02:37 +08:00
margin: $container_padding / 2;
2021-04-09 20:03:06 +08:00
}
2022-05-05 17:53:22 +08:00
> scrolledwindow > viewport > stack > box {
padding: 0;
}
2021-04-09 20:03:06 +08:00
2022-10-09 16:02:36 +08:00
stack scrolledwindow:not(.view) > viewport {
border: 1px solid $borders_color;
border-radius: $bt_radius;
background-color: $base_color;
}
2022-11-13 11:32:48 +08:00
listview {
2024-03-31 02:47:02 +08:00
padding: 0;
2022-05-05 17:53:22 +08:00
margin: 0;
> row {
2022-11-13 11:32:48 +08:00
padding: $container_padding $container_padding * 2;
2022-05-05 17:53:22 +08:00
margin: 0;
2022-11-13 11:32:48 +08:00
&:selected {
color: $selected_fg_color;
background-color: $selected_bg_color;
}
2022-05-05 17:53:22 +08:00
}
}
2020-07-15 00:35:03 +08:00
}
entry {
background-color: mix($fg_color, $menu_bg, 5%);
}
2022-05-05 17:53:22 +08:00
.osd &,
&.touch-selection,
&.magnifier {
2020-07-15 00:35:03 +08:00
background-color: transparent;
2022-05-05 17:53:22 +08:00
> arrow,
> contents {
@extend %osd;
2021-04-04 16:39:10 +08:00
2022-05-05 17:53:22 +08:00
border: none;
box-shadow: 0 3px 8px 0 rgba(black, 0.35);
2021-04-04 19:03:10 +08:00
}
2021-04-04 16:39:10 +08:00
}
2021-04-09 20:03:06 +08:00
&.touch-selection,
&.magnifier {
button { @extend %osd_button; }
}
}
2020-07-15 00:35:03 +08:00
//touch selection handlebars for the Popover.osd above
cursor-handle {
background-color: transparent;
background-image: none;
box-shadow: none;
border-style: none;
&.top { -gtk-icon-source: -gtk-icontheme('selection-start-symbolic'); }
&.bottom { -gtk-icon-source: -gtk-icontheme('selection-end-symbolic'); }
}
2021-04-09 20:03:06 +08:00
//
// Popover Base Menus
//
popover.menu {
padding: 0;
box.inline-buttons {
padding: 0 $container_padding;
button.image-button.model {
@include button(undecorated);
2021-05-15 13:02:37 +08:00
min-height: $menuitem_size;
min-width: $menuitem_size;
2021-04-09 20:03:06 +08:00
padding: 0;
border: none;
outline: none;
transition: none;
&:selected {
color: $selected_fg_color;
background-image: image($selected_bg_color);
}
}
}
box.circular-buttons {
padding: $container_padding;
button.circular.image-button.model {
@extend %list_button;
2022-05-05 17:53:22 +08:00
padding: $container_padding;
2021-04-09 20:03:06 +08:00
border: none;
&:focus {
background-color: $light_borders_color;
}
&:active:focus {
color: $selected_fg_color;
background-color: $selected_bg_color;
}
}
}
& > arrow,
&.background > contents {
background-color: $menu_bg;
2021-11-28 11:53:51 +08:00
color: $fg_color;
2021-04-09 20:03:06 +08:00
}
&.background separator {
2021-05-15 13:02:37 +08:00
margin: $container_padding 0;
2021-04-09 20:03:06 +08:00
}
accelerator {
color: gtkalpha(currentColor, 0.55);
&:dir(ltr) { margin-left: $container_padding; }
&:dir(rtl) { margin-right: $container_padding; }
}
arrow.left,
radio.left,
check.left {
2021-05-15 13:02:37 +08:00
margin-left: 4px - $container_padding;
margin-right: $container_padding;
2021-04-09 20:03:06 +08:00
}
arrow.right,
radio.right,
check.right {
2021-05-15 13:02:37 +08:00
margin-left: $container_padding;
margin-right: 4px - $container_padding;
2021-04-09 20:03:06 +08:00
}
modelbutton {
min-height: $menuitem_size - $container_padding;
2021-05-15 13:02:37 +08:00
min-width: $large_size * 2;
padding: $container_padding / 3 $container_padding;
2023-03-29 14:48:35 +08:00
border-radius: $bt_radius;
2021-05-15 13:51:25 +08:00
transition: none;
2021-11-28 11:53:51 +08:00
color: $text_color;
2021-04-09 20:03:06 +08:00
2021-05-15 13:51:25 +08:00
&:focus {
background-color: transparent;
color: $fg_color;
box-shadow: inset 0 0 0 2px rgba($fg_color, 0.06);
transition: none;
}
&:hover {
2021-04-09 20:03:06 +08:00
color: $selected_fg_color;
background-color: $selected_bg_color;
2023-10-13 06:42:06 +08:00
transition: background-color 50ms $deceleration_curve;
2023-10-13 06:36:42 +08:00
arrow { color: $selected_fg_color; }
2021-05-15 13:51:25 +08:00
}
&:hover:focus {
color: $selected_fg_color;
background-color: $selected_bg_color;
box-shadow: none;
2021-04-09 20:03:06 +08:00
}
&:selected:active {
color: $selected_fg_color;
2021-05-15 13:51:25 +08:00
transition: background-color $shorter_duration $deceleration_curve;
2024-10-30 18:05:53 +08:00
@if $gnome_version == 'old' {
background-color: darken($selected_bg_color, 5%);
} @else {
background-color: color-mix(in srgb, black 10%, $selected_bg_color);
}
2021-04-09 20:03:06 +08:00
}
}
label.title {
font-weight: bold;
2021-05-15 13:02:37 +08:00
padding: $container_padding / 2 ($container_padding + 20px); //this will fall apart with font sizing
2021-04-09 20:03:06 +08:00
}
}
2020-07-15 00:35:03 +08:00
//
// Notebooks and Tabs
//
2021-04-04 16:39:10 +08:00
%tabs_tab {
color: $disabled_fg_color;
background-color: transparentize($base_color, 1);
border: 1px solid transparent;
transition: all 150ms ease-out;
2021-12-06 13:37:42 +08:00
border-radius: 0;
padding: $container_padding - 4px $container_padding + 4px;
2022-05-07 09:30:42 +08:00
margin: 0;
box-shadow: none;
2021-04-04 16:39:10 +08:00
2022-10-09 16:53:12 +08:00
&:hover:not(:checked):not(:selected) {
2021-04-04 16:39:10 +08:00
color: mix($fg_color, $disabled_fg_color, 50%);
background-color: if($variant == 'light', rgba(white, 0.2), rgba(white, 0.05));
border-color: if($variant == 'light', darken($header_bg, 15%), lighten($header_bg, 5%));
2022-05-07 09:30:42 +08:00
box-shadow: none;
2021-04-04 16:39:10 +08:00
}
2022-10-09 16:53:12 +08:00
&:checked, &:selected {
2021-04-04 16:39:10 +08:00
color: $fg_color;
background-color: $header_bg;
border-color: if($variant == 'light', darken($header_bg, 15%), lighten($header_bg, 5%));
2022-05-07 09:30:42 +08:00
box-shadow: none;
2021-04-04 16:39:10 +08:00
}
}
2021-11-30 11:56:07 +08:00
%monterey_tab {
color: $disabled_fg_color;
background-color: transparentize($base_color, 1);
border: none;
transition: all 150ms ease-out;
border-radius: $bt_radius;
2021-12-06 13:37:42 +08:00
padding: $container_padding - 4px $container_padding + 4px;
2022-05-07 09:30:42 +08:00
margin: 0;
box-shadow: none;
2021-11-30 11:56:07 +08:00
2022-10-09 16:53:12 +08:00
&:hover:not(:checked):not(:selected){
2021-11-30 11:56:07 +08:00
color: mix($fg_color, $disabled_fg_color, 50%);
background-color: rgba($fg_color, 0.06);
2022-05-07 09:30:42 +08:00
box-shadow: none;
2021-11-30 11:56:07 +08:00
}
2022-10-09 16:53:12 +08:00
&:checked, &:selected {
2021-11-30 11:56:07 +08:00
color: $fg_color;
background-color: rgba($fg_color, 0.12);
2022-05-07 09:30:42 +08:00
box-shadow: none;
2021-11-30 11:56:07 +08:00
}
}
2020-07-15 00:35:03 +08:00
notebook {
padding: 0;
2021-12-06 13:37:42 +08:00
&.frame { border: 1px solid $solid_borders_color; }
2020-07-15 00:35:03 +08:00
> stack:not(:only-child) { // the :not(:only-child) is for "hidden" notebooks
background-color: $base_color;
}
> header {
2021-12-06 13:37:42 +08:00
@if $monterey == 'false' {
background-color: darken($header_bg, 10%);
2022-05-07 09:30:42 +08:00
border: none;
2020-07-15 00:35:03 +08:00
2021-12-06 13:37:42 +08:00
// Set box-shadow to make the header frame color more easy to see
// Set margin to hide the ugly borders around the header
&.top {
box-shadow: inset 0 1px $borders_color, inset 0 -1px $borders_color;
2020-07-15 00:35:03 +08:00
}
2021-12-06 13:37:42 +08:00
&.bottom {
box-shadow: inset 0 1px $borders_color, inset 0 -1px $borders_color;
2020-07-15 00:35:03 +08:00
}
2021-12-06 13:37:42 +08:00
&.right {
box-shadow: inset 1px 0 $borders_color, inset -1px 0 $borders_color;
2020-07-15 00:35:03 +08:00
}
2021-12-06 13:37:42 +08:00
&.left {
box-shadow: inset 1px 0 $borders_color, inset -1px 0 $borders_color;
}
} @else {
&.top {
border-bottom: 1px solid $borders_color;
}
&.bottom {
border-top: 1px solid $borders_color;
}
&.right {
border-left: 1px solid $borders_color;
}
&.left {
border-right: 1px solid $borders_color;
2020-07-15 00:35:03 +08:00
}
}
button.flat.toggle.popup {
2021-12-06 13:37:42 +08:00
min-width: $medium_size;
2020-07-15 00:35:03 +08:00
border: none;
box-shadow: none;
2021-12-06 13:37:42 +08:00
border-radius: $bt_radius;
padding: 0 $container_padding / 2;
@if $monterey == 'true' {
margin-top: -2px;
margin-bottom: -2px;
margin-left: $container_padding / 2;
}
2020-07-15 00:35:03 +08:00
&:active, &:checked {
color: $fg_color;
background-color: if($variant=='light', rgba(black, 0.20), rgba(white, 0.15));
}
}
@each $_pos, $_bpos in (top, bottom), (bottom, top), (right, left), (left, right) {
// sizing and borders
&.#{$_pos} {
2021-12-06 13:37:42 +08:00
@if $monterey == 'false' {
margin-#{$_pos}: -1px;
padding: 0;
} @else {
padding: $container_padding / 2;
}
2020-07-15 00:35:03 +08:00
2022-05-07 09:30:42 +08:00
> tabs {
margin: 0;
2024-08-31 16:58:31 +08:00
padding: 0;
2022-05-07 09:30:42 +08:00
> tab {
outline-offset: -4px;
min-width: 24px;
min-height: 24px;
@if $monterey == 'false' {
// tab overlap
+ tab {
@if $_pos==top or $_pos==bottom { margin-left: -1px; }
@else { margin-top: -1px; }
}
} @else {
+ tab {
@if $_pos==top or $_pos==bottom { margin-left: $container_padding / 2; }
@else { margin-top: $container_padding / 2; }
}
2021-12-06 13:37:42 +08:00
}
2020-07-15 00:35:03 +08:00
}
}
}
}
// overflow arrows
&.top, &.bottom {
> tabs > arrow.up {
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
&:last-child { margin-left: 2px; }
}
> tabs > arrow.down {
-gtk-icon-source: -gtk-icontheme('pan-start-symbolic');
&:first-child { margin-right: 2px; }
}
}
&.left, &.right {
> tabs > arrow.up {
-gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
&:last-child { margin-top: 2px; }
}
> tabs > arrow.down {
-gtk-icon-source: -gtk-icontheme('pan-up-symbolic');
&:first-child { margin-bottom: 2px; }
}
}
> tabs > arrow {
color: $disabled_fg_color;
&:hover { color: mix($fg_color, $disabled_fg_color, 50%); }
&:active { color: $fg_color; }
&:disabled { color: transparentize($disabled_fg_color,0.3); }
}
2021-12-06 13:37:42 +08:00
@if $monterey == 'false' {
&.top,
&.bottom {
> tabs > tab {
&:first-child { border-left: none; }
&:last-child { border-right: none; }
}
2020-07-15 00:35:03 +08:00
}
2021-12-06 13:37:42 +08:00
&.left,
&.right {
> tabs > tab {
&:first-child { border-top: none; }
&:last-child { border-bottom: none; }
}
2020-07-15 00:35:03 +08:00
}
}
2021-04-09 20:03:06 +08:00
> tabs > tab {
2021-12-06 13:37:42 +08:00
@if $monterey == 'false' {
@extend %tabs_tab;
} @else {
@extend %monterey_tab;
}
2020-07-15 00:35:03 +08:00
// close button
2021-12-06 13:37:42 +08:00
button.flat,
button.close-button,
button.image-button.flat {
2023-10-15 22:51:19 +08:00
border: none;
box-shadow: none;
2020-07-15 00:35:03 +08:00
border-radius: 3px;
padding: 0;
2023-10-15 22:51:19 +08:00
color: $alt_fg_color;
min-height: 16px;
min-width: 16px;
margin-top: 4px;
margin-bottom: 4px;
2021-12-06 13:37:42 +08:00
margin-left: $container_padding / 2;
2023-10-15 22:51:19 +08:00
margin-right: -$container_padding / 2;
2020-07-15 00:35:03 +08:00
&:hover {
color: $fg_color;
2023-10-15 22:51:19 +08:00
background-color: rgba($fg_color, 0.1);
2020-07-15 00:35:03 +08:00
}
2021-04-10 22:07:27 +08:00
&:active {
2020-07-15 00:35:03 +08:00
color: if($variant == 'light', darken($fg_color, 10%), lighten($fg_color, 10%));
2023-10-15 22:51:19 +08:00
background-color: rgba($fg_color, 0.2);
2020-07-15 00:35:03 +08:00
}
}
}
}
}
//
// Scrollbars
//
$_scrollbar_bg_color: if($variant == 'light', darken($base_color, 1%), lighten($base_color, 1%));
scrollbar {
$_slider_min_length: 40px;
background-color: transparent;
transition: 300ms $ease-out-quad;
2022-05-05 17:53:22 +08:00
outline: none;
2020-07-15 00:35:03 +08:00
2022-05-05 17:53:22 +08:00
&, button { border: none; }
2020-07-15 00:35:03 +08:00
&.vertical button {
&.down { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
&.up { -gtk-icon-source: -gtk-icontheme('pan-up-symbolic'); }
}
&.horizontal button {
&.down { -gtk-icon-source: -gtk-icontheme('pan-right-symbolic'); }
&.up { -gtk-icon-source: -gtk-icontheme('pan-left-symbolic'); }
}
// slider
2022-05-05 17:53:22 +08:00
> range > trough {
background: none;
padding: 0;
margin: 0;
border: none;
outline: none;
transition: none;
2020-07-15 00:35:03 +08:00
2022-05-05 17:53:22 +08:00
> slider {
2023-10-13 06:36:42 +08:00
min-width: $container_padding + 2px;
min-height: $container_padding + 2px;
margin: 0;
2022-05-05 17:53:22 +08:00
border: 4px solid transparent;
border-radius: $container_padding * 2;
background-clip: padding-box;
background-color: mix($fg_color, $bg_color, 40%);
box-shadow: none;
outline: none;
transition: all 200ms linear;
&:hover { background-color: mix($fg_color, $bg_color, 30%); }
&:hover:active { background-color: mix($fg_color, $bg_color, 50%); }
&:disabled { background-color: transparent; }
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
> range.fine-tune {
> trough > slider {
2021-05-15 13:02:37 +08:00
min-width: $container_padding - 2px;
min-height: $container_padding - 2px;
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
&.horizontal > trough > slider { border-width: 5px 4px; }
&.vertical > trough > slider { border-width: 4px 5px; }
2020-07-15 00:35:03 +08:00
}
&.overlay-indicator {
2022-05-05 17:53:22 +08:00
background: none;
color: inherit;
box-shadow: none;
padding: 0;
> range > trough {
outline: none;
background: none;
> slider {
outline: none;
}
}
2020-07-15 00:35:03 +08:00
&:not(.dragging):not(.hovering) {
opacity: 0.4;
border-color: transparent;
background-color: transparent;
2022-05-05 17:53:22 +08:00
box-shadow: none;
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> range > trough > slider {
2023-10-13 06:36:42 +08:00
margin: $container_padding / 2;
2021-05-15 13:02:37 +08:00
min-width: $container_padding - 2px;
min-height: $container_padding - 2px;
2020-07-15 00:35:03 +08:00
background-color: mix($fg_color, $bg_color, 70%);
2022-05-05 17:53:22 +08:00
border: none;
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
&.horizontal > range > trough > slider {
2020-07-15 00:35:03 +08:00
min-width: $_slider_min_length;
}
2021-04-09 20:03:06 +08:00
&.vertical > range > trough > slider {
2020-07-15 00:35:03 +08:00
min-height: $_slider_min_length;
}
}
&.dragging,
2023-10-13 06:36:42 +08:00
&.hovering { opacity: 1; }
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
&.horizontal > range > trough > slider { min-width: $_slider_min_length; }
&.vertical > range > trough > slider { min-height: $_slider_min_length; }
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
// treeview ~ scrollbar.vertical {
// border-top: 1px solid $borders_color;
// margin-top: -1px;
// }
2020-07-15 00:35:03 +08:00
//
// Switches
//
2020-12-26 21:44:54 +08:00
$switch_image: linear-gradient(0deg, rgba($fg_color, 0.25) 0%, rgba($fg_color, 0.35) 100%);
$switch_disabled_image: linear-gradient(0deg, rgba($fg_color, 0.1) 0%, rgba($fg_color, 0.15) 100%);
2022-10-09 16:02:36 +08:00
$switch_checked_backdrop_image: linear-gradient(0deg, rgba($fg_color, 0.45) 0%, rgba($fg_color, 0.55) 100%);
2024-10-30 18:05:53 +08:00
$switch_checked_image: '';
$switch_checked_disabled_image: '';
@if $gnome_version == 'old' {
$switch_checked_image: linear-gradient(0deg, lighten($selected_bg_color, 10%) 0%, $selected_bg_color 100%);
$switch_checked_disabled_image: linear-gradient(0deg, lighten($selected_bg_color, 35%) 0%, lighten($selected_bg_color, 25%) 100%);
} @else {
$switch_checked_image: linear-gradient(0deg, color-mix(in srgb, white 25%, $selected_bg_color) 0%, color-mix(in srgb, black 10%, $selected_bg_color) 100%);
$switch_checked_disabled_image: linear-gradient(0deg, color-mix(in srgb, white 35%, $selected_bg_color) 0%, color-mix(in srgb, white 25%, $selected_bg_color) 100%);
}
$switch_animation: switch_ripple_effect 0.1s cubic-bezier(0, 0, 0.2, 1);
2020-07-15 00:35:03 +08:00
2020-12-26 21:44:54 +08:00
@keyframes switch_ripple_effect {
from {
background-image: $switch_image, radial-gradient(circle farthest-corner at center,
transparent 0%,
transparent 0%);
2020-07-15 00:35:03 +08:00
}
2020-12-26 21:44:54 +08:00
to {
background-image: $switch_checked_image, radial-gradient(circle farthest-corner at center,
2025-04-05 10:26:27 +07:00
rgba($selected_bg_color, 0.75) 100%,
2024-10-30 18:05:53 +08:00
transparent 0%);
2020-07-15 00:35:03 +08:00
}
}
switch {
transition: $longer_transition;
2020-12-26 21:44:54 +08:00
border-radius: $circular_radius;
background-color: transparent;
2020-07-15 00:35:03 +08:00
background-clip: padding-box;
2020-12-26 21:44:54 +08:00
color: transparent;
2023-10-13 06:36:42 +08:00
min-width: 32px;
min-height: 20px;
2020-07-15 00:35:03 +08:00
font-size: 0;
2022-05-05 17:53:22 +08:00
padding: 0;
2020-12-26 21:44:54 +08:00
box-shadow: inset 0 1px 2px rgba(black, 0.1);
2024-10-30 18:05:53 +08:00
@if $gnome_version == 'old' {
background-image: $switch_image, radial-gradient(circle farthest-corner at center, transparent 0%, transparent 0%);
} @else {
background-image: $switch_image;
}
2020-07-15 00:35:03 +08:00
&:disabled {
2020-12-26 21:44:54 +08:00
color: transparent;
background-color: transparent;
background-image: $switch_disabled_image;
2020-07-15 00:35:03 +08:00
}
&:checked {
animation: $switch_animation;
2020-12-26 21:44:54 +08:00
background-color: transparent;
color: transparent;
box-shadow: inset 0 1px 2px rgba(black, 0.15);
2024-10-30 18:05:53 +08:00
transition: background-image 0.1s, box-shadow 0;
@if $gnome_version == 'old' {
background-image: $switch_checked_image, radial-gradient(circle farthest-corner at center, rgba($selected_bg_color, 0.75) 100%, transparent 0%);
} @else {
background-image: $switch_checked_image;
}
2020-07-15 00:35:03 +08:00
&:disabled {
2020-12-26 21:44:54 +08:00
background-color: transparent;
background-image: $switch_checked_disabled_image;
color: transparent;
2020-07-15 00:35:03 +08:00
}
2022-10-09 16:02:36 +08:00
&:backdrop {
background-color: transparent;
background-image: $switch_checked_backdrop_image;
color: transparent;
}
2022-10-08 13:57:46 +08:00
}
2021-04-09 20:03:06 +08:00
> slider {
2020-07-15 00:35:03 +08:00
transition: $longer_transition, $shadow_transition, margin 0;
2023-10-13 06:36:42 +08:00
min-width: 18px;
min-height: 18px;
2020-12-26 21:44:54 +08:00
margin: 1px 0 1px 1px;
2022-05-05 17:53:22 +08:00
padding: 0;
2020-12-26 21:44:54 +08:00
border-radius: $circular_radius;
2020-07-15 00:35:03 +08:00
background-color: white;
2020-12-26 21:44:54 +08:00
box-shadow: 0 1px 2px rgba(black, 0.15);
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
&, > slider {
outline-color: transparent;
color: transparent;
border: none;
}
&:hover > slider { box-shadow: $shadow_5; }
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&:checked > slider {
2020-12-26 21:44:54 +08:00
margin: 1px 1px 1px 0;
2020-07-15 00:35:03 +08:00
background-color: $selected_fg_color;
}
2021-04-09 20:03:06 +08:00
&:disabled > slider { @include entry(disabled); }
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&:checked:disabled > slider { animation: none; }
2020-07-15 00:35:03 +08:00
}
//
// Check and Radio items
//
2021-12-26 22:16:39 +08:00
.view.content-view.check:not(list),
.content-view .tile check:not(list) {
min-height: 40px;
min-width: 40px;
margin: 0;
padding: 0;
}
checkbutton, radiobutton {
2024-05-13 13:26:12 +08:00
padding: 2px 0;
2021-12-26 22:16:39 +08:00
// this is for a nice focus on check and radios text
&.text-button {
padding: 2px 0;
outline-offset: 0;
&:hover { color: darken($fg_color, 15%); }
&:disabled { color: $disabled_fg_color; }
}
label:not(:only-child) {
&:first-child { margin-left: 4px; }
&:last-child { margin-right: 4px; }
}
}
$check_radio_border: if($variant == 'light', rgba(black, 0.2), rgba(black, 0.1));
$check_radio_image: linear-gradient(0deg, #6a6a6a 0%, #545454 100%);
2024-10-30 18:05:53 +08:00
$check_radio_checked_image: '';
@if $gnome_version == 'old' {
$check_radio_checked_image: linear-gradient(0deg, darken($selected_bg_color, 5%) 0%, lighten($selected_bg_color, 5%) 100%);
} @else {
$check_radio_checked_image: linear-gradient(0deg, color-mix(in srgb, black 5%, $selected_bg_color) 0%, color-mix(in srgb, white 5%, $selected_bg_color) 100%);
}
2021-12-26 22:16:39 +08:00
check,
radio {
min-width: 14px;
min-height: 14px;
margin: 3px;
padding: 0;
color: transparent;
background-color: $base_color;
transition: $button_transition;
background-clip: padding-box;
border: none;
-gtk-icon-size: 14px;
@if $variant == 'dark' {
background-image: $check_radio_image;
box-shadow: inset 0 1px $highlight_color, 0 1px 2px rgba(black, 0.25);
&:hover {
box-shadow: inset 0 1px $highlight_color;
2020-07-15 00:35:03 +08:00
}
2021-12-26 22:16:39 +08:00
&:active {
box-shadow: inset 0 1px $highlight_color;
}
} @else {
box-shadow: inset 0 1px 2px rgba(black, 0.1), inset 0 0 0 1px $check_radio_border;
2020-07-15 00:35:03 +08:00
2021-12-26 22:16:39 +08:00
&:hover {
box-shadow: inset 0 0 0 1px $check_radio_border;
}
&:active {
box-shadow: inset 0 0 0 1px $check_radio_border;
2020-07-15 00:35:03 +08:00
}
}
2021-12-26 22:16:39 +08:00
&:disabled {
background-image: none;
background-color: if($variant == 'light', rgba(white, 0.45), rgba(white, 0.08));
@if $variant == 'light' {
box-shadow: inset 0 0 0 1px rgba(black, 0.08);
} @else { box-shadow: none; }
2020-07-15 00:35:03 +08:00
}
2021-12-26 22:16:39 +08:00
&:checked, &:indeterminate {
color: $selected_fg_color;
background-color: $selected_bg_color;
@if $variant == 'light' {
background-clip: border-box;
} @else {
background-image: $check_radio_checked_image;
2020-07-15 00:35:03 +08:00
}
2021-12-26 22:16:39 +08:00
&:hover {
@if $variant == 'light' {
box-shadow: inset 0 0 0 1px $check_radio_border;
} @else {
box-shadow: inset 0 1px $highlight_color;
}
}
&:active {
background-color: $selected_bg_color;
@if $variant == 'light' {
box-shadow: inset 0 0 0 1px $check_radio_border;
} @else {
box-shadow: inset 0 1px $highlight_color;
}
}
&:disabled {
color: $alt_disabled_fg_color;
background-image: none;
background-color: if($variant == 'light', rgba(white, 0.45), rgba(white, 0.08));
@if $variant == 'light' {
box-shadow: inset 0 0 0 1px rgba(black, 0.08);
} @else { box-shadow: none; }
}
2020-07-15 00:35:03 +08:00
}
}
2021-12-26 22:16:39 +08:00
%check,
check {
border-radius: 3px;
2022-05-05 17:53:22 +08:00
&:checked { -gtk-icon-source: -gtk-scaled(-gtk-recolor(url("assets/scalable/checkbox-checked-symbolic.svg")),
-gtk-recolor(url("assets/scalable/checkbox-checked-symbolic@2.svg"))); }
&:indeterminate { -gtk-icon-source: -gtk-scaled(-gtk-recolor(url("assets/scalable/checkbox-mixed-symbolic.svg")),
-gtk-recolor(url("assets/scalable/checkbox-mixed-symbolic@2.svg"))); }
2021-12-26 22:16:39 +08:00
}
%radio,
2020-07-15 00:35:03 +08:00
radio {
2021-12-26 22:16:39 +08:00
border-radius: $circular_radius;
2020-07-15 00:35:03 +08:00
2022-05-05 17:53:22 +08:00
&:checked { -gtk-icon-source: -gtk-scaled(-gtk-recolor(url("assets/scalable/radio-checked-symbolic.svg")),
-gtk-recolor(url("assets/scalable/radio-checked-symbolic@2.svg"))); }
&:indeterminate { -gtk-icon-source: -gtk-scaled(-gtk-recolor(url("assets/scalable/radio-mixed-symbolic.svg")),
-gtk-recolor(url("assets/scalable/radio-mixed-symbolic@2.svg"))); }
2020-07-15 00:35:03 +08:00
}
//
// GtkScale
//
scale {
2021-05-15 13:02:37 +08:00
$_marks_length: $container_padding / 2;
2020-07-15 00:35:03 +08:00
$_marks_distance: 1px;
min-height: 15px;
min-width: 15px;
2021-05-15 13:02:37 +08:00
padding: $container_padding / 2;
2020-07-15 00:35:03 +08:00
// The slider is inside the trough, negative margin to make it bigger
2021-04-20 18:54:01 +08:00
> trough > slider {
2020-07-15 00:35:03 +08:00
min-height: 15px;
min-width: 15px;
margin: -7px;
}
// Click-and-hold the slider to activate
&.fine-tune {
// Make the trough grow in fine-tune mode
2021-04-20 18:54:01 +08:00
> trough > slider { margin: -4px; }
2020-07-15 00:35:03 +08:00
2021-04-20 18:54:01 +08:00
> trough > fill,
> trough > highlight,
> trough {
2020-07-15 00:35:03 +08:00
border-radius: 5px;
}
}
// Trough
2021-04-09 20:03:06 +08:00
> trough {
2020-07-15 00:35:03 +08:00
$_scale_trough_bg: rgba(black, 0.2);
outline-offset: 2px;
border-radius: $bt_radius;
background-color: $_scale_trough_bg;
&:disabled { background-color: rgba($_scale_trough_bg, 0.12); }
//OSD troughs
.osd & {
background-color: $_scale_trough_bg;
highlight {
background-color: $selected_bg_color;
}
}
// Troughs in selected list-rows and infobars
2021-04-24 23:14:31 +08:00
modelbutton:hover &,
2020-07-15 00:35:03 +08:00
row:selected &,
infobar & {
background-color: transparentize(black, 0.8);
2021-04-09 20:03:06 +08:00
> trough > highlight {
2020-07-15 00:35:03 +08:00
background-color: $selected_fg_color;
2024-10-30 18:05:53 +08:00
&:disabled { background-color: rgba($selected_fg_color, 0.5); }
2020-07-15 00:35:03 +08:00
}
&:disabled { background-color: transparentize(black, 0.9); }
}
}
// The colored part of trough
2021-04-09 20:03:06 +08:00
> trough > highlight {
2020-07-15 00:35:03 +08:00
border-radius: $bt_radius;
background-color: $selected_bg_color;
2024-10-30 18:05:53 +08:00
&:disabled { background-color: rgba($selected_bg_color, 0.55); }
2020-07-15 00:35:03 +08:00
}
// this is another differently styled part of the trough, the most relevant use case is for example
// in media player to indicate how much video stream as been cached
2021-04-09 20:03:06 +08:00
> trough > fill {
2020-07-15 00:35:03 +08:00
border-radius: $bt_radius;
2024-10-30 18:05:53 +08:00
background-color: rgba($selected_bg_color, 0.5);
2020-07-15 00:35:03 +08:00
&:disabled { background-color: transparent; }
}
2021-04-09 20:03:06 +08:00
> trough > slider {
2020-07-15 00:35:03 +08:00
$_slider_border: if($variant=='light', transparentize(darken($button_border, 0%), 0), transparentize($button_border, 0));
background-color: $selected_fg_color;
border: 1px solid $_slider_border;
border-radius: 100%;
box-shadow: $shadow_2;
2022-05-05 17:53:22 +08:00
background-clip: padding-box;
2020-07-15 00:35:03 +08:00
transition: $button_transition;
transition-property: background, border;
2022-05-05 17:53:22 +08:00
outline: none;
2020-07-15 00:35:03 +08:00
&:hover {
2022-05-05 17:53:22 +08:00
background-color: lighten($selected_fg_color, 3%);
border-color: $_slider_border;
box-shadow: $shadow_0;
}
2020-07-15 00:35:03 +08:00
&:active {
background-color: $selected_fg_color;
border-color: $_slider_border;
box-shadow: $shadow_3;
}
&:disabled {
background-color: darken($selected_fg_color, 5%);
border-color: darken($_slider_border, 5%);
2022-05-05 17:53:22 +08:00
box-shadow: none;
2020-07-15 00:35:03 +08:00
}
// Selected list-row and infobar sliders
2021-04-24 23:14:31 +08:00
modelbutton:hover &,
2020-07-15 00:35:03 +08:00
row:selected &,
infobar & {
background-color: $selected_fg_color;
border-color: $selected_fg_color;
2024-10-30 18:05:53 +08:00
@if $gnome_version == 'old' {
&:hover {
background-color: mix($selected_fg_color, $selected_bg_color, 85%);
border-color: mix($selected_fg_color, $selected_bg_color, 85%);
}
&:active {
background-color: mix($selected_fg_color, $selected_bg_color, 50%);
border-color: mix($selected_fg_color, $selected_bg_color, 50%);
}
&:disabled {
background-color: mix($selected_fg_color, $selected_bg_color, 55%);
border-color: mix($selected_fg_color, $selected_bg_color, 55%);
}
} @else {
&:hover {
background-color: color-mix(in srgb, $selected_fg_color 85%, $selected_bg_color);
border-color: color-mix(in srgb, $selected_fg_color 85%, $selected_bg_color);
}
&:active {
background-color: color-mix(in srgb, $selected_fg_color 50%, $selected_bg_color);
border-color: color-mix(in srgb, $selected_fg_color 50%, $selected_bg_color);
}
&:disabled {
background-color: color-mix(in srgb, $selected_fg_color 55%, $selected_bg_color);
border-color: color-mix(in srgb, $selected_fg_color 55%, $selected_bg_color);
}
2020-07-15 00:35:03 +08:00
}
}
// OSD sliders
.osd & {
background-color: $selected_fg_color;
border-color: $_slider_border;
&:hover {
background-color: lighten($selected_fg_color, 3%);
border-color: $_slider_border;
box-shadow: $shadow_0;
}
&:active {
background-color: darken($selected_fg_color, 3%);
border-color: $_slider_border;
box-shadow: $shadow_3;
}
}
}
2021-04-09 20:03:06 +08:00
> value { color: gtkalpha(currentColor, 0.4); }
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> marks {
2020-07-15 00:35:03 +08:00
color: gtkalpha(currentColor, 0.4);
@each $marks_class, $marks_pos, $marks_margin in (top, top, bottom),
(bottom, bottom, top),
(top, left, right),
(bottom, right, left) {
&.#{$marks_class} {
margin-#{$marks_margin}: $_marks_distance;
margin-#{$marks_pos}: -($_marks_distance + $_marks_length);
}
}
}
2021-04-09 20:03:06 +08:00
&.fine-tune > marks {
2020-07-15 00:35:03 +08:00
@each $marks_class, $marks_pos, $marks_margin in (top, top, bottom),
(bottom, bottom, top),
(top, left, right),
(bottom, right, left) {
&.#{$marks_class} {
margin-#{$marks_margin}: ($_marks_distance - 1px);
margin-#{$marks_pos}: -($_marks_distance + $_marks_length - 2px);
}
}
}
2022-05-05 17:53:22 +08:00
2020-07-15 00:35:03 +08:00
&.horizontal {
indicator {
min-height: $_marks_length;
min-width: 1px;
}
&.fine-tune indicator { min-height: ($_marks_length - 1px); }
}
2022-05-05 17:53:22 +08:00
2020-07-15 00:35:03 +08:00
&.vertical {
indicator {
min-height: 1px;
min-width: $_marks_length;
}
&.fine-tune indicator { min-width: ($_marks_length - 1px); }
}
// *WARNING* scale with marks madness following
// FIXME: OSD and selected list rows missing, I don't feel like adding the other 144 assets needed for those...
2022-05-05 17:53:22 +08:00
// $suffix: if($variant == 'light', '', '-dark');
2020-07-15 00:35:03 +08:00
@each $dir_class, $dir_infix in ('horizontal', 'horz'),
('vertical', 'vert') {
@each $marks_infix, $marks_class in ('scale-has-marks-above', 'marks-before:not(.marks-after)'),
('scale-has-marks-below', 'marks-after:not(.marks-before)') {
@each $state, $state_infix in ('', ''),
(':hover', '-hover'),
(':active', '-active'),
(':disabled', '-insensitive') {
&.#{$dir_class}.#{$marks_class} {
slider {
2022-05-05 17:53:22 +08:00
transform: none;
2020-07-15 00:35:03 +08:00
&#{$state} {
// an asymmetric slider asset is used here, so the margins are uneven, the smaller
// margin is set on the point side.
margin: -10px;
$_scale_asset: 'assets/slider-#{$dir_infix}-#{$marks_infix}#{$state_infix}';
border-style: none;
border-radius: 0;
background-color: transparent;
background-image: -gtk-scaled(url('#{$_scale_asset}.png'), url('#{$_scale_asset}@2.png'));
$_scale_slider_bg_pos: bottom;
@if $dir_class == 'horizontal' {
min-height: 26px;
min-width: 24px;
@if $marks_infix == 'scale-has-marks-above' {
margin-top: -14px;
$_scale_slider_bg_pos: top;
}
@else { margin-bottom: -14px; }
}
@else {
min-height: 24px;
min-width: 26px;
@if $marks_infix == 'scale-has-marks-above' {
margin-left: -14px;
$_scale_slider_bg_pos: left bottom;
}
@else {
margin-right: -14px;
$_scale_slider_bg_pos: right bottom;
}
}
background-position: $_scale_slider_bg_pos;
background-repeat: no-repeat;
box-shadow: none;
}
}
&.fine-tune slider {
// bigger negative margins to make the trough grow here as well
margin: -7px;
@if $dir_class == 'horizontal' {
@if $marks_infix == 'scale-has-marks-above' { margin-top: -11px; }
@else { margin-bottom: -11px; }
}
@else {
@if $marks_infix == 'scale-has-marks-above' { margin-left: -11px; }
@else { margin-right: -11px; }
}
}
}
}
}
}
}
//
// Progress bars
//
progressbar {
padding: 0;
font-size: smaller;
color: transparentize($fg_color, 0.3);
2021-04-09 20:03:06 +08:00
font-feature-settings: "tnum";
// sizing
&.horizontal {
> trough {
min-width: 150px;
&, > progress {
min-height: 4px;
border-radius: 2px;
}
}
}
&.vertical {
> trough {
min-height: 80px;
&, > progress {
min-width: 4px;
border-radius: 2px;
}
}
}
2021-04-24 23:14:31 +08:00
// &.horizontal > trough > progress { margin: 0 -1px; } // the progress node is positioned after the trough border
// &.vertical > trough > progress { margin: -1px 0; } // this moves it over it.
2020-07-15 00:35:03 +08:00
&.osd {
2021-05-15 13:02:37 +08:00
min-width: $container_padding / 2;
min-height: $container_padding / 2;
2020-07-15 00:35:03 +08:00
background-color: transparent;
2024-04-19 19:44:17 +08:00
box-shadow: none;
border: none;
margin: 0;
padding: 0;
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> trough {
2020-07-15 00:35:03 +08:00
border-style: none;
background-color: transparent;
box-shadow: none;
}
2021-04-09 20:03:06 +08:00
> progress {
border-style: none;
border-radius: 0;
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
2020-07-15 00:35:03 +08:00
// Moving bit
2021-04-09 20:03:06 +08:00
> trough > progress {
2021-06-30 13:19:55 +08:00
// min-height: $container_padding - 2px;
// min-width: $container_padding - 2px;
2020-07-15 00:35:03 +08:00
background-color: $progress_color;
border: none;
border-radius: $bt_radius;
box-shadow: none; //needed for clipping
row:selected &,
infobar & { background-color: $selected_fg_color; }
}
2021-04-09 20:03:06 +08:00
2020-07-15 00:35:03 +08:00
// Trough
2021-04-09 20:03:06 +08:00
> trough {
2021-05-15 13:02:37 +08:00
min-height: $container_padding - 2px;
min-width: $container_padding - 2px;
2020-07-15 00:35:03 +08:00
border: none;
border-radius: $bt_radius;
background-color: if($variant == 'light', $button_border, darken($bg_color, 5%));
row:selected &,
infobar & { background-color: transparentize(black, 0.8); }
}
}
//
// Level Bar
//
levelbar {
block {
min-width: 32px;
min-height: 1px;
}
2021-04-09 20:03:06 +08:00
2020-07-15 00:35:03 +08:00
&.vertical block {
min-width: 1px;
min-height: 32px;
}
trough {
border: none;
2021-05-15 13:02:37 +08:00
padding: $container_padding / 2;
2020-07-15 00:35:03 +08:00
border-radius: $bt_radius;
background-color: if($variant == 'light', $button_border, darken($bg_color, 5%));
}
&.horizontal.discrete block { margin: 0 1px; }
&.vertical.discrete block { margin: 1px 0; }
block:not(.empty) {
border: 1px solid $selected_bg_color;
background-color: $selected_bg_color;
border-radius: $bt_radius;
}
block.low {
border-color: $warning_color;
background-color: $warning_color;
}
block.high {
border-color: $selected_bg_color;
background-color: $selected_bg_color;
}
block.full {
border-color: $success_color;
background-color: $success_color;
}
block.empty {
background-color: if($variant=='light', transparentize($fg_color,0.8), $base_color);
border-color: if($variant=='light', transparentize($fg_color,0.8), $base_color);
}
}
//
// Print dialog
//
2021-04-09 20:03:06 +08:00
window.dialog.print {
drawing {
color: $fg_color;
background: none;
border: none;
2020-07-15 00:35:03 +08:00
padding: 0;
2021-04-09 20:03:06 +08:00
paper {
border: 1px solid $borders_color;
background: $base_color;
padding: 0;
}
2020-07-15 00:35:03 +08:00
}
2021-05-15 13:02:37 +08:00
.dialog-action-box { margin: $container_padding * 2; }
2020-07-15 00:35:03 +08:00
}
//
// Frames
//
2021-04-09 20:03:06 +08:00
frame,
.frame {
2020-07-15 00:35:03 +08:00
border: 1px solid $borders_color;
2021-04-09 20:03:06 +08:00
2021-06-06 13:43:37 +08:00
> list {
border: none;
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
frame {
border-radius: $wm_radius;
> label {
2021-05-15 13:02:37 +08:00
margin: $container_padding - 2px;
2021-04-09 20:03:06 +08:00
}
2021-06-06 13:43:37 +08:00
> list {
border-radius: $wm_radius - 2px;
2024-08-31 16:58:31 +08:00
box-shadow: none;
2021-06-06 13:43:37 +08:00
}
2020-07-15 00:35:03 +08:00
}
scrolledwindow {
viewport.frame { // avoid double borders when viewport inside scrolled window
2021-06-06 08:53:23 +08:00
border: none;
.frame {
border: none;
> textview {
border-radius: $bt_radius;
background: none;
> text {
border-radius: $bt_radius;
border: 1px solid $borders_color;
}
}
}
> box.vertical list.content.view {
border-top-left-radius: $wm_radius;
border-top-right-radius: $wm_radius;
}
> box.vertical list.frame {
@extend %circular_list;
padding: 0;
> row.activatable { @extend %circular_row; }
list {
border: none;
box-shadow: none;
border-radius: 0;
margin: 0;
background: none;
> row.activatable {
&, &:first-child, &:last-child {
border-radius: 0;
}
}
}
}
2020-07-15 00:35:03 +08:00
}
// 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.
2021-04-09 20:03:06 +08:00
> overshoot {
2024-11-07 10:44:13 +08:00
&.top { @include overshoot(top); }
&.bottom { @include overshoot(bottom); }
&.left { @include overshoot(left); }
&.right { @include overshoot(right); }
2020-07-15 00:35:03 +08:00
}
// Overflow indication, works similarly to the overshoot, the size if fixed tho.
2022-10-09 16:02:36 +08:00
> undershoot {
background: none;
border: none;
padding: 0;
}
2020-07-15 00:35:03 +08:00
2023-10-13 06:36:42 +08:00
&.undershoot-top {
@include undershoot(top);
}
&.undershoot-bottom {
@include undershoot(bottom);
}
&.undershoot-start {
&:dir(ltr) { @include undershoot(left); }
&:dir(rtl) { @include undershoot(right); }
}
&.undershoot-end {
&:dir(ltr) { @include undershoot(right); }
&:dir(rtl) { @include undershoot(left); }
}
2021-04-09 20:03:06 +08:00
> junction { // the small square between two scrollbars
2022-10-09 16:02:36 +08:00
border: none;
2020-07-15 00:35:03 +08:00
background-color: $_scrollbar_bg_color;
2022-10-09 16:02:36 +08:00
// &:dir(rtl) { border-style: solid solid none none; }
2020-07-15 00:35:03 +08:00
}
}
//vbox and hbox separators
separator {
background-color: $borders_color;
min-width: 1px;
min-height: 1px;
2022-05-05 17:53:22 +08:00
&.spacer {
background: none;
&.horizontal { min-width: $container_padding * 2; }
&.vertical { min-height: $container_padding * 2; }
}
2020-07-15 00:35:03 +08:00
}
//
// Lists
//
2022-04-17 22:49:54 +08:00
listview,
2020-07-15 00:35:03 +08:00
list {
background-color: $base_color;
border-color: $borders_color;
2022-04-17 22:49:54 +08:00
background-clip: padding-box;
2021-11-28 11:53:51 +08:00
color: $fg_color;
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> row {
2022-04-17 22:49:54 +08:00
background-clip: padding-box;
&.expander { padding: 0; }
2022-05-05 17:53:22 +08:00
&.expander .row-header { padding: $container_padding / 2; }
2022-04-17 22:49:54 +08:00
}
&.horizontal row.separator,
&.separators.horizontal > row:not(.separator) {
border-left: 1px solid $borders_color;
}
&:not(.horizontal) row.separator,
&.separators:not(.horizontal) > row:not(.separator) {
border-bottom: 1px solid $borders_color;
2021-04-09 20:03:06 +08:00
}
2021-06-06 08:53:23 +08:00
&.content:not(.conversation-listbox) {
@extend %circular_list;
> row {
@extend %circular_row;
}
}
2020-07-15 00:35:03 +08:00
}
2021-11-28 11:53:51 +08:00
listview.view {
color: $fg_color;
background-color: transparent;
}
2020-07-15 00:35:03 +08:00
%row_activatable {
&.has-open-popup,
2024-06-19 18:50:25 +08:00
&:hover { background-color: $fill_color; }
2020-07-15 00:35:03 +08:00
&:active {
color: $fg_color;
2024-06-19 18:50:25 +08:00
background-color: $track_color;
2020-07-15 00:35:03 +08:00
transition-duration: 200ms;
}
&:disabled {
color: $disabled_fg_color;
image { color: inherit; }
}
&:selected {
&, &:active {
color: $fg_color;
2024-06-19 18:50:25 +08:00
background-color: $visit_color;
2020-07-15 00:35:03 +08:00
}
&.has-open-popup,
2024-06-19 18:50:25 +08:00
&:hover { background-color: $track_color; }
2020-07-15 00:35:03 +08:00
}
}
row {
2022-04-17 22:49:54 +08:00
background-clip: padding-box;
label.subtitle {
font-size: smaller;
@extend .dim-label;
}
> box.header {
margin-left: $container_padding * 2;
margin-right: $container_padding * 2;
min-height: $large_size;
> .icon:disabled {
filter: opacity($disabled_opacity);
}
> box.title {
margin-top: $container_padding;
margin-bottom: $container_padding;
border-spacing: $container_padding / 2;
}
}
2020-07-15 00:35:03 +08:00
&:not(:hover) { transition: all 300ms $ease-out-quad; }
button.circular { @extend %circular_button; }
2022-10-09 16:02:36 +08:00
button &.activatable {
&:focus, &:hover, &:active { background: none; }
}
2020-07-15 00:35:03 +08:00
&:selected {
color: $fg_color;
2024-06-19 18:50:25 +08:00
background-color: $visit_color;
2020-07-15 00:35:03 +08:00
// button { @extend %selected-button; }
}
&.activatable {
@extend %row_activatable;
}
2022-04-17 22:49:54 +08:00
&.combo {
image.dropdown-arrow:disabled {
filter: opacity($disabled_opacity);
}
listview.inline {
background: none;
border: none;
box-shadow: none;
color: inherit;
&, &:disabled {
background: none;
color: inherit;
}
}
popover > contents {
min-width: 120px;
}
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
columnview {
// move padding to child cells
> listview > row {
padding: 0;
// align horizontal sizing with header buttons
> cell {
2021-05-15 13:02:37 +08:00
padding: $container_padding + 2px $container_padding;
2021-04-09 20:03:06 +08:00
&:not(:first-child) {
border-left: 1px solid transparent;
}
}
}
// make column separators visible when :show-column-separators is true
&.column-separators > listview > row > cell {
border-left-color: $borders_color;
}
// shrink vertically for .data-table
&.data-table > listview > row > cell {
padding-top: 2px;
padding-bottom: 2px;
}
}
treeexpander {
2021-05-15 13:02:37 +08:00
border-spacing: $container_padding;
2021-04-09 20:03:06 +08:00
}
columnview row:not(:selected) cell editablelabel:not(.editing):focus-within {
outline: 2px solid $borders_color;
}
columnview row:not(:selected) cell editablelabel.editing:focus-within {
outline: 2px solid $selected_bg_color;
}
columnview row:not(:selected) cell editablelabel.editing text selection {
color: $selected_fg_color;
background-color: $selected_bg_color;
}
.rich-list { /* rich lists usually containing other widgets than just labels/text */
2024-06-19 18:50:25 +08:00
> row {
padding: 8px 12px;
2021-04-09 20:03:06 +08:00
min-height: 32px; /* should be tall even when only containing a label */
2024-06-19 18:50:25 +08:00
> box {
border-spacing: 12px;
}
}
> header {
padding-left: 12px;
padding-right: 12px;
}
}
/****************
* AdwActionRow *
****************/
row {
label.subtitle {
font-size: smaller;
@extend .dim-label;
}
> box.header {
margin-left: 12px;
margin-right: 12px;
border-spacing: 6px;
min-height: 50px;
> .icon:disabled {
filter: opacity($disabled_opacity);
}
> box.title {
margin-top: 6px;
margin-bottom: 6px;
border-spacing: 3px;
padding: 0;
// Specificity bump for header bar
&,
> .title,
> .subtitle {
padding: 0;
font-weight: inherit;
}
}
> .prefixes,
> .suffixes {
border-spacing: 6px;
}
> .icon,
> .prefixes {
&:dir(ltr) { margin-right: 6px; }
&:dir(rtl) { margin-left: 6px; }
}
}
&.property > box.header > box.title > {
.title {
font-size: smaller;
@extend .dim-label;
}
.subtitle {
font-size: inherit;
opacity: 1;
}
}
&.property.monospace {
font-family: inherit;
& > box.header > box.title > .subtitle {
font-family: monospace;
}
}
}
/******************************
* AdwEntryRow and AdwSpinRow *
******************************/
row.entry {
&:disabled {
text {
opacity: $disabled_opacity;
}
.dim-label, .subtitle {
opacity: 1;
}
}
.edit-icon, .indicator {
min-width: 24px;
min-height: 24px;
padding: 5px;
}
.edit-icon:disabled {
opacity: $disabled_opacity;
}
.indicator {
opacity: $hint_opacity;
}
&.monospace {
font-family: inherit;
text {
font-family: monospace;
}
}
}
row.spin {
spinbutton {
2024-12-08 00:30:13 +08:00
border-spacing: $container_padding;
2024-06-19 18:50:25 +08:00
2024-12-08 00:30:13 +08:00
&, &:focus, &:focus-within, &:hover, &:active {
2024-06-19 18:50:25 +08:00
outline: none;
2024-12-08 00:30:13 +08:00
box-shadow: none;
background: none;
2024-06-19 18:50:25 +08:00
}
> button.image-button.up:not(.flat):not(.raised):not(.suggested-action):not(.destructive-action):not(.opaque):last-child,
> button.image-button.down:not(.flat):not(.raised):not(.suggested-action):not(.destructive-action):not(.opaque) {
&, &:dir(ltr):last-child, &:dir(rtl):first-child {
@extend %button_basic;
@extend %circular_button;
min-width: 30px;
min-height: 30px;
margin: 10px 2px;
border: none;
}
}
}
&:disabled spinbutton {
> button.image-button.up:not(.flat):not(.raised):not(.suggested-action):not(.destructive-action):not(.opaque):last-child,
> button.image-button.down:not(.flat):not(.raised):not(.suggested-action):not(.destructive-action):not(.opaque) {
&, &:dir(ltr):last-child, &:dir(rtl):first-child {
&:disabled {
filter: none;
}
}
}
}
}
row.entry,
row.spin {
outline: none;
&:not(:selected).activatable.focused:hover,
&:not(:selected).activatable.focused:active {
background-color: transparent;
}
@each $e_type in error, warning, success {
&.#{$e_type} {
color: $primary_color;
.dim-label, .subtitle {
opacity: 1;
}
}
}
}
/***************
* AdwComboRow *
***************/
row.combo {
image.dropdown-arrow:disabled {
filter: opacity($disabled_opacity);
}
listview.inline {
background: none;
border: none;
box-shadow: none;
color: inherit;
&, &:disabled {
background: none;
color: inherit;
}
}
popover > contents {
min-width: 120px;
.combo-searchbar {
margin: 6px;
+ scrolledwindow {
@include undershoot(top);
}
}
}
}
/******************
* AdwExpanderRow *
******************/
@mixin margin-start($margin) {
&:dir(ltr) {
margin-left: $margin;
}
&:dir(rtl) {
margin-right: $margin;
}
}
row.expander {
// Drop transparent background on expander rows to let nested rows handle it,
// avoiding double highlights.
background: none;
padding: 0px;
> box > list {
background: none;
color: inherit;
}
list.nested {
2024-08-03 21:55:15 +08:00
background-color: rgba($base_color, 0.5);
2024-06-19 18:50:25 +08:00
color: inherit;
}
list.nested > row {
@extend %boxed_list_row;
}
// AdwExpanderRow arrow rotation
image.expander-row-arrow {
@extend .dim-label;
transition: -gtk-icon-transform 200ms $ease-out-quad;
@include margin-start(3px);
&:dir(ltr) {
-gtk-icon-transform: rotate(0.5turn);
}
&:dir(rtl) {
-gtk-icon-transform: rotate(-0.5turn);
}
&:disabled {
filter: opacity($disabled_opacity);
}
}
&:checked image.expander-row-arrow {
-gtk-icon-transform: rotate(0turn);
opacity: 1;
&:not(:disabled) {
color: $primary_color;
}
}
.osd &:checked image.expander-row-arrow:not(:disabled) {
color: inherit;
}
&.property box > list > row {
@extend .property;
}
}
/***************
* AdwButtonRow *
***************/
row.button {
> box {
margin-left: 12px;
margin-right: 12px;
border-spacing: 6px;
min-height: 42px;
> .icon:disabled {
filter: opacity($disabled_opacity);
}
}
.title {
@extend .heading;
}
}
/*****************
* Boxed Lists *
*****************/
%boxed_list_row {
outline: none;
border: none;
&.has-open-popup,
&:hover { background-color: $fill_color; }
&:active {
color: $fg_color;
background-color: $track_color;
transition-duration: 200ms;
}
&:disabled {
color: $disabled_fg_color;
image { color: inherit; }
}
&:selected {
&, &:active {
color: $fg_color;
background-color: $visit_color;
}
&.has-open-popup,
&:hover { background-color: $track_color; }
}
& + row {
border-top: 1px solid transparent;
border-image: linear-gradient(to right,
transparent 0%,
transparent 2%,
$menu_bd 2%,
$menu_bd 98%,
transparent 98%,
transparent 100%) 1 0 0 0 / 1px 0 0 0 stretch;
}
&:hover, &:active, &:selected {
&, & + row {
border-image: none;
}
}
}
list.boxed-list {
@extend %circular_list;
> row {
// Regular rows and expander header rows background
&, &.expander row.header {
@extend %boxed_list_row;
}
&.expander {
border: none;
}
// Rounded top
&:first-child {
&, &.expander row.header {
border-top-left-radius: $bd_radius;
border-top-right-radius: $bd_radius;
}
}
// Rounded bottom
&:last-child {
&,
&.expander:not(:checked),
&.expander:not(:checked) row.header,
&.expander:checked list.nested,
&.expander:checked list.nested > row:last-child {
border-bottom-left-radius: $bd_radius;
border-bottom-right-radius: $bd_radius;
border-bottom-width: 0;
}
}
}
}
list.boxed-list-separate {
color: $fg_color;
2024-10-16 16:08:24 +08:00
@extend %circular_list;
2024-06-19 18:50:25 +08:00
> row {
border: none;
margin-bottom: 12px;
outline: none;
2024-10-16 16:08:24 +08:00
box-shadow: none;
background-color: transparent;
@extend %boxed_list_row;
@extend %circular_row;
2024-06-19 18:50:25 +08:00
&:selected {
background-color: $visit_color;
}
&:last-child {
margin-bottom: 0;
}
&:not(.expander) {
&:not(:selected).activatable {
&:hover {
background-color: $base_color;
2024-08-03 21:55:15 +08:00
background-image: image(gtkalpha(currentColor, 0.03));
2024-06-19 18:50:25 +08:00
}
&:active {
background-color: $base_color;
2024-08-03 21:55:15 +08:00
background-image: image(gtkalpha(currentColor, 0.08));
2024-06-19 18:50:25 +08:00
}
&.has-open-popup {
background-color: $base_color;
2024-08-03 21:55:15 +08:00
background-image: image(gtkalpha(currentColor, 0.03));
2024-06-19 18:50:25 +08:00
}
}
}
&.entry, &.spin {
&:not(:selected).activatable.focused:hover,
&:not(:selected).activatable.focused:active {
background-color: $base_color;
background-image: none;
}
}
&.expander {
row.header {
@extend %boxed_list_row;
border-top-left-radius: $bd_radius;
border-top-right-radius: $bd_radius;
}
&:not(:checked) row.header,
&.expander:checked list.nested,
&.expander:checked list.nested > row:last-child {
border-bottom-left-radius: $bd_radius;
border-bottom-right-radius: $bd_radius;
border-bottom: none;
}
2021-04-09 20:03:06 +08:00
}
}
}
2020-07-15 00:35:03 +08:00
//
// App Notifications
//
.app-notification {
2021-05-15 13:02:37 +08:00
padding: $container_padding;
2021-04-10 22:07:27 +08:00
margin: 6px 16px 16px 16px;
2020-07-15 00:35:03 +08:00
color: $fg_color;
background-color: rgba($header_bg, 0.85);
// background-image: linear-gradient(0deg, $bg_color 0%, $bg_color 85%, darken($bg_color, 5%) 95%, darken($bg_color, 15%) 100%);
2021-04-10 22:07:27 +08:00
border-radius: $wm_radius;
2020-07-15 00:35:03 +08:00
border: none;
2021-04-10 22:07:27 +08:00
box-shadow: 0 5px 15px 0 rgba(black, 0.25),
inset 0 0 0 1px rgba(white, 0.06),
0 0 0 1px if($variant=='light', rgba(black, 0.12), rgba(black, 0.75));
2020-07-15 00:35:03 +08:00
border { border: none; }
button {
@extend %undecorated_button;
2021-04-10 22:07:27 +08:00
min-height: 22px;
padding: 2px 8px;
2020-07-15 00:35:03 +08:00
&:not(.text-button).image-button {
@extend %circular_button;
}
&:hover { @include button(flat-hover); }
&:active, &:checked { @include button(flat-active); }
&:disabled { @include button(flat-insensitive); }
}
}
//
// Expanders
//
expander {
2022-04-17 22:49:54 +08:00
min-width: 16px;
min-height: 16px;
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
2020-07-15 00:35:03 +08:00
2022-04-17 22:49:54 +08:00
&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
&:hover { color: lighten($fg_color,30%); } //only lightens the arrow
&:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
&:disabled { filter: opacity($disabled_opacity); }
2021-04-09 20:03:06 +08:00
}
expander-widget {
> box > title {
border-radius: $bt_radius;
2022-04-17 22:49:54 +08:00
> expander {
opacity: .7;
}
2021-04-09 20:03:06 +08:00
&:hover > expander {
2022-04-17 22:49:54 +08:00
opacity: 1;
2021-04-09 20:03:06 +08:00
}
}
}
.navigation-sidebar,
placessidebar,
stackswitcher,
expander-widget {
&:not(decoration):not(window):drop(active):focus,
&:not(decoration):not(window):drop(active) {
box-shadow: none;
2020-07-15 00:35:03 +08:00
}
}
//
// Calendar
//
%calendar,
calendar {
color: $fg_color;
border: 1px solid $borders_color;
border-radius: $bt_radius;
2021-05-15 13:02:37 +08:00
padding: 2px $container_padding;
2020-07-15 00:35:03 +08:00
margin: 0;
2021-04-09 20:03:06 +08:00
> header {
color: $fg_color;
border-bottom: 1px solid $borders_color;
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> button {
border: none;
box-shadow: none;
background: none;
border-radius: 0;
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&:hover { background-color: rgba($fg_color, 0.1); }
&:active { background-color: $selected_bg_color; }
}
> button:backdrop {
background: none;
}
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
> grid {
> label.today {
background-color: rgba($fg_color, 0.15);
border-radius: 3px;
&:selected {
box-shadow: none;
}
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> label:focus {
2021-04-24 23:14:31 +08:00
outline-style: none;
2021-04-09 20:03:06 +08:00
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> label.day-number {
padding: 4px;
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&:selected {
@extend %selected_items;
border-radius: $bt_radius;
}
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> label.day-number.other-month {
color: gtkalpha(currentColor, 0.3);
}
}
2020-07-15 00:35:03 +08:00
}
//
// Dialogs
//
2021-04-09 20:16:57 +08:00
$messagedialog_bg: if($trans == 'true', rgba($bg_color, 0.95), $bg_color);
2021-04-09 20:03:06 +08:00
window.dialog.message { // Message Dialog styling
2024-08-03 23:21:57 +08:00
&.background { background-color: $messagedialog_bg; }
2020-07-15 00:35:03 +08:00
.titlebar {
min-height: 28px;
2024-08-03 23:21:57 +08:00
background-color: transparent;
2020-07-15 00:35:03 +08:00
border: none;
}
2021-04-09 20:03:06 +08:00
box.dialog-vbox.vertical {
border-spacing: 10px;
}
& label.title {
font-weight: 800;
font-size: 15pt;
}
2020-07-15 00:35:03 +08:00
.dialog-action-area {
2021-05-15 13:02:37 +08:00
padding: $container_padding;
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> button {
2020-07-15 00:35:03 +08:00
min-height: 20px;
2021-05-15 13:02:37 +08:00
padding: ($container_padding - 2px) ($container_padding + 2px);
2020-07-15 00:35:03 +08:00
box-shadow: none;
border-radius: $bt_radius;
2022-10-19 13:13:06 +08:00
margin: $container_padding / 2;
2020-07-15 00:35:03 +08:00
border: none;
&:not(.suggested-action):not(.destructive-action) {
border-radius: $bt_radius;
background-color: transparent;
&:hover {
@include button(flat-hover);
transition: $button_transition;
}
2021-05-29 19:07:17 +08:00
&:active {
@include button(active);
2020-07-15 00:35:03 +08:00
}
}
&.suggested-action, &.destructive-action {
border-radius: $bt_radius;
}
}
}
}
2022-10-19 13:13:06 +08:00
window.background.messagedialog {
.response-area {
padding: $container_padding;
button {
min-height: 20px;
padding: ($container_padding - 2px) ($container_padding + 2px);
box-shadow: none;
border-radius: $bt_radius;
margin: $container_padding / 2;
border: none;
&:not(.suggested-action):not(.destructive-action) {
border-radius: $bt_radius;
background-color: transparent;
&:hover {
@include button(flat-hover);
transition: $button_transition;
}
&:active {
@include button(active);
}
}
&.suggested-action, &.destructive-action {
border-radius: $bt_radius;
}
}
2024-02-23 11:16:41 +08:00
separator { background-color: transparent; }
2022-10-19 13:13:06 +08:00
}
}
2022-04-17 22:49:54 +08:00
window.aboutdialog image.large-icons {
-gtk-icon-size: 128px;
}
2020-07-15 00:35:03 +08:00
//
2021-04-08 12:12:34 +08:00
// Filechooser
2020-07-15 00:35:03 +08:00
//
2021-04-08 12:12:34 +08:00
filechooser {
2022-05-05 17:53:22 +08:00
paned.horizontal > separator {
background-image: image($header_border);
2021-04-08 12:12:34 +08:00
}
2022-05-05 17:53:22 +08:00
#pathbarbox { border-bottom: 1px solid $borders_color; }
2021-04-08 12:12:34 +08:00
}
2021-04-10 22:07:27 +08:00
// Filechooser, we put this here to give a different style between csd and
// ssd on certain DE-s
2021-04-09 20:03:06 +08:00
filechooserbutton > button > box {
2021-05-15 13:02:37 +08:00
border-spacing: $container_padding;
2021-04-09 20:03:06 +08:00
}
filechooserbutton:drop(active) {
box-shadow: none;
border-color: transparent;
}
2021-04-08 12:12:34 +08:00
//
// Sidebar
//
2021-04-04 16:39:10 +08:00
%sidebar_left {
2022-05-05 17:53:22 +08:00
border-right: 1px solid $header_border;
2021-04-04 16:39:10 +08:00
border-left-style: none;
}
%sidebar_right {
2022-05-05 17:53:22 +08:00
border-left: 1px solid $header_border;
2021-04-04 16:39:10 +08:00
border-right-style: none;
}
2020-07-15 00:35:03 +08:00
.sidebar {
border-style: none;
background-color: $bg_color;
2021-04-10 22:07:27 +08:00
&:dir(ltr),
&.left,
&.left:dir(rtl) { @extend %sidebar_left; }
&:dir(rtl),
&.right { @extend %sidebar_right; }
2020-07-15 00:35:03 +08:00
list {
background-color: transparent;
> separator {
min-height: 0;
background: none;
border: none;
}
}
2021-04-08 12:12:34 +08:00
paned & { &.left, &.right, &.left:dir(rtl), &:dir(rtl), &:dir(ltr), & { border: none; }}
2020-07-15 00:35:03 +08:00
}
2022-05-05 17:53:22 +08:00
separator.sidebar {
background-color: $header_border;
min-height: 1px;
min-width: 1px;
2022-10-23 09:35:36 +08:00
border: none;
&:dir(ltr),
&.left,
&.left:dir(rtl),
&:dir(rtl),
&.right { border: none; }
2022-05-05 17:53:22 +08:00
}
2020-07-15 00:35:03 +08:00
stacksidebar {
2021-04-09 20:03:06 +08:00
list.separators:not(.horizontal) > row:not(.separator) {
border-bottom: none;
}
2020-07-15 00:35:03 +08:00
row {
2021-05-15 13:02:37 +08:00
padding: $container_padding - 2px;
2020-07-15 00:35:03 +08:00
> label {
2021-05-15 13:02:37 +08:00
padding-left: $container_padding;
padding-right: $container_padding;
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
2020-07-15 00:35:03 +08:00
&.needs-attention > label {
@extend %needs_attention;
2021-05-15 13:02:37 +08:00
background-size: $container_padding $container_padding, 0 0;
2020-07-15 00:35:03 +08:00
}
}
}
2021-04-09 20:03:06 +08:00
// Navigation Sidebar
.navigation-sidebar {
2022-10-09 17:27:14 +08:00
background-color: $dark_sidebar_bg;
2023-10-13 06:36:42 +08:00
padding: $container_padding; //only vertical padding. horizontal row size would clip
2021-04-09 20:03:06 +08:00
> separator {
2022-05-07 09:30:42 +08:00
margin: $container_padding 0;
2022-10-09 17:27:14 +08:00
background: none;
2021-04-09 20:03:06 +08:00
}
> row {
min-height: 36px;
2021-05-15 13:02:37 +08:00
padding: 0 $container_padding + 2px;
2021-04-09 20:03:06 +08:00
border-radius: $bt_radius;
2023-10-13 06:36:42 +08:00
margin: 0;
outline: none;
+ row { margin-top: $container_padding / 2; }
2021-04-09 20:03:06 +08:00
&:hover,
&:focus-visible:focus-within {
background-color: rgba($fg_color, 0.1);
}
&:active {
color: $fg_color;
background-color: rgba($fg_color, 0.2);
}
&:selected {
color: $fg_color;
background-color: rgba($fg_color, 0.15);
&:hover {
background-color: rgba($fg_color, 0.2);
}
&:focus-visible:focus-within {
2023-10-13 06:36:42 +08:00
outline: none;
color: $fg_color;
background-color: rgba($fg_color, 0.15);
&:hover { background-color: rgba($fg_color, 0.2); }
2021-04-09 20:03:06 +08:00
}
}
&:disabled { color: $disabled_fg_color; }
}
}
2020-07-15 00:35:03 +08:00
placessidebar {
> viewport.frame { border-style: none; }
2021-04-09 20:03:06 +08:00
.navigation-sidebar > row {
2020-07-15 00:35:03 +08:00
// Needs overriding of the GtkListBoxRow padding
min-height: 24px;
2021-05-15 13:02:37 +08:00
padding: ($container_padding - 4px) ($container_padding + 4px);
2020-07-15 00:35:03 +08:00
// Using margins/padding directly in the SidebarRow
// will make the animation of the new bookmark row jump
> revealer {
2022-10-19 13:13:06 +08:00
padding: 0;
2020-07-15 00:35:03 +08:00
}
image.sidebar-icon {
2021-05-15 13:02:37 +08:00
&:dir(ltr) { padding-right: $container_padding; }
&:dir(rtl) { padding-left: $container_padding; }
2020-07-15 00:35:03 +08:00
}
label.sidebar-label {
2021-05-15 13:02:37 +08:00
&:dir(ltr) { padding-right: $container_padding; }
&:dir(rtl) { padding-left: $container_padding; }
2020-07-15 00:35:03 +08:00
}
2021-01-16 15:30:07 +08:00
button.sidebar-button {
2021-05-15 13:02:37 +08:00
min-width: $small_size + 2px;
min-height: $small_size + 2px;
2020-07-15 00:35:03 +08:00
margin-top: 2px;
margin-bottom: 2px;
padding: 0;
2021-05-15 13:02:37 +08:00
border-radius: $circular_radius;
2020-07-15 00:35:03 +08:00
> image { opacity: 0.85 };
&:active, &:checked {
@include button(flat-active);
border-color: if($variant=='light', rgba(black, 0.3), $dark_borders_color);
}
&:not(:hover):not(:active) > image { opacity: 0.65 };
}
&:selected button.sidebar-button {
@include button(normal);
&:active, &:checked {
@include button(flat-active);
2021-01-16 15:30:07 +08:00
border-color: if($variant=='light', rgba(black, 0.25), rgba(black, 0.15));
2020-07-15 00:35:03 +08:00
}
}
&.sidebar-placeholder-row {
2021-05-15 13:02:37 +08:00
padding: 0 $container_padding + 2px;
2020-07-15 00:35:03 +08:00
min-height: 2px;
background-image: _solid($drop_target_color);
background-clip: content-box;
}
&.sidebar-new-bookmark-row { color: $selected_bg_color; }
&:drop(active):not(:disabled) {
2023-10-13 06:36:42 +08:00
color: $drop_target_color;
2020-07-15 00:35:03 +08:00
box-shadow: inset 0 1px $drop_target_color,
inset 0 -1px $drop_target_color;
&:selected {
2023-10-13 06:36:42 +08:00
color: $dark_sidebar_fg;
2020-07-15 00:35:03 +08:00
background-color: $drop_target_color;
}
}
}
}
//
// Placesview
//
placesview {
.server-list-button > image {
-gtk-icon-transform: rotate(0turn);
}
.server-list-button:checked > image {
transition: 200ms $ease-out-quad;
-gtk-icon-transform: rotate(-0.5turn);
}
// this selects the "connect to server" label
> actionbar > revealer > box > label {
padding-left: 8px;
padding-right: 8px;
}
}
//
// Paned
//
2022-05-07 09:30:42 +08:00
2020-07-15 00:35:03 +08:00
paned {
> separator {
min-width: 1px;
min-height: 1px;
2022-05-07 09:30:42 +08:00
background: none;
2020-07-15 00:35:03 +08:00
background-size: 1px 1px;
&.wide {
min-width: 5px;
min-height: 5px;
}
}
&.horizontal > separator {
&:dir(ltr) {
margin: 0 -8px 0 0;
padding: 0 8px 0 0;
2022-05-07 09:30:42 +08:00
box-shadow: inset 1px 0 $borders_color;
2020-07-15 00:35:03 +08:00
}
&:dir(rtl) {
margin: 0 0 0 -8px;
padding: 0 0 0 8px;
2022-05-07 09:30:42 +08:00
box-shadow: inset -1px 0 $borders_color;
2020-07-15 00:35:03 +08:00
}
&.wide {
margin: 0;
padding: 0;
2022-05-07 09:30:42 +08:00
box-shadow: inset 1px 0 $borders_color,
inset -1px 0 $borders_color;
2020-07-15 00:35:03 +08:00
}
}
&.vertical > separator {
margin: 0 0 -8px 0;
padding: 0 0 8px 0;
2022-05-07 09:30:42 +08:00
box-shadow: inset 0 1px $borders_color;
2020-07-15 00:35:03 +08:00
&.wide {
margin: 0;
padding: 0;
2022-05-07 09:30:42 +08:00
box-shadow: inset 0 1px $borders_color,
inset 0 -1px $borders_color;
2020-07-15 00:35:03 +08:00
}
}
}
//
// GtkInfoBar
//
infobar {
border-style: none;
&.info {
& > revealer > box,
&:backdrop > revealer > box {
2021-04-08 12:34:27 +08:00
background-color: $selected_bg_color;
selection { color: $selected_bg_color; }
}
}
&.question {
& > revealer > box,
&:backdrop > revealer > box {
2021-04-08 12:34:27 +08:00
background-color: $suggested_color;
selection { color: $suggested_color; }
}
}
&.warning {
& > revealer > box,
&:backdrop > revealer > box {
2021-04-08 12:34:27 +08:00
background-color: $warning_color;
selection { color: $warning_color; }
}
}
&.error {
& > revealer > box,
&:backdrop > revealer > box {
2021-04-08 12:34:27 +08:00
background-color: $error_color;
selection { color: $error_color; }
}
}
2020-07-15 00:35:03 +08:00
&.info,
&.question,
&.warning,
&.error {
& > revealer > box,
&:hover > revealer > box,
&:backdrop > revealer > box {
color: $selected_fg_color;
caret-color: currentColor;
2020-07-15 00:35:03 +08:00
button {
min-height: 28px;
@extend %selected-button;
}
2020-07-15 00:35:03 +08:00
2021-04-08 12:34:27 +08:00
selection {
background-color: $selected_fg_color;
}
2021-04-24 23:14:31 +08:00
link { @extend %link_selected; }
}
2020-07-15 00:35:03 +08:00
}
}
2021-04-09 20:03:06 +08:00
infobar .close,
searchbar .close {
@include button(undecorated);
min-width: 16px;
min-height: 16px;
padding: 4px;
border-radius: 1000px;
&:hover { @include button(flat-hover); }
}
2020-07-15 00:35:03 +08:00
//
// 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.
2025-02-14 12:29:06 +08:00
background-color: rgba($osd_bg_color, 0.96);
2020-07-15 00:35:03 +08:00
background-clip: padding-box;
2025-02-14 12:29:06 +08:00
border-radius: $wm_radius;
2021-04-10 22:07:27 +08:00
color: $osd_fg_color;
2025-02-14 12:29:06 +08:00
border: 1px solid $wm_shadow;
box-shadow: inset 0 0 0 1px $highlight_color;
2020-07-15 00:35:03 +08:00
2021-05-15 13:02:37 +08:00
label { padding: $container_padding; }
2020-07-15 00:35:03 +08:00
}
2025-02-14 12:29:06 +08:00
border-radius: $wm_radius;
2020-07-15 00:35:03 +08:00
box-shadow: none;
2021-04-09 20:03:06 +08:00
> box {
2021-05-15 13:02:37 +08:00
border-spacing: $container_padding;
2020-07-15 00:35:03 +08:00
}
}
//
// Color Chooser
//
colorswatch {
// 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.
$_colorswatch-radius: 2px;
&, &:drop(active) { border-style: none; }
// border rounding
&.top {
border-top-left-radius: $_colorswatch-radius + 0.5px;
border-top-right-radius: $_colorswatch-radius + 0.5;
overlay {
border-top-left-radius: $_colorswatch-radius;
border-top-right-radius: $_colorswatch-radius;
}
}
&.bottom {
border-bottom-left-radius: $_colorswatch-radius + 0.5px;
border-bottom-right-radius: $_colorswatch-radius + 0.5;
overlay {
border-bottom-left-radius: $_colorswatch-radius;
border-bottom-right-radius: $_colorswatch-radius;
}
}
&.left, &:first-child:not(.top) {
border-top-left-radius: $_colorswatch_radius + 0.5px;
border-bottom-left-radius: $_colorswatch_radius + 0.5px;
overlay {
border-top-left-radius: $_colorswatch_radius;
border-bottom-left-radius: $_colorswatch_radius;
}
}
&.right, &:last-child:not(.bottom) {
border-top-right-radius: $_colorswatch_radius + 0.5px;
border-bottom-right-radius: $_colorswatch_radius + 0.5px;
overlay {
border-top-right-radius: $_colorswatch_radius;
border-bottom-right-radius: $_colorswatch_radius;
}
}
&.dark overlay {
color: transparentize(white, 0.3);
&:hover {
border-color: if($variant == 'light', transparentize(black, 0.5), $borders_color);
}
}
&.light overlay {
color: transparentize(black, 0.3);
&:hover {
border-color: if($variant == 'light', transparentize(black, 0.7), $borders_color);
}
}
overlay {
border: 1px solid if($variant == 'light', transparentize(black, 0.85), $borders_color);
&:hover { background-color: transparentize(white, 0.8) }
}
&:disabled {
opacity: 0.5;
overlay {
border-color: transparentize(black, 0.4);
box-shadow: none;
}
}
&#add-color-button {
border-style: solid; // the borders are drawn by the overlay for standard colorswatches to have them semi
border-width: 1px; // translucent on the colored background, here it's not necessary so they need to be set
@include button(normal);
&:hover { @include button(hover); }
overlay { @include button(undecorated); } // reset the overlay to not cover the button style underneath
}
}
button.color {
padding: 0;
2022-04-17 22:49:54 +08:00
> colorswatch:only-child {
border-radius: 3px;
> overlay {
border-radius: 2px;
}
&:disabled {
filter: none;
}
&.light > overlay {
border-color: $borders_color;
}
}
2020-07-15 00:35:03 +08:00
colorswatch:first-child:last-child {
2022-04-17 22:49:54 +08:00
margin: $container_padding / 2;
&, > overlay {
border-radius: 3px;
2020-07-15 00:35:03 +08:00
}
}
}
// colorscale popup
colorchooser .popover.osd { border-radius: $bt_radius; }
//
// Misc
//
//content view (grid/list)
.content-view {
background-color: $base_color;
2021-04-09 20:03:06 +08:00
&:hover { -gtk-icon-filter: brightness(1.2); }
.tile {
margin: 2px;
background-color: if($variant=='light', transparent, black);
border-radius: 0;
padding: 0;
&:active, &:selected { background-color: if($variant=='light', transparent, $selected_bg_color); }
&:disabled { background-color: if($variant=='light', transparent, mix($bg_color, $base_color, 60%)); }
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
> rubberband { @extend %rubberband; }
2020-07-15 00:35:03 +08:00
}
.scale-popup {
2021-04-09 20:03:06 +08:00
// .osd & { @extend %osd; }
.osd & button.flat { //FIXME: quick hack, redo properly
border-style: none;
border-radius: $bt_radius;
}
2020-07-15 00:35:03 +08:00
button { // +/- buttons on GtkVolumeButton popup
2021-04-09 20:03:06 +08:00
border: none;
@extend %flat_button;
2020-07-15 00:35:03 +08:00
}
}
// Decouple the font of context menus from their entry/textview
.context-menu { font: initial; }
2022-11-19 23:35:36 +08:00
// .monospace { font-family: Monospace; }
2020-07-15 00:35:03 +08:00
//
// Shortcuts Help
//
.keycap {
2021-05-15 13:02:37 +08:00
min-width: $small_size - 4px;
min-height: $small_size;
2020-07-15 00:35:03 +08:00
2021-05-15 13:02:37 +08:00
padding: $container_padding / 2 $container_padding;
2020-07-15 00:35:03 +08:00
color: $fg_color;
background-color: $base_color;
border: 1px solid $borders_color;
border-radius: $bt_radius;
box-shadow: inset 0px -2px 0px if($variant=='light', transparentize(black, 0.95), transparentize(black, 0.85));
}
stackswitcher {
button.text-button { min-width: 80px; }
button.circular {
@extend %circular_button;
}
}
2022-08-21 01:57:06 +08:00
shortcuts-section { margin: 20px; }
2020-07-15 00:35:03 +08:00
//
// Dnd
//
*:drop(active):focus,
*:drop(active) {
box-shadow: inset 0 0 0 1px $drop_target_color;
}
//
// Window Decorations
//
2021-04-09 20:03:06 +08:00
window {
2022-11-30 23:15:07 +08:00
border: none;
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&.csd {
transition: none;
2021-04-09 20:03:06 +08:00
border-radius: $wm_radius;
2022-11-30 23:15:07 +08:00
outline: 1px solid $highlight_color;
outline-offset: -1px;
box-shadow: 0 3px 6px $wm_shadow,
0 7px 12px $wm_shadow,
0 12px 20px $wm_shadow,
2020-12-26 21:44:54 +08:00
$wm_outline;
2021-06-30 09:09:32 +08:00
margin: 0;
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&:backdrop {
transition: $shadow_transition;
2021-04-09 20:03:06 +08:00
// the transparent shadow here is to enforce that the shadow extents don't
// change when we go to backdrop, to prevent jumping windows
box-shadow: 0 3px 6px $wm_shadow_backdrop,
0 7px 12px $wm_shadow_backdrop,
0 12px 20px transparent,
2021-04-09 20:03:06 +08:00
$wm_outline;
}
2020-07-15 00:35:03 +08:00
2022-11-30 23:15:07 +08:00
&.tiled,
&.tiled-top,
&.tiled-left,
&.tiled-right,
&.tiled-bottom {
2021-04-09 20:03:06 +08:00
border-radius: 0;
2022-11-30 23:15:07 +08:00
outline: none;
}
&.maximized,
&.fullscreen {
border-radius: 0;
outline: none;
2021-04-09 20:03:06 +08:00
box-shadow: none;
2022-11-30 23:15:07 +08:00
transition: none;
2021-04-09 20:03:06 +08:00
}
2024-10-30 18:41:44 +08:00
&.ssd-frame {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
outline: none;
@if $variant == 'dark' {
headerbar {
border-top-left-radius: $wm_radius;
border-top-right-radius: $wm_radius;
box-shadow: inset 0 1px $highlight_color;
}
&.maximized,
&.fullscreen {
headerbar {
border-top-left-radius: 0;
border-top-right-radius: 0;
box-shadow: none;
}
}
}
}
2020-07-15 00:35:03 +08:00
}
2022-11-30 23:15:07 +08:00
&.solid-csd {
border: 1px solid $header_border;
border-radius: 0;
margin: 0;
background-color: $header_bg;
box-shadow: none;
2020-07-15 00:35:03 +08:00
}
2024-10-30 18:41:44 +08:00
// server-side decorations as used by mutter
&.ssd {
// just doing borders, wm draws actual shadows
box-shadow: 0 0 0 1px rgba(black, if($variant == 'light', 0.15, 0.75));
2020-07-15 00:35:03 +08:00
}
}
2022-10-09 16:02:36 +08:00
//
// Emoji
//
2020-07-15 00:35:03 +08:00
popover.emoji-picker {
padding: 0;
border-radius: $wm_radius;
2021-04-09 20:03:06 +08:00
> contents {
padding: 0;
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
.emoji-searchbar {
padding: 6px;
border-spacing: 6px;
border-bottom: 1px solid $borders_color;
2022-10-09 16:02:36 +08:00
entry { margin: 0; }
2021-04-09 20:03:06 +08:00
}
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
.emoji-toolbar {
2022-10-09 16:02:36 +08:00
padding: $container_padding / 2;
border-spacing: 0;
2021-04-09 20:03:06 +08:00
border-top: 1px solid $borders_color;
2020-07-15 00:35:03 +08:00
}
// mimic tab style
button.emoji-section {
2021-05-15 13:02:37 +08:00
margin: $container_padding / 2 1px;
padding: 1px $container_padding * 2;
2020-07-18 18:22:07 +08:00
border-radius: $bt_radius;
2020-07-15 00:35:03 +08:00
border: none;
outline-offset: -2px;
box-shadow: none;
2020-07-18 18:22:07 +08:00
transition: none;
animation: none;
2021-05-15 13:02:37 +08:00
&:first-child { margin-left: $container_padding; }
&:last-child { margin-right: $container_padding; }
2020-07-15 00:35:03 +08:00
}
2021-04-09 20:03:06 +08:00
popover.emoji-picker emoji {
font-size: x-large;
2021-05-15 13:02:37 +08:00
padding: $container_padding;
2021-04-09 20:03:06 +08:00
border-radius: $bt_radius;
2020-07-15 00:35:03 +08:00
2021-04-09 20:03:06 +08:00
&:focus,
&:hover {
@extend %selected_items;
2020-07-15 00:35:03 +08:00
}
}
2021-04-09 20:03:06 +08:00
emoji-completion-row > box {
2021-05-15 13:51:25 +08:00
border-spacing: $container_padding;
2021-05-15 13:02:37 +08:00
padding: $container_padding / 2 $container_padding + 4px;
2021-04-09 20:03:06 +08:00
}
emoji-completion-row:focus,
emoji-completion-row:hover {
background-color: $selected_bg_color;
color: $selected_fg_color;
}
emoji-completion-row emoji:focus,
emoji-completion-row emoji:hover {
background-color: $borders_color;
}
popover.entry-completion > contents {
padding: 0;
}
statusbar {
2021-05-15 13:02:37 +08:00
padding: $container_padding $container_padding * 2;
2024-10-30 18:05:53 +08:00
}