mirror of
https://github.com/Vestride/fancy-index.git
synced 2026-01-14 10:12:04 +01:00
- refactor colors to css variables - add dark color set - use prefers-color-scheme media query to set dark color scheme
162 lines
3.1 KiB
CSS
162 lines
3.1 KiB
CSS
:root {
|
|
--color-bg: white;
|
|
--color-text: #404040;
|
|
--color-table-bg: white;
|
|
--color-table-bg--head: #efefef;
|
|
--color-table-bg--even: whitesmoke;
|
|
--color-table-text: #222222;
|
|
--color-link-text: #3498db;
|
|
--color-link-text--visited: #8e44ad;
|
|
--color-search-text: #8e44ad;
|
|
--color-search-bg: white;
|
|
--color-search-border: rgba(0, 0, 0, .15);
|
|
--color-search-border--focus: #8e44ad;
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
:root {
|
|
--color-bg: #222222;
|
|
--color-text: #bbb;
|
|
--color-table-bg: #222222;
|
|
--color-table-bg--head: #181818;
|
|
--color-table-bg--even: #333;
|
|
--color-table-text: #ccc;
|
|
--color-link-text: #3096d5;
|
|
--color-link-text--visited: #9e4ebf;
|
|
--color-search-text: #9e4ebf;
|
|
--color-search-bg: #181818;
|
|
--color-search-border: rgba(255, 255, 255, .15);
|
|
--color-search-border--focus: #9e4ebf;
|
|
}
|
|
}
|
|
|
|
body {
|
|
margin: 0;
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
font-weight: 300;
|
|
color: var(--color-text);
|
|
background-color: var(--color-bg);
|
|
}
|
|
|
|
table {
|
|
width: 100%;
|
|
background: var(--color-table-bg);
|
|
border: 0;
|
|
table-layout: auto;
|
|
}
|
|
|
|
table thead {
|
|
background: var(--color-table-bg--head);
|
|
}
|
|
|
|
table tr th,
|
|
table tr td {
|
|
padding: 0.5625rem 0.625rem;
|
|
font-size: 0.875rem;
|
|
color: var(--color-table-text);
|
|
text-align: left;
|
|
line-height: 1.125rem;
|
|
}
|
|
|
|
table thead tr th {
|
|
padding: 0.5rem 0.625rem 0.625rem;
|
|
font-weight: bold;
|
|
}
|
|
|
|
table tr.even {
|
|
background: var(--color-table-bg--even);
|
|
}
|
|
|
|
a {
|
|
text-decoration: none;
|
|
color: var(--color-link-text);
|
|
}
|
|
|
|
a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
a:visited {
|
|
color: var(--color-link-text--visited);
|
|
}
|
|
|
|
.img-wrap {
|
|
vertical-align: middle;
|
|
display: inline-block;
|
|
margin-right: 8px;
|
|
width: 16px;
|
|
height: 16px;
|
|
}
|
|
|
|
.img-wrap img {
|
|
display: block;
|
|
width: 100%;
|
|
height: 100%;
|
|
max-width: none;
|
|
object-fit: contain;
|
|
}
|
|
|
|
.img-wrap + a {
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.hidden {
|
|
display: none;
|
|
}
|
|
|
|
#page-header {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-left: 0.625rem;
|
|
margin-right: 0.625rem;
|
|
}
|
|
|
|
#search {
|
|
display: block;
|
|
padding: 0.5rem 0.75rem;
|
|
font-size: 1rem;
|
|
line-height: 1.25;
|
|
color: var(--color-search-text);
|
|
background-color: var(--color-search-bg);
|
|
background-image: none;
|
|
background-clip: padding-box;
|
|
border: 1px solid var(--color-search-border);
|
|
border-radius: 0.25rem;
|
|
margin-left: 1rem;
|
|
-webkit-appearance: textfield;
|
|
}
|
|
|
|
#search:focus {
|
|
border-color: var(--color-search-border--focus);
|
|
outline: 0;
|
|
}
|
|
|
|
/* Hide extra columns so they don't squash file names */
|
|
@media (max-width: 600px) {
|
|
.indexcollastmod, .indexcoldesc, .indexcolsize {
|
|
display: none;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 1.5em;
|
|
}
|
|
|
|
#page-header {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
justify-content: flex-start;
|
|
margin-bottom: 1em
|
|
}
|
|
|
|
#search {
|
|
margin-left: 0;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 400px) {
|
|
h1 {
|
|
font-size: 1.375em;
|
|
}
|
|
}
|