Improve dark theme (#733)

* Fix unreadable hovered link color in dark theme

* Tone down text color

* Make search result titles look like links

* Tone down search result title color

* Give the dark theme headerbar a distinct color

* Adjust background color for sort dropdown
This commit is contained in:
Zebreus 2024-03-07 00:18:56 +01:00 committed by GitHub
parent e268f57ec7
commit b8edfd2364
Failed to generate hash of commit

View file

@ -37,7 +37,7 @@
// Define darkmode colors // Define darkmode colors
:root { :root {
--text-color: #ffffff; --text-color: rgba(255, 255, 255, 0.85);
--text-color-light: rgba(255, 255, 255, 0.5); --text-color-light: rgba(255, 255, 255, 0.5);
--text-color-warning: #f8e45c; --text-color-warning: #f8e45c;
--background-color: #242424; --background-color: #242424;
@ -50,7 +50,7 @@
--terminal-color: var(--text-color); --terminal-color: var(--text-color);
--line-color: #ffffff26; // Color for separating lines --line-color: #ffffff26; // Color for separating lines
--dark-blue: #5277C3; // Blue background --dark-blue: #5277C3; // Blue background
--light-blue: #7EBAE4; // Blue text --light-blue: #7ebae4;
--result-item-show-more-background: var(--background-color); --result-item-show-more-background: var(--background-color);
--result-item-show-more-color: var(--text-color); --result-item-show-more-color: var(--text-color);
@ -61,8 +61,8 @@
--search-sidebar-selected-link-color: var(--text-color); --search-sidebar-selected-link-color: var(--text-color);
/* Divider between search results */ /* Divider between search results */
--search-result-divider-line-color: var(--line-color); --search-result-divider-line-color: var(--line-color);
/* Gets overwritten by bootstrap; has no effect */ /* Color of the search results */
--search-result-title-color: var(--text-color); // #08c; --search-result-title-color: var(--light-blue);
/* Text color for the details in a search result (like name, version, outputs...) */ /* Text color for the details in a search result (like name, version, outputs...) */
--search-result-short-details-color: var(--text-color-light); // #666; --search-result-short-details-color: var(--text-color-light); // #666;
/* When search results are expanded, they show tabbed help for installing the result. This is the border color for that tabbed thing. /* When search results are expanded, they show tabbed help for installing the result. This is the border color for that tabbed thing.
@ -82,8 +82,7 @@
--color-active-hover-tab: #404040; --color-active-hover-tab: #404040;
/* Headerbar background color */ /* Headerbar background color */
--headerbar-background-color: var(--background-color); --headerbar-background-color: #303030;
// --headerbar-background-color: #303030;
} }
// Override bootstrap styles for some common things. // Override bootstrap styles for some common things.
@ -161,34 +160,36 @@
// Override bootstrap colors for the sort dropdown // Override bootstrap colors for the sort dropdown
.search-results { .search-results {
.dropdown { .dropdown {
&.open { border-radius: 4px;
background: var(--button-background);
}
button.btn:hover {
background: var(--hover-background);
}
.caret { .caret {
border-top-color: var(--text-color) !important; border-top-color: var(--text-color) !important;
} }
background: var(--background-color); &.open>button.btn {
transition: background 0.2s; background: var(--button-active-background);
border-radius: 4px;
&:hover {
background: var(--button-active-hover-background);
}
}
&>button.btn {
background: var(--button-background);
&:hover {
background: var(--button-hover-background);
}
button.btn {
&:focus:not(:focus-visible) { &:focus:not(:focus-visible) {
outline: none !important; outline: none !important;
} }
border-radius: 4px; border-radius: 4px;
background: inherit;
color: var(--text-color); color: var(--text-color);
border: none; border: none;
text-shadow: none; text-shadow: none;
box-shadow: none; box-shadow: none;
transition: background 0.2s;
} }
} }
@ -204,6 +205,7 @@
margin: 4px; margin: 4px;
a { a {
border-radius: 4px;
color: var(--text-color); color: var(--text-color);
background: inherit; background: inherit;
transition: background 0.2s; transition: background 0.2s;
@ -212,8 +214,6 @@
a::before { a::before {
content: none !important; content: none !important;
} }
overflow: hidden;
} }
.header, .header,
@ -787,10 +787,6 @@ header .navbar.navbar-static-top {
} }
// // programs
// & > :nth-child(3) {
// }
// maintainers and platforms // maintainers and platforms
& > :nth-child(4) { & > :nth-child(4) {
margin-top: 1em; margin-top: 1em;
@ -921,10 +917,21 @@ header .navbar.navbar-static-top {
background: var(--info-label-background); background: var(--info-label-background);
} }
a { // Use the same color for focused and hovered links, as they are underlined anyway
a,
a:focus,
a:hover,
a:focus-visible {
color: var(--link-color); color: var(--link-color);
} }
// // Alternative: Use a slightly more contrasty color
// a:focus,
// a:hover,
// a:focus-visible {
// color: color-mix(in srgb, var(--link-color) 80%, var(--text-color) 20%)
// }
.pager { .pager {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;