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

Theme fix #143

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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 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
2 changes: 1 addition & 1 deletion deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export {
} from "https://deno.land/[email protected]/http/mod.ts";
export { extract as frontMatter } from "https://deno.land/[email protected]/front_matter/any.ts";

export * as gfm from "https://deno.land/x/gfm@0.2.5/mod.ts";
export * as gfm from "https://deno.land/x/gfm@0.6.0/mod.ts";
export { Fragment, h } from "https://deno.land/x/[email protected]/mod.ts";
export {
default as html,
Expand Down
Loading