Skip to content

Commit

Permalink
Improve dark mode πŸŒ‘.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarty committed Mar 29, 2024
1 parent d9a13d6 commit 5793a64
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/styles/global.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
/* With color-scheme the UA will style some elements appropriately. */
:root {
color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
:root {
color-scheme: dark;
}
}
.light {
color-scheme: light;
}
.dark {
color-scheme: dark;
}
/* Transition color scheme change. */
body {
transition-duration: 150ms;
transition-property: color, background-color;
}

/* Slightly dim the images to avoid heavy contrast. */
.dark img {
filter: brightness(0.8) contrast(1.2);
}

/* Link everywhere (but in prose). */
.themed-link {
/* Inlining to avoid mistakes. */
Expand Down

0 comments on commit 5793a64

Please sign in to comment.