Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
green-dalii committed Jun 5, 2024
2 parents 1f80082 + 99d2c4a commit 409e30a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "greener-dalii_studio",
"type": "module",
"version": "0.2.1",
"version": "0.3.0",
"private": true,
"scripts": {
"dev": "astro dev",
Expand Down
6 changes: 3 additions & 3 deletions src/components/theme-switcher.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import { Icon } from "astro-icon/components";
type="button"
class="-ml-14 origin-[right_center] scale-0 transition-all duration-500"
>
<div id="icon-theme-light">
<div id="icon-theme-light" class="hidden">
<Icon name="ri:sun-line" class="text-base" />
<span class="sr-only">Use light theme</span>
</div>
<div id="icon-theme-dark" class="hidden">
<div id="icon-theme-dark">
<Icon name="ri:contrast-2-fill" class="text-base" />
<span class="sr-only">Use dark theme</span>
</div>
Expand All @@ -28,7 +28,7 @@ import { Icon } from "astro-icon/components";
const button = document.querySelector("#theme-switcher");
invariant(button, "button should not be null");

const getThemeCurrent = () => document.documentElement.dataset.theme;
const getThemeCurrent = () => document.documentElement.dataset.theme || "light";
const getThemeNext = () => {
const themeCurrent = getThemeCurrent();
invariant(themeCurrent, "themeCurrent should not be undefined");
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "../styles/index.css";
---

<!DOCTYPE html>
<html lang="zh-CN" class="h-full motion-safe:scroll-smooth" data-theme="dark">
<html lang="zh-CN" class="h-full motion-safe:scroll-smooth" data-theme="light">
<head>
<Head />
<!-- <ViewTransitions /> -->
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const lang = getLangFromUrl(Astro.url);
---

<!DOCTYPE html>
<html lang={lang} class="h-full motion-safe:scroll-smooth" data-theme="dark">
<html lang={lang} class="h-full motion-safe:scroll-smooth" data-theme="light">
<head>
<Head />
<!-- <ViewTransitions /> -->
Expand Down

0 comments on commit 409e30a

Please sign in to comment.