Put search in middle

pull/8286/head
Puru Vijay 4 years ago
parent f68d2600b2
commit 0fc027f62f

@ -18,25 +18,25 @@
<SkipLink href="#main" /> <SkipLink href="#main" />
<Nav {page} logo="/svelte-logo.svg"> <Nav {page} logo="/svelte-logo.svg">
<svelte:fragment slot="nav-center"> <svelte:fragment slot="nav-center">
{#if $page.url.pathname !== '/search'}
<!-- the <Nav> component renders this content inside a <ul>, so
we need to wrap it in an <li>. TODO if we adopt this design
on other sites, change <Nav> so we don't need to do this -->
<li><Search /></li>
{/if}
</svelte:fragment>
<svelte:fragment slot="nav-right">
<NavItem href="/tutorial">Tutorial</NavItem> <NavItem href="/tutorial">Tutorial</NavItem>
<NavItem href="/docs/introduction">Docs</NavItem> <NavItem href="/docs/introduction">Docs</NavItem>
<NavItem href="/examples">Examples</NavItem> <NavItem href="/examples">Examples</NavItem>
<NavItem href="/repl">REPL</NavItem> <NavItem href="/repl">REPL</NavItem>
<NavItem href="/blog">Blog</NavItem> <NavItem href="/blog">Blog</NavItem>
<NavItem href="/faq">FAQ</NavItem> <NavItem href="/faq">FAQ</NavItem>
<!-- </svelte:fragment>
<svelte:fragment slot="nav-right"> --> <li aria-hidden="true"><span class="separator" /></li>
<NavItem external="https://kit.svelte.dev">SvelteKit</NavItem>
</svelte:fragment>
<svelte:fragment slot="nav-right"> <NavItem external="https://kit.svelte.dev">SvelteKit</NavItem>
{#if $page.url.pathname !== '/search'}
<!-- the <Nav> component renders this content inside a <ul>, so
we need to wrap it in an <li>. TODO if we adopt this design
on other sites, change <Nav> so we don't need to do this -->
<li><Search /></li>
{/if}
<NavItem external="/chat" title="Discord Chat"> <NavItem external="/chat" title="Discord Chat">
<span class="small">Discord</span> <span class="small">Discord</span>
@ -94,6 +94,14 @@
display: none; display: none;
} }
.separator {
display: block;
position: relative;
height: 1px;
margin: 0.5rem 0;
background: radial-gradient(circle at center, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.05));
}
@media (min-width: 800px) { @media (min-width: 800px) {
.small { .small {
display: none; display: none;
@ -102,6 +110,23 @@
.large { .large {
display: inline; display: inline;
} }
.separator {
display: flex;
align-items: center;
justify-content: center;
background: none;
height: 100%;
margin: 0;
border: none;
text-align: center;
}
.separator::before {
content: '•';
margin: 0 0.3rem;
color: #ccc;
}
} }
:global(html, body) { :global(html, body) {

Loading…
Cancel
Save