feat: remove themes
This commit is contained in:
parent
1d2f556b32
commit
142d0876a6
6 changed files with 2 additions and 99 deletions
|
|
@ -5,37 +5,6 @@ import rehypeKatex from "rehype-katex";
|
|||
import remarkMath from "remark-math";
|
||||
import path from "path";
|
||||
|
||||
const midnight = {
|
||||
name: "midnight",
|
||||
type: "dark",
|
||||
colors: {
|
||||
"editor.background": "#121212",
|
||||
"editor.foreground": "#e0e0e0",
|
||||
},
|
||||
tokenColors: [
|
||||
{
|
||||
scope: [
|
||||
"storage.type",
|
||||
"storage.modifier",
|
||||
"keyword.control",
|
||||
"keyword.operator.new",
|
||||
],
|
||||
settings: { foreground: "#7aa2f7" },
|
||||
},
|
||||
{
|
||||
scope: [
|
||||
"string",
|
||||
"constant",
|
||||
"constant.numeric",
|
||||
"constant.language",
|
||||
"constant.character",
|
||||
"number",
|
||||
],
|
||||
settings: { foreground: "#98c379" },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const daylight = {
|
||||
name: "daylight",
|
||||
type: "light",
|
||||
|
|
@ -97,7 +66,6 @@ export default defineConfig({
|
|||
shikiConfig: {
|
||||
themes: {
|
||||
light: daylight,
|
||||
dark: midnight,
|
||||
},
|
||||
langs: [],
|
||||
wrap: true,
|
||||
|
|
|
|||
|
|
@ -251,30 +251,6 @@
|
|||
true,
|
||||
);
|
||||
|
||||
const themeToggle = document.getElementById("theme-toggle");
|
||||
if (themeToggle) {
|
||||
function updateBearVisual() {
|
||||
const currentTheme =
|
||||
document.documentElement.getAttribute("data-theme");
|
||||
if (currentTheme === "dark") {
|
||||
themeToggle.textContent = "☾⊂ʕ•ᴥ•ʔ";
|
||||
} else {
|
||||
themeToggle.textContent = "☼⊂ʕ•ᴥ•ʔ";
|
||||
}
|
||||
}
|
||||
|
||||
updateBearVisual();
|
||||
|
||||
themeToggle.addEventListener("click", () => {
|
||||
const currentTheme =
|
||||
document.documentElement.getAttribute("data-theme");
|
||||
const newTheme = currentTheme === "dark" ? "light" : "dark";
|
||||
document.documentElement.setAttribute("data-theme", newTheme);
|
||||
localStorage.setItem("theme", newTheme);
|
||||
updateBearVisual();
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener("beforeunload", () => {
|
||||
const el = promptEl();
|
||||
if (el) el.textContent = TERMINAL_PROMPT;
|
||||
|
|
|
|||
|
|
@ -150,16 +150,6 @@
|
|||
--grid-color: rgba(200, 200, 200, 0.4);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #000;
|
||||
--text: #fff;
|
||||
--code-bg: #121212;
|
||||
--border: #2d2d2d;
|
||||
--grid-color: rgba(55, 55, 55, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
[data-theme="light"] {
|
||||
--bg: #fff;
|
||||
--text: #000;
|
||||
|
|
@ -168,14 +158,6 @@
|
|||
--grid-color: rgba(200, 200, 200, 0.4);
|
||||
}
|
||||
|
||||
[data-theme="dark"] {
|
||||
--bg: #000;
|
||||
--text: #fff;
|
||||
--code-bg: #121212;
|
||||
--border: #2d2d2d;
|
||||
--grid-color: rgba(55, 55, 55, 0.4);
|
||||
}
|
||||
|
||||
pre,
|
||||
code,
|
||||
pre code,
|
||||
|
|
@ -208,11 +190,6 @@ footer {
|
|||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#theme-toggle {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.main {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
|
|||
|
|
@ -26,14 +26,9 @@ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$";
|
|||
<span class="terminal-cursor"></span>
|
||||
</div>
|
||||
</a>
|
||||
<span id="theme-toggle">☼⊂ʕ•ᴥ•ʔ</span>
|
||||
</header>
|
||||
|
||||
<style>
|
||||
#theme-toggle {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
header {
|
||||
flex-direction: row;
|
||||
|
|
|
|||
|
|
@ -13,17 +13,6 @@ const {
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<script is:inline>
|
||||
(function () {
|
||||
const stored = localStorage.getItem("theme");
|
||||
const theme =
|
||||
stored ||
|
||||
(matchMedia("(prefers-color-scheme: dark)").matches
|
||||
? "dark"
|
||||
: "light");
|
||||
document.documentElement.setAttribute("data-theme", theme);
|
||||
})();
|
||||
</script>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ export type CollectionKey =
|
|||
| "meditations"
|
||||
| "autonomous-racing"
|
||||
| "git"
|
||||
| "gists"
|
||||
| "death";
|
||||
export type PostCollection = Exclude<CollectionKey, "git" | "gists">;
|
||||
export type PostCollection = Exclude<CollectionKey, "git">;
|
||||
|
||||
export type AnyCollectionEntry =
|
||||
| CollectionEntry<"algorithms">
|
||||
|
|
@ -16,5 +15,4 @@ export type AnyCollectionEntry =
|
|||
| CollectionEntry<"meditations">
|
||||
| CollectionEntry<"autonomous-racing">
|
||||
| CollectionEntry<"death">
|
||||
| CollectionEntry<"git">
|
||||
| CollectionEntry<"gists">;
|
||||
| CollectionEntry<"git">;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue