Add back green theme
This commit is contained in:
parent
4c0730b600
commit
2650d024db
4 changed files with 78 additions and 0 deletions
7
src/routes/+layout.server.js
Normal file
7
src/routes/+layout.server.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
export async function load({ cookies }) {
|
||||
const green = cookies.get("green");
|
||||
|
||||
return {
|
||||
green: green === "true"
|
||||
};
|
||||
}
|
|
@ -3,9 +3,14 @@
|
|||
import Footer from "$lib/components/Footer.svelte";
|
||||
import Navbar from "$lib/components/Navbar.svelte";
|
||||
import "./style.css";
|
||||
|
||||
export let data;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
{#if data.green}
|
||||
<link rel="stylesheet" href="/assets/green.css" />
|
||||
{/if}
|
||||
<title>
|
||||
{$page.data.title ? $page.data.title + " | pancakes" : "pancakes"}
|
||||
</title>
|
||||
|
|
13
src/routes/green/+page.server.js
Normal file
13
src/routes/green/+page.server.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export async function load({ cookies }) {
|
||||
const green = cookies.get("green");
|
||||
|
||||
if (green === "true") {
|
||||
cookies.delete("green", { path: "/" });
|
||||
} else {
|
||||
cookies.set("green", "true", { path: "/", sameSite: "strict" });
|
||||
}
|
||||
|
||||
redirect(302, "/");
|
||||
}
|
53
static/assets/green.css
Normal file
53
static/assets/green.css
Normal file
|
@ -0,0 +1,53 @@
|
|||
:root {
|
||||
--accent: #b0a64e !important;
|
||||
--accent-2: #b0a64e !important;
|
||||
--background: #4c5844 !important;
|
||||
--background-2: #3e4637 !important;
|
||||
--foreground: #a2a09c !important;
|
||||
--success: #B0F950 !important;
|
||||
--warn: #ffff00 !important;
|
||||
--error: #AD4547 !important;
|
||||
|
||||
--radius: 0px !important;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: var(--accent) !important;
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
color: white !important;
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
a,
|
||||
a:visited {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
a:not(:has(>img)):hover,
|
||||
a:not(:has(>img)):visited:hover {
|
||||
background-color: transparent !important;
|
||||
color: white !important;
|
||||
text-decoration: underline solid white 1px !important;
|
||||
}
|
||||
|
||||
pre code {
|
||||
background-color: var(--background-2) !important;
|
||||
color: white !important;
|
||||
border-color: white !important;
|
||||
}
|
||||
|
||||
.language-md,
|
||||
.token {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.icon-link>img.invert {
|
||||
filter: hue-rotate(180deg) invert() !important;
|
||||
}
|
Loading…
Add table
Reference in a new issue