Add box shadow to nav and update setting order for layout

This commit is contained in:
Andrew Kingston 2021-06-17 16:23:38 +01:00
parent 1890dfed29
commit 25a455d778
2 changed files with 41 additions and 31 deletions

View File

@ -18,18 +18,6 @@
"label": "Title", "label": "Title",
"key": "title" "key": "title"
}, },
{
"type": "boolean",
"label": "Hide title",
"key": "hideTitle",
"defaultValue": false
},
{
"type": "boolean",
"label": "Hide logo",
"key": "hideLogo",
"defaultValue": false
},
{ {
"type": "select", "type": "select",
"label": "Navigation", "label": "Navigation",
@ -37,12 +25,6 @@
"options": ["Top", "Left", "None"], "options": ["Top", "Left", "None"],
"defaultValue": "Top" "defaultValue": "Top"
}, },
{
"type": "boolean",
"label": "Sticky header",
"key": "sticky",
"defaultValue": false
},
{ {
"type": "select", "type": "select",
"label": "Width", "label": "Width",
@ -54,6 +36,24 @@
"type": "navigation", "type": "navigation",
"label": "Links", "label": "Links",
"key": "links" "key": "links"
},
{
"type": "boolean",
"label": "Hide title",
"key": "hideTitle",
"defaultValue": false
},
{
"type": "boolean",
"label": "Hide logo",
"key": "hideLogo",
"defaultValue": false
},
{
"type": "boolean",
"label": "Sticky header",
"key": "sticky",
"defaultValue": false
} }
] ]
}, },

View File

@ -7,7 +7,7 @@
export let title export let title
export let hideTitle = false export let hideTitle = false
export let logoUrl = "https://i.imgur.com/Xhdt1YP.png" export let logoUrl
export let hideLogo = false export let hideLogo = false
export let navigation = "Top" export let navigation = "Top"
export let sticky = false export let sticky = false
@ -59,10 +59,13 @@
{/if} {/if}
<div class="logo"> <div class="logo">
{#if !hideLogo} {#if !hideLogo}
<img src={logoUrl} alt={title} /> <img
src={logoUrl || "https://i.imgur.com/Xhdt1YP.png"}
alt={title}
/>
{/if} {/if}
{#if navigation === "Top" && !hideTitle && title} {#if !hideTitle && title}
<Heading>{title}</Heading> <Heading size="S">{title}</Heading>
{/if} {/if}
</div> </div>
<div class="portal"> <div class="portal">
@ -128,12 +131,12 @@
align-items: stretch; align-items: stretch;
background: white; background: white;
z-index: 1; z-index: 1;
box-shadow: 0 0 8px -1px rgba(0, 0, 0, 0.075);
} }
.layout--top .nav-wrapper.sticky { .layout--top .nav-wrapper.sticky {
position: sticky; position: sticky;
top: 0; top: 0;
left: 0; left: 0;
box-shadow: 0 0 8px -1px rgba(0, 0, 0, 0.075);
} }
.nav { .nav {
@ -151,6 +154,7 @@
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
gap: var(--spacing-xl);
} }
.main-wrapper { .main-wrapper {
display: flex; display: flex;
@ -187,10 +191,19 @@
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
gap: var(--spacing-xl); gap: var(--spacing-m);
flex: 1 1 auto;
} }
.logo img { .logo img {
height: 48px; height: 36px;
}
.logo :global(h1) {
font-weight: 600;
flex: 1 1 auto;
width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.portal { .portal {
display: grid; display: grid;
@ -239,11 +252,8 @@
padding: var(--spacing-xl); padding: var(--spacing-xl);
} }
.nav--left .logo img {
height: 36px;
}
.nav--left .links { .nav--left .links {
margin-top: 0; margin-top: var(--spacing-m);
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
align-items: stretch; align-items: stretch;
@ -275,8 +285,8 @@
display: grid; display: grid;
place-items: center; place-items: center;
} }
.logo img { .logo {
height: 36px; flex: 0 0 auto;
} }
.logo :global(h1) { .logo :global(h1) {
display: none; display: none;