Skip to content

Commit

Permalink
feat(site/blog): dark mode btn
Browse files Browse the repository at this point in the history
  • Loading branch information
qhanw committed Oct 8, 2024
1 parent 3db1f6b commit e074975
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 9 additions & 2 deletions site/blog/app/(web)/code-snippets/[slug]/styles.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
.prose pre.shiki.vitesse-light {
font-family: DM Mono, Input Mono, Fira Code, monospace;
.prose pre.shiki {
font-family:
DM Mono,
Input Mono,
Fira Code,
monospace;
font-size: 0.92em;
line-height: 1.4;
// margin: 0.5em 0;

background-color: #f9f9f9 !important;
}

.dark .prose pre.shiki {
background-color: rgb(15 23 42) !important;
}
5 changes: 1 addition & 4 deletions site/blog/app/(web)/components/Theme.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use client";
import clsx from "clsx";
import { useTheme } from "next-themes";

export default function Theme() {
Expand All @@ -12,9 +11,7 @@ export default function Theme() {
onClick={() => setTheme(isDark ? "light" : "dark")}
className="text-slate-800 dark:text-white cursor-pointer"
>
<i
className={clsx({ "i-ri:sun-fill": !isDark, "i-ri:moon-fill": isDark })}
/>
<i className={isDark ? "i-ri:sun-fill" : "i-ri:moon-fill"} />
</a>
);
}

0 comments on commit e074975

Please sign in to comment.