Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add dark mode in Gatsby site #189

Merged
merged 7 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion site/src/components/PageName.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const PageName = ({ title }) => (
<Link style={{ textDecoration: `none` }} to="/">
<h3
style={{
color: `black`,
marginBottom: rhythm(1.5),
fontFamily: "Georgia,serif",
fontSize: "2rem",
Expand All @@ -17,6 +16,7 @@ const PageName = ({ title }) => (
flexWrap: "nowrap",
justifyContent: "center",
gap: "15px",
color: "hsl(240, 15%, 10%)"? "white" : "black",
}}
>
<img
Expand Down
22 changes: 21 additions & 1 deletion site/src/css/blogpost.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
html {
font-size: 16px;
color-scheme: light dark;
}

* {
Expand Down Expand Up @@ -106,7 +107,7 @@ li {

.blogteaser {
position: relative;
color: hsl(212, 30%, 40%);;
color: hsl(212, 30%, 40%);
margin: 0;
text-decoration: none !important;
line-height: 1.66;
Expand Down Expand Up @@ -134,3 +135,22 @@ li {
top: 0.3rem;
margin-inline: 0.2rem;
}

@media screen and (prefers-color-scheme: dark) {
#contributor-grid * {
color: hsl(240, 15%, 95%);
}

body {
background-color: hsl(240, 15%, 10%);
color: hsl(240, 15%, 95%);
}

.blogtitle {
color: hsl(240, 15%, 95%);
}

.blogteaser {
color: hsl(240, 15%, 95%);
}
}