Skip to content

Commit

Permalink
feat(client): add slot for a searchbar
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Oct 19, 2020
1 parent 750fd7e commit 68d9b18
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/client/theme-default/Layout.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<template>
<div class="theme">
<header>
<NavBar />
<NavBar>
<template #search>
<slot name="navbar-search" />
</template>
</NavBar>
<ToggleSideBarButton @toggle="toggleSidebar" />
</header>
<aside :class="{ open }">
Expand Down
6 changes: 6 additions & 0 deletions src/client/theme-default/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
/>
<span>{{ $site.title }}</span>
</a>
<div class="flex-grow"></div>
<NavBarLinks class="hide-mobile" />
<slot name="search" />
</template>

<script src="./NavBar"></script>
Expand All @@ -24,6 +26,10 @@
color: var(--text-color);
}
.flex-grow {
flex-grow: 1;
}
.logo {
margin-right: 0.75rem;
height: 1.3rem;
Expand Down
8 changes: 4 additions & 4 deletions src/client/theme-default/styles/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ body {
padding: 0;
margin: 0;
background-color: #fff;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

* {
box-sizing: border-box;
}

.theme {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 16px;
color: var(--text-color);
}
Expand Down

0 comments on commit 68d9b18

Please sign in to comment.