diff --git a/lib/default-theme/NavLinks.vue b/lib/default-theme/NavLinks.vue
index 839bd4d886..4037f2889d 100644
--- a/lib/default-theme/NavLinks.vue
+++ b/lib/default-theme/NavLinks.vue
@@ -130,6 +130,8 @@ export default {
display inline-block
margin-left 1.5rem
line-height 2rem
+ &:first-child
+ margin-left 0
.repo-link
margin-left 1.5rem
diff --git a/lib/default-theme/Navbar.vue b/lib/default-theme/Navbar.vue
index 64e631c418..6ad9bb2098 100644
--- a/lib/default-theme/Navbar.vue
+++ b/lib/default-theme/Navbar.vue
@@ -13,13 +13,19 @@
:alt="$siteTitle"
>
{{ $siteTitle }}
-
+
{
+ if (document.documentElement.clientWidth < MOBILE_DESKTOP_BREAKPOINT) {
+ this.linksWrapMaxWidth = null
+ } else {
+ this.linksWrapMaxWidth = this.$el.offsetWidth - NAVBAR_VERTICAL_PADDING - this.$refs.siteName.offsetWidth
+ }
+ }
+ handleLinksWrapWidth()
+ window.addEventListener('resize', handleLinksWrapWidth, false)
+ },
+
computed: {
algolia () {
return this.$themeLocaleConfig.algolia || this.$site.themeConfig.algolia || {}
@@ -49,13 +75,23 @@ export default {
}
}
}
+
+function css (el, property) {
+ // NOTE: Known bug, will return 'auto' if style value is 'auto'
+ const win = el.ownerDocument.defaultView
+ // null means not to return pseudo styles
+ return win.getComputedStyle(el, null)[property]
+}
diff --git a/lib/default-theme/SearchBox.vue b/lib/default-theme/SearchBox.vue
index 8a104cfcd6..7008b22a08 100644
--- a/lib/default-theme/SearchBox.vue
+++ b/lib/default-theme/SearchBox.vue
@@ -4,6 +4,7 @@
@input="query = $event.target.value"
aria-label="Search"
:value="query"
+ :class="{ 'focused': focused }"
autocomplete="off"
spellcheck="false"
@focus="focused = true"
@@ -156,7 +157,7 @@ export default {
.search-box
display inline-block
position relative
- margin-right 0.5rem
+ margin-right 1rem
input
cursor text
width 10rem
@@ -209,7 +210,6 @@ export default {
width 0
border-color transparent
position relative
- left 1rem
&:focus
cursor text
left 0
@@ -223,6 +223,8 @@ export default {
@media (max-width: $MQMobile)
.search-box
margin-right 0
+ input
+ left 1rem
.suggestions
right 0