Skip to content

Commit

Permalink
fix: add css var safe padding bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Nov 5, 2023
1 parent 85c8f4f commit d3ab8fb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
13 changes: 5 additions & 8 deletions components/TheBottomMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,21 @@ const route = useRoute()
const router = useRouter()
function onClick(item: BottomMenuItem) {
router.push(item.to || '/')
// router.push(item.to || '/')
router.replace(item.to || '/')
}
</script>

<template>
<YlfBottomMenu shadow-2xl>
<YlfBottomMenu shadow-2xl pb="$cook-bottom-menu-padding-bottom">
<YlfBottomMenuItem
v-for="item in items"
:key="item.to"
:item="item"
:active="route.path === item.to"
@click="onClick"
class="pt-3"

Check warning on line 54 in components/TheBottomMenu.vue

View workflow job for this annotation

GitHub Actions / lint

Attribute "class" should go before "@click"
style="backdrop-filter: blur(10px);"

Check warning on line 55 in components/TheBottomMenu.vue

View workflow job for this annotation

GitHub Actions / lint

Attribute "style" should go before "@click"
/>
</YlfBottomMenu>
</template>

<style>
.ylf-bottom-menu {
padding-bottom: env(safe-area-inset-bottom);
}
</style>
2 changes: 1 addition & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<main class="text-center text-gray-700 dark:text-gray-200" p="t-8 b-15">
<main class="cook-main text-center text-gray-700 dark:text-gray-200" p="t-8 b-$cook-bottom-menu-height">
<slot />
<DarkToggle absolute right-3 top-5 />
<TheBottomMenu fixed bottom-0 left-0 right-0 />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "module",
"version": "1.1.6",
"version": "1.1.7",
"private": true,
"packageManager": "pnpm@8.10.2",
"engines": {
Expand Down
6 changes: 6 additions & 0 deletions styles/css-vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@
.dark {
--ylf-c-border: #666;
}

// cook custom
:root {
--cook-bottom-menu-padding-bottom: 20px;
--cook-bottom-menu-height: calc(64px + var(--cook-bottom-menu-padding-bottom));
}

1 comment on commit d3ab8fb

@vercel
Copy link

@vercel vercel bot commented on d3ab8fb Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

cook – ./

cook-yunyoujun.vercel.app
cook-git-dev-yunyoujun.vercel.app
cook-today.vercel.app
cook.yunle.app

Please sign in to comment.