feat: Add dark theme via prefers-color-scheme

This commit is contained in:
ge 2022-09-29 10:46:51 +03:00
parent cde343d159
commit 921dd5d29d

131
style.css
View File

@ -1,85 +1,100 @@
:root {
--b: #000;
--w: #fff;
}
@media (prefers-color-scheme: dark) {
:root {
--b: #fff;
--w: #000;
}
}
body { body {
background-color: #fff; color: var(--b);
font-family: 'Ubuntu Mono', monospace; background-color: var(--w);
max-width: 720px; font-family: 'Ubuntu Mono', monospace;
margin: 0 auto; max-width: 720px;
text-align: center; margin: 0 auto;
text-align: center;
} }
main { margin: 4rem 2rem; } main { margin: 4rem 2rem; }
.not-found, .bad-mime-type { margin-bottom: 2rem; } a, a:visited { color: var(--b); }
a, a:visited { color: #000; }
img { width: 100%; } img { width: 100%; }
.not-found, .bad-mime-type { margin-bottom: 2rem; }
.logo pre {
display: flex;
justify-content: center;
text-align: left;
}
/* Drag and Drop */ /* Drag and Drop */
.drop-area { .drop-area {
position: relative; position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 8rem; height: 8rem;
padding: 25px; padding: 25px;
border: 3px dashed #e1e1e1; border: 3px dashed #e1e1e1;
} }
.drop-area.dragover { border-color: var(--b); }
.drop-area.dragover { border-color: #000; }
.file-input { .file-input {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
height: 100%; height: 100%;
width: 100%; width: 100%;
cursor: pointer; cursor: pointer;
align-items: center; align-items: center;
opacity: 0; opacity: 0;
} }
.file-input-label { .file-input-label {
display: block; display: block;
margin-top: 1rem; margin-top: 1rem;
} }
/* Copy to clipboard */ /* Copy to clipboard */
.copy-to-clipboard { .copy-to-clipboard {
display: flex; display: flex;
margin: 2rem 0; margin: 2rem 0;
border: 1px solid #000000; border: 1px solid var(--b);
} }
.copy-to-clipboard input[type=text] { .copy-to-clipboard input[type=text] {
flex: 50%; flex: 50%;
width: 100%; width: 100%;
padding: 12px 20px; padding: 12px 20px;
border: none; border: none;
outline: none; outline: none;
background-color: var(--w);
color: var(--b);
} }
.copy-to-clipboard button { .copy-to-clipboard button {
padding: 12px 20px; padding: 12px 20px;
margin: 0; margin: 0;
min-width: 120px; min-width: 120px;
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
border: none; border: none;
background-color: #000000; background-color: var(--b);
color: #ffffff; color: var(--w);
} }
/* cURL command */ /* cURL command */
.curl pre { .curl pre {
text-align: left; text-align: left;
padding: 12px 20px; padding: 12px 20px;
font-size: 14px; font-size: 14px;
background: #000000; background: var(--b);
color: #ffffff; color: var(--w);
overflow-x: auto; overflow-x: auto;
} }
.logo pre { /* SVG */
display: flex; svg {
justify-content: center; color: var(--b);
text-align: left; }
svg path {
stroke: currentcolor;
} }