60 lines
1.9 KiB
Vue
60 lines
1.9 KiB
Vue
<script setup lang="ts">
|
|
import '~/assets/css/reset.css';
|
|
import '~/assets/css/base.css';
|
|
|
|
const { accent, neutral, hinting } = useTheme();
|
|
|
|
// by default, disable hinting
|
|
if (Number.isNaN(Number(hinting.value))) hinting.value = '0';
|
|
|
|
useHead({
|
|
htmlAttrs: {
|
|
style: `--color-accent: var(--accent-${accent.value}, var(--accent-violet)); --color-accent-hover: var(--accent-${accent.value}-hover, var(--accent-violet-hover)); --neutral-dark: var(--neutral-${neutral.value}-dark, var(--neutral-zinc-dark)); --neutral-light: var(--neutral-${neutral.value}-light, var(--neutral-zinc-light)); --accent-hinting: ${hinting.value}%; --base-hinting: calc(100% - var(--accent-hinting));`,
|
|
},
|
|
});
|
|
|
|
if (import.meta.client) {
|
|
// force shiki into browser rendering only
|
|
window.sessionStorage.setItem('mdc-shiki-highlighter', 'browser');
|
|
|
|
watchEffect(() => {
|
|
document.documentElement.style.setProperty(
|
|
'--color-accent',
|
|
`var(--accent-${accent.value}, var(--accent-violet))`,
|
|
);
|
|
document.documentElement.style.setProperty(
|
|
'--color-accent-hover',
|
|
`var(--accent-${accent.value}-hover, var(--accent-violet-hover))`,
|
|
);
|
|
document.documentElement.style.setProperty(
|
|
'--neutral-dark',
|
|
`var(--neutral-${neutral.value}-dark, var(--neutral-zinc-dark))`,
|
|
);
|
|
document.documentElement.style.setProperty(
|
|
'--neutral-light',
|
|
`var(--neutral-${neutral.value}-light, var(--neutral-zinc-light))`,
|
|
);
|
|
document.documentElement.style.setProperty('--accent-hinting', `${hinting.value}%`);
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<NuxtLoadingIndicator />
|
|
<NuxtLayout>
|
|
<NuxtPage />
|
|
</NuxtLayout>
|
|
<NuxtRouteAnnouncer />
|
|
</template>
|
|
|
|
<style>
|
|
body {
|
|
height: 100%;
|
|
}
|
|
|
|
#__nuxt {
|
|
padding: 0.5rem;
|
|
height: 100%;
|
|
display: flex;
|
|
}
|
|
</style> |