diff --git a/.env.template b/.env.template new file mode 100644 index 0000000..fcd8b16 --- /dev/null +++ b/.env.template @@ -0,0 +1,3 @@ +VITE_API_URL=https://api.example.com +VITE_TITLE=Title +VITE_CSS_VAR=https://example.com/path/to/vars.css diff --git a/src/App.svelte b/src/App.svelte index 4314846..ea4e093 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -15,6 +15,10 @@ }); + + + +
@@ -70,7 +74,7 @@ height: 80px; min-height: 80px; max-height: 80px; - background-color: #25662854; + background-color: var(--primary); border-radius: 0 0 16px 16px; } diff --git a/src/app.css b/src/app.css index 0341638..3a1350a 100644 --- a/src/app.css +++ b/src/app.css @@ -5,8 +5,8 @@ font-weight: 400; color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; + color: var(--primary-text); + background-color: var(--primary-bg); font-synthesis: none; text-rendering: optimizeLegibility; @@ -17,12 +17,12 @@ a { font-weight: 500; - color: #64dd6caa; + color: var(--primary-component); text-decoration: inherit; } a:hover { - color: #53f25bee; + color: var(--primary-hover); } body { @@ -36,13 +36,13 @@ button { font-size: 1em; font-weight: 500; font-family: inherit; - background-color: #1a1a1a; + background-color: var(--primary-component); cursor: pointer; transition: border-color 0.25s; } button:hover { - border-color: #64dd6caa; + border-color: var(--primary-hover); } button:focus, diff --git a/src/routes/oauth/Authorize.svelte b/src/routes/oauth/Authorize.svelte index 68ecd49..c4984e4 100644 --- a/src/routes/oauth/Authorize.svelte +++ b/src/routes/oauth/Authorize.svelte @@ -3,11 +3,13 @@ import { navigate, useLocation } from "svelte-navigator"; import { getUser } from "~/api/login"; import { getOAuthApp } from "~/api/oauth"; - import LazyComponent from "~/lib/LazyComponent.svelte"; import LazyDelay from "~/lib/LazyDelay.svelte"; let location = useLocation(); - let app; + let app: { + app_name: string; + app_desc: string; + }; onMount(async () => { try { @@ -26,13 +28,35 @@ }); -
+
{#if app} -
-

{app.app_name}

-
{app.app_desc}
+
+

{app.app_name}

+
{app.app_desc}
{:else} {/if}
+ + diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index e9efa3b..3e2c13c 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -4,6 +4,7 @@ interface ImportMetaEnv { readonly VITE_API_URL: string; readonly VITE_TITLE: string; + readonly VITE_CSS_VAR: string; } interface ImportMeta {