forked from onwidget/astrowind
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format all files with prettier: npm run format
- Loading branch information
Showing
47 changed files
with
297 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
--- | ||
import { UI } from "astrowind:config"; | ||
import { UI } from 'astrowind:config'; | ||
// TODO: This code is temporary | ||
--- | ||
|
||
<script is:inline define:vars={{ defaultTheme: UI.theme || "system" }}> | ||
<script is:inline define:vars={{ defaultTheme: UI.theme || 'system' }}> | ||
function applyTheme(theme) { | ||
if (theme === "dark") { | ||
document.documentElement.classList.add("dark"); | ||
if (theme === 'dark') { | ||
document.documentElement.classList.add('dark'); | ||
} else { | ||
document.documentElement.classList.remove("dark"); | ||
document.documentElement.classList.remove('dark'); | ||
} | ||
const matches = document.querySelectorAll("[data-aw-toggle-color-scheme] > input"); | ||
const matches = document.querySelectorAll('[data-aw-toggle-color-scheme] > input'); | ||
|
||
if (matches && matches.length) { | ||
matches.forEach((elem) => { | ||
elem.checked = theme !== "dark"; | ||
elem.checked = theme !== 'dark'; | ||
}); | ||
} | ||
} | ||
|
||
if ((defaultTheme && defaultTheme.endsWith(":only")) || (!localStorage.theme && defaultTheme !== "system")) { | ||
applyTheme(defaultTheme.replace(":only", "")); | ||
if ((defaultTheme && defaultTheme.endsWith(':only')) || (!localStorage.theme && defaultTheme !== 'system')) { | ||
applyTheme(defaultTheme.replace(':only', '')); | ||
} else if ( | ||
localStorage.theme === "dark" || | ||
(!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches) | ||
localStorage.theme === 'dark' || | ||
(!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches) | ||
) { | ||
applyTheme("dark"); | ||
applyTheme('dark'); | ||
} else { | ||
applyTheme("light"); | ||
applyTheme('light'); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
import { SITE } from "astrowind:config"; | ||
import { SITE } from 'astrowind:config'; | ||
--- | ||
|
||
{SITE.googleSiteVerificationId && <meta name="google-site-verification" content={SITE.googleSiteVerificationId} />} | ||
{SITE.googleSiteVerificationId && <meta name="google-site-verification" content={SITE.googleSiteVerificationId} />} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
export interface Props { | ||
isDark?: boolean | ||
isDark?: boolean; | ||
} | ||
const { isDark = false } = Astro.props; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.