Skip to content

Commit

Permalink
feat: sticky footer with calc (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdrtsky committed Mar 10, 2023
1 parent ec7e1c3 commit fe85629
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions components/app/AppFooter.vue
Expand Up @@ -53,6 +53,8 @@ const nbSocialIcons = computed(() => (socialIcons.value ? socialIconsCount.value
<style lang="ts" scoped>
css({
footer: {
display: 'flex',
minHeight: '{docus.footer.height}',
borderTopWidth: '1px',
borderTopStyle: 'solid',
borderTopColor: '{elements.border.primary.static}',
Expand Down
16 changes: 14 additions & 2 deletions components/app/AppLayout.vue
Expand Up @@ -17,10 +17,22 @@ useContentHead(config.value as any)
</script>

<template>
<div>
<div class="app-layout">
<AppLoadingBar />
<AppHeader />
<slot />
<main>
<slot />
</main>
<AppFooter />
</div>
</template>

<style lang="ts" scoped>
css({
'.app-layout': {
main: {
minHeight: 'calc(100vh - {docus.header.height} - {docus.footer.height})',
}
}
})
</style>
2 changes: 1 addition & 1 deletion tokens.config.ts
Expand Up @@ -13,7 +13,7 @@ export default defineTheme({
]
},
header: { height: '64px' },
footer: { padding: '{space.4} 0' },
footer: { height: { initial: '145px', sm: '100px' }, padding: '{space.4} 0' },
readableLine: '78ch',
loadingBar: {
height: '3px',
Expand Down

0 comments on commit fe85629

Please sign in to comment.