Skip to content

feature (#201): design iteration #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/.vuepress/components/BetaBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ export default {}
<template>
<aside class="beta-banner">
<p>
⚠️ Beta Version: Docs are still under development and are subject to
change.
⚠️ Beta Version: Docs are in development and subject to change.
</p>
</aside>
</template>

<style lang="scss" scoped>
@import '../theme/styles/mixins.scss';

.beta-banner {
position: fixed;
z-index: 20;
top: 3.6rem;
top: 0;
left: 0;
right: 0;
display: flex;
Expand All @@ -24,14 +25,22 @@ export default {}
background-color: #fffedb;
box-sizing: border-box;
border-bottom: 1px solid #eaecef;
font-weight: bold;
text-align: center;
padding: 10px 20px;
box-sizing: border-box;

p {
margin: 0;
line-height: 1.4;
font-size: 0.7rem;
font-weight: 600;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;

@include breakpoint(700px) {
font-size: 0.8rem;
}
}
}
</style>
2 changes: 1 addition & 1 deletion src/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ module.exports = {
'link',
{
href:
'https://fonts.googleapis.com/css?family=Inter:300,400,600|Open+Sans:400,600;display=swap',
'https://fonts.googleapis.com/css?family=Inter:300,400,500,600|Open+Sans:400,600;display=swap',
rel: 'stylesheet'
}
],
Expand Down
39 changes: 13 additions & 26 deletions src/.vuepress/theme/components/NavLinks.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
<template>
<nav
v-if="userLinks.length || repoLink"
class="nav-links"
>
<nav v-if="userLinks.length || repoLink" class="nav-links">
<!-- user links -->
<div
v-for="item in userLinks"
:key="item.link"
class="nav-item"
>
<DropdownLink
v-if="item.type === 'links'"
:item="item"
/>
<NavLink
v-else
:item="item"
/>
<div v-for="item in userLinks" :key="item.link" class="nav-item">
<DropdownLink v-if="item.type === 'links'" :item="item" />
<NavLink v-else :item="item" />
</div>

<!-- repo link -->
Expand Down Expand Up @@ -47,11 +34,11 @@ export default {
},

computed: {
userNav () {
userNav() {
return this.$themeLocaleConfig.nav || this.$site.themeConfig.nav || []
},

nav () {
nav() {
const { locales } = this.$site
if (locales && Object.keys(locales).length > 1) {
const currentLink = this.$page.path
Expand All @@ -62,7 +49,8 @@ export default {
ariaLabel: this.$themeLocaleConfig.ariaLabel || 'Select language',
items: Object.keys(locales).map(path => {
const locale = locales[path]
const text = themeLocales[path] && themeLocales[path].label || locale.lang
const text =
(themeLocales[path] && themeLocales[path].label) || locale.lang
let link
// Stay on the current page
if (locale.lang === this.$lang) {
Expand All @@ -83,25 +71,23 @@ export default {
return this.userNav
},

userLinks () {
userLinks() {
return (this.nav || []).map(link => {
return Object.assign(resolveNavLinkItem(link), {
items: (link.items || []).map(resolveNavLinkItem)
})
})
},

repoLink () {
repoLink() {
const { repo } = this.$site.themeConfig
if (repo) {
return /^https?:/.test(repo)
? repo
: `https://github.com/${repo}`
return /^https?:/.test(repo) ? repo : `https://github.com/${repo}`
}
return null
},

repoLabel () {
repoLabel() {
if (!this.repoLink) return
if (this.$site.themeConfig.repoLabel) {
return this.$site.themeConfig.repoLabel
Expand All @@ -128,6 +114,7 @@ export default {
a
line-height 1.4rem
color inherit
font-weight 500
&:hover, &.router-link-active
color $accentColor
.nav-item
Expand Down
2 changes: 1 addition & 1 deletion src/.vuepress/theme/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default {
font-size 1.1em
padding 0.5rem 0 0.5rem 1.5rem
& > .sidebar-links
padding calc(1.5rem + 3rem) 0 // add $betaBannerHeight
padding 1.5rem 0
& > li > a.sidebar-link
font-size 1.1em
line-height 1.7
Expand Down
5 changes: 3 additions & 2 deletions src/.vuepress/theme/styles/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ body
.navbar
position fixed
z-index 20
top 0
top 37px
left 0
right 0
height $navbarHeight
Expand Down Expand Up @@ -110,7 +110,7 @@ strong
font-weight 600

h1, h2, h3, h4, h5, h6
font-weight 600
font-weight 500
line-height 1.25

{$contentClass}:not(.custom) > &
Expand All @@ -135,6 +135,7 @@ h1, h2, h3, h4, h5, h6

h1
font-size 2.2rem
font-weight 600

h2
font-size 1.65rem
Expand Down