Reduce portal padding on mobile

This commit is contained in:
Andrew Kingston 2021-09-13 16:01:47 +01:00
parent 0c0e656b34
commit 09385cadc5
1 changed files with 19 additions and 17 deletions

View File

@ -9,6 +9,7 @@
ActionMenu, ActionMenu,
MenuItem, MenuItem,
Modal, Modal,
clickOutside,
} from "@budibase/bbui" } from "@budibase/bbui"
import ConfigChecklist from "components/common/ConfigChecklist.svelte" import ConfigChecklist from "components/common/ConfigChecklist.svelte"
import { organisation, auth } from "stores/portal" import { organisation, auth } from "stores/portal"
@ -79,7 +80,11 @@
{#if $auth.user && loaded} {#if $auth.user && loaded}
<div class="container"> <div class="container">
<div class="nav" class:visible={mobileMenuVisible}> <div
class="nav"
class:visible={mobileMenuVisible}
use:clickOutside={hideMobileMenu}
>
<Layout paddingX="L" paddingY="L"> <Layout paddingX="L" paddingY="L">
<div class="branding"> <div class="branding">
<div class="name" on:click={() => $goto("./apps")}> <div class="name" on:click={() => $goto("./apps")}>
@ -145,11 +150,6 @@
<slot /> <slot />
</div> </div>
</div> </div>
<div
class="mobile-click-handler"
class:visible={mobileMenuVisible}
on:click={hideMobileMenu}
/>
</div> </div>
<Modal bind:this={userInfoModal}> <Modal bind:this={userInfoModal}>
<UpdateUserInfoModal /> <UpdateUserInfoModal />
@ -237,11 +237,18 @@
.content { .content {
overflow: auto; overflow: auto;
} }
.mobile-click-handler {
display: none;
}
@media (max-width: 640px) { @media (max-width: 640px) {
.toolbar {
background: var(--background);
border-bottom: var(--border-light);
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: var(--spacing-m) calc(var(--spacing-xl) * 1.5);
}
.nav { .nav {
position: absolute; position: absolute;
left: -250px; left: -250px;
@ -264,14 +271,9 @@
flex: 1 1 0; flex: 1 1 0;
} }
.mobile-click-handler.visible { /* Reduce BBUI page padding */
position: absolute; .content :global(> *) {
display: block; padding: calc(var(--spacing-xl) * 1.5) !important;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
} }
} }
</style> </style>