Better themeing with proper light/dark mode support
The themeing is broken up into 4 colors, `text`, `background`, `accent`, and `highlight` `text` is used for most foreground elements, including obviously text `background` is used for most background colors `accent` is used for decorations `highlight` is used for highlighting certain elements, such as headers
This commit is contained in:
parent
c78c61ac49
commit
c9be513a40
3 changed files with 60 additions and 3 deletions
|
|
@ -1,6 +1,44 @@
|
||||||
html {
|
:root {
|
||||||
|
/* Catppuccin colors */
|
||||||
|
/* Light mode */
|
||||||
|
--light-text: #1e2030;
|
||||||
|
--light-background: #eff1f5;
|
||||||
|
--light-accent: #8839ef;
|
||||||
|
--light-highlight: #209fb5;
|
||||||
|
/* Dark mode */
|
||||||
|
--dark-text: #cad3f5;
|
||||||
|
--dark-background: #24273a;
|
||||||
|
--dark-accent: #c6a0f6;
|
||||||
|
--dark-highlight: #7dc4e4;
|
||||||
|
|
||||||
|
/* Global configs */
|
||||||
color-scheme: light dark;
|
color-scheme: light dark;
|
||||||
font-family: system-ui;
|
font-family: system-ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: light) {
|
||||||
|
html {
|
||||||
|
color: var(--light-text);
|
||||||
|
background-color: var(--light-background);
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: var(--light-highlight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
html {
|
||||||
|
color: var(--dark-text);
|
||||||
|
background-color: var(--dark-background);
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: var(--dark-highlight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
header {
|
header {
|
||||||
border-color: #c6a0f6;
|
|
||||||
border-width: 2px;
|
border-width: 2px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
|
|
||||||
|
|
@ -20,8 +19,27 @@ nav {
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: #cad3f5;
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: light) {
|
||||||
|
header {
|
||||||
|
border-color: var(--light-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--light-text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
header {
|
||||||
|
border-color: var(--dark-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--dark-text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import "/src/App.css";
|
||||||
import "./header.css";
|
import "./header.css";
|
||||||
import { Nav } from "./nav";
|
import { Nav } from "./nav";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue