fix(default): update layout to use dynamic vh (#1817)

This commit is contained in:
Mark Pinero 2023-04-28 10:44:58 -07:00 committed by GitHub
parent 28a68f47eb
commit 99dc8a0479
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -18,7 +18,7 @@ const isGrayscale = usePreferences('grayscaleMode')
<div h-full :data-mode="isHydrated && isGrayscale ? 'grayscale' : ''" data-tauri-drag-region>
<main flex w-full mxa lg:max-w-80rem class="native:grid native:sm:grid-cols-[auto_1fr] native:lg:grid-cols-[auto_minmax(600px,2fr)_1fr]">
<aside class="native:w-auto w-1/8 md:w-1/6 lg:w-1/5 xl:w-1/4 zen-hide" hidden sm:flex justify-end xl:me-4 native:me-0 relative>
<div sticky top-0 w-20 xl:w-100 h-screen flex="~ col" lt-xl-items-center>
<div sticky top-0 w-20 xl:w-100 h-100dvh flex="~ col" lt-xl-items-center>
<slot name="left">
<div flex="~ col" overflow-y-auto justify-between h-full max-w-full overflow-x-hidden>
<NavTitle />
@ -60,7 +60,7 @@ const isGrayscale = usePreferences('grayscaleMode')
</div>
</div>
<aside v-if="isHydrated && !wideLayout" class="hidden lg:w-1/5 xl:w-1/4 sm:none xl:block native:w-full zen-hide">
<div sticky top-0 h-screen flex="~ col" gap-2 py3 ms-2>
<div sticky top-0 h-100dvh flex="~ col" gap-2 py3 ms-2>
<slot name="right">
<div flex-auto />

View file

@ -132,6 +132,11 @@ export default defineConfig({
res += `\n${res.replace('{scrollbar-width:none;}', '::-webkit-scrollbar{display: none;}')}`
return res
}],
[/^h-100dvh$/, (_, { constructCSS }) => {
let res = constructCSS({ height: '100vh' })
res += `\n${res.replace('{height:100vh;}', '{height:100vh;height:100dvh;}')}`
return res
}],
['box-shadow-outline', { 'box-shadow': '0 0 0 1px var(--c-primary)' }],
],
})