Skip to content

Commit

Permalink
use theme in color and component
Browse files Browse the repository at this point in the history
  • Loading branch information
kyeotic committed Feb 7, 2024
1 parent 30c0dc7 commit c283a16
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion blog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function errorHandler(err: unknown) {
*/
export default async function blog(settings?: BlogSettings) {
html.use(UnoCSS(settings?.unocss)); // Load custom unocss module if provided
html.use(ColorScheme("auto"));
html.use(ColorScheme(settings?.theme == "dark" ? "dark" : "auto"));

const url = callsites()[1].getFileName()!;
const blogState = await configureBlog(url, IS_DEV, settings);
Expand Down
4 changes: 2 additions & 2 deletions components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ export function PostPage({ post, state }: PostPageProps) {
<div
class="mt-8 markdown-body"
data-color-mode={state.theme ?? "auto"}
data-light-theme="light"
data-dark-theme="dark"
data-light-theme={state.theme ?? "light"}
data-dark-theme={state.theme ?? "dark"}
dangerouslySetInnerHTML={{ __html: html }}
/>
</article>
Expand Down

0 comments on commit c283a16

Please sign in to comment.