Set the right variables for dark mode --tag-kind-*. Style input foreground and background colors.
424 lines
7.1 KiB
CSS
424 lines
7.1 KiB
CSS
/*
|
|
* Copyright (c) 2025 Lucas Gabriel Vuotto <lucas@lgv5.net>
|
|
*
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
* copyright notice and this permission notice appear in all copies.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
:root {
|
|
--dark-theme-bg: black;
|
|
--dark-theme-text: white;
|
|
--dark-theme-accent: royalblue;
|
|
--dark-theme-accent-hover: orange;
|
|
--dark-theme-tag-kind-a: crimson;
|
|
--dark-theme-tag-kind-c: seagreen;
|
|
--dark-theme-tag-kind-r: mediumorchid;
|
|
|
|
--light-theme-bg: white;
|
|
--light-theme-text: black;
|
|
--light-theme-accent: royalblue;
|
|
--light-theme-accent-hover: orange;
|
|
--light-theme-tag-kind-a: crimson;
|
|
--light-theme-tag-kind-c: seagreen;
|
|
--light-theme-tag-kind-r: mediumorchid;
|
|
|
|
--bg: var(--light-theme-bg);
|
|
--text: var(--light-theme-text);
|
|
--accent: var(--light-theme-accent);
|
|
--accent-hover: var(--light-theme-accent-hover);
|
|
--tag-kind-a: var(--light-theme-tag-kind-a);
|
|
--tag-kind-c: var(--light-theme-tag-kind-c);
|
|
--tag-kind-r: var(--light-theme-tag-kind-r);
|
|
|
|
--gap: 1.5rem;
|
|
--viewport-width: 90rem;
|
|
|
|
--border-thin: 0.0625rem solid var(--accent);
|
|
|
|
--gallery-column-gap: 1.2rem;
|
|
}
|
|
|
|
*,
|
|
*::before,
|
|
*::after {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
dl,
|
|
form,
|
|
h1,
|
|
h2,
|
|
h3,
|
|
input,
|
|
ol,
|
|
p,
|
|
ul {
|
|
margin: 0;
|
|
}
|
|
|
|
body {
|
|
margin: 0 auto;
|
|
min-height: 100vh;
|
|
background-color: var(--bg);
|
|
color: var(--text);
|
|
font-family: monospace;
|
|
font-size: 1rem;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
dl,
|
|
form,
|
|
h1,
|
|
h2,
|
|
h3,
|
|
ol,
|
|
p,
|
|
ul {
|
|
margin-bottom: var(--gap);
|
|
}
|
|
|
|
h1 {
|
|
text-align: center;
|
|
font-size: 3rem;
|
|
line-height: 2;
|
|
}
|
|
|
|
h2 {
|
|
font-size: 2.5rem;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
h3 {
|
|
font-size: 2rem;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
dd {
|
|
margin-left: var(--gap);
|
|
}
|
|
|
|
dt {
|
|
font-weight: bold;
|
|
}
|
|
|
|
ol,
|
|
ul {
|
|
padding-left: calc(var(--gap) * 2);
|
|
}
|
|
|
|
a,
|
|
a:link,
|
|
a:visited {
|
|
color: var(--accent);
|
|
}
|
|
|
|
a:hover,
|
|
a:focus,
|
|
a:active {
|
|
color: var(--accent-hover);
|
|
}
|
|
|
|
img {
|
|
max-width: 100%;
|
|
height: auto;
|
|
}
|
|
|
|
input {
|
|
background-color: var(--bg);
|
|
color: var(--text);
|
|
font: inherit;
|
|
border: var(--border-thin);
|
|
padding: 0 0.1875rem;
|
|
}
|
|
|
|
input[type=submit] {
|
|
background-color: var(--accent);
|
|
color: var(--bg);
|
|
font-weight: bold;
|
|
}
|
|
|
|
input[type=submit]:active {
|
|
background-color: var(--accent-hover);
|
|
border-color: var(--accent-hover);
|
|
}
|
|
|
|
form[name=search] {
|
|
gap: 1rem;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
form[name=search] input[type=submit] {
|
|
width: 7rem;
|
|
}
|
|
|
|
form[name=search] input[name=tags] {
|
|
width: 100%;
|
|
}
|
|
|
|
.position-relative {
|
|
position: relative;
|
|
}
|
|
|
|
#tags-suggestions {
|
|
position: absolute;
|
|
|
|
background-color: var(--bg);
|
|
width: 100%;
|
|
border: var(--border-thin);
|
|
box-shadow: rgba(0, 0, 0, 0.5) 0 0.25rem 0.5rem -0.25rem;
|
|
padding-left: 0;
|
|
|
|
list-style: none;
|
|
}
|
|
|
|
.suggestion-hover {
|
|
background-color: #eee;
|
|
}
|
|
|
|
#tags-suggestions li {
|
|
padding-left: 0.1875rem;
|
|
padding-right: 0.1875rem;
|
|
}
|
|
|
|
body > header {
|
|
border-bottom: var(--border-thin);
|
|
font-size: 1.25rem;
|
|
line-height: 2.4;
|
|
}
|
|
|
|
body > header > nav {
|
|
gap: 0 var(--gap);
|
|
|
|
/* Make the navbar horizontally scrollable. Used for mobile. */
|
|
white-space: nowrap;
|
|
overflow-x: auto;
|
|
}
|
|
|
|
body > header > nav > a {
|
|
font-weight: bold;
|
|
text-decoration: none;
|
|
}
|
|
|
|
body > footer {
|
|
border-top: var(--border-thin);
|
|
}
|
|
|
|
body > footer > p {
|
|
/*
|
|
* Together they add for a single --gap, which is also the vertical rhythm
|
|
* unit.
|
|
*/
|
|
padding-top: calc(var(--gap) / 2);
|
|
margin-bottom: calc(var(--gap) / 2);
|
|
}
|
|
|
|
main {
|
|
border-top: var(--border-thin);
|
|
border-bottom: var(--border-thin);
|
|
margin-top: 0.1875rem;
|
|
margin-bottom: 0.1875rem;
|
|
padding-top: var(--gap);
|
|
padding-bottom: var(--gap);
|
|
}
|
|
|
|
[x-cloak] {
|
|
display: none;
|
|
}
|
|
|
|
.text-center {
|
|
text-align: center;
|
|
}
|
|
|
|
.float-right {
|
|
float: right;
|
|
}
|
|
|
|
.layout-viewport {
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
width: var(--viewport-width);
|
|
}
|
|
|
|
.layout-flex-row {
|
|
display: flex;
|
|
flex-direction: row;
|
|
}
|
|
|
|
.layout-flex-column {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.layout-flex-item-fullsize {
|
|
flex: auto;
|
|
}
|
|
|
|
.pager > a,
|
|
.pager > span {
|
|
display: inline-block;
|
|
padding-left: 0.5rem;
|
|
padding-right: 0.5rem;
|
|
border: var(--border-thin);
|
|
}
|
|
|
|
.pager > a {
|
|
text-decoration: none;
|
|
}
|
|
|
|
.pager > a:hover,
|
|
.pager > a:focus {
|
|
color: var(--bg);
|
|
background-color: var(--accent);
|
|
}
|
|
|
|
.pager > a:active {
|
|
color: var(--bg);
|
|
background-color: var(--accent-hover);
|
|
border-color: var(--accent-hover);
|
|
}
|
|
|
|
.pager > span {
|
|
border-color: var(--text);
|
|
}
|
|
|
|
.gallery {
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
align-items: center;
|
|
gap: var(--gap) var(--gallery-column-gap);
|
|
margin-bottom: var(--gap);
|
|
}
|
|
|
|
.gallery > a {
|
|
flex: 0 1 14rem;
|
|
padding: 0.1875rem;
|
|
line-height: 0;
|
|
}
|
|
|
|
.gallery > a:link,
|
|
.gallery > a:visited {
|
|
border: var(--border-thin);
|
|
}
|
|
|
|
.gallery > a:hover,
|
|
.gallery > a:focus,
|
|
.gallery > a:active {
|
|
border-color: var(--accent-hover);
|
|
}
|
|
|
|
.media {
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
align-items: flex-start;
|
|
gap: var(--gap);
|
|
}
|
|
|
|
.media-metadata {
|
|
flex: 1;
|
|
}
|
|
|
|
.media-item {
|
|
flex: 3;
|
|
line-height: 0;
|
|
}
|
|
|
|
.accent {
|
|
color: var(--accent);
|
|
}
|
|
|
|
span.tag-kind-a,
|
|
a.tag-kind-a:link,
|
|
a.tag-kind-a:visited {
|
|
color: var(--tag-kind-a);
|
|
}
|
|
|
|
span.tag-kind-c,
|
|
a.tag-kind-c:link,
|
|
a.tag-kind-c:visited {
|
|
color: var(--tag-kind-c);
|
|
}
|
|
|
|
span.tag-kind-r,
|
|
a.tag-kind-r:link,
|
|
a.tag-kind-r:visited {
|
|
color: var(--tag-kind-r);
|
|
}
|
|
|
|
a.tag-kind-a:hover,
|
|
a.tag-kind-a:focus,
|
|
a.tag-kind-a:active,
|
|
a.tag-kind-c:hover,
|
|
a.tag-kind-c:focus,
|
|
a.tag-kind-c:active,
|
|
a.tag-kind-r:hover,
|
|
a.tag-kind-r:focus,
|
|
a.tag-kind-r:active {
|
|
color: var(--accent-hover);
|
|
}
|
|
|
|
@media screen and (max-width: 60rem) {
|
|
:root {
|
|
--viewport-width: 100%;
|
|
--gallery-column-gap: 1rem;
|
|
}
|
|
|
|
body > header > nav,
|
|
body > footer,
|
|
main {
|
|
padding-left: var(--gap);
|
|
padding-right: var(--gap);
|
|
}
|
|
|
|
.media { flex-direction: column-reverse; }
|
|
.media-metadata { flex: auto; }
|
|
.media-item { flex: auto; }
|
|
}
|
|
|
|
@media screen and (min-width: 60rem) {
|
|
:root {
|
|
--viewport-width: 60rem;
|
|
--gallery-column-gap: 1.3125rem;
|
|
}
|
|
|
|
body > header > nav,
|
|
body > footer,
|
|
main {
|
|
padding-left: 0;
|
|
padding-right: 0;
|
|
}
|
|
|
|
.media { flex-direction: row; }
|
|
.media-metadata { flex: 1; }
|
|
.media-item { flex: 3; }
|
|
}
|
|
|
|
@media screen and (min-width: 90rem) {
|
|
:root {
|
|
--viewport-width: 90rem;
|
|
--gallery-column-gap: 1.2rem;
|
|
}
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
:root {
|
|
--bg: var(--dark-theme-bg);
|
|
--text: var(--dark-theme-text);
|
|
--accent: var(--dark-theme-accent);
|
|
--accent-hover: var(--dark-theme-accent-hover);
|
|
--tag-kind-a: var(--dark-theme-tag-kind-a);
|
|
--tag-kind-c: var(--dark-theme-tag-kind-c);
|
|
--tag-kind-r: var(--dark-theme-tag-kind-r);
|
|
}
|
|
}
|