Skip to content

Commit 8e7c6bf

Browse files
feature (#201): design iteration (#202)
* feature (#201): increase weight on nav links * feature (#201): Update BetaBanner to be thinner and less intrusive to the reading experience * feature (#201): update font weights to 500 * feature (#201): update weights on headings * Update index.styl Co-authored-by: Evan You <yyx990803@gmail.com>
1 parent 412a071 commit 8e7c6bf

File tree

5 files changed

+31
-34
lines changed

5 files changed

+31
-34
lines changed

src/.vuepress/components/BetaBanner.vue

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ export default {}
55
<template>
66
<aside class="beta-banner">
77
<p>
8-
⚠️ Beta Version: Docs are still under development and are subject to
9-
change.
8+
⚠️ Beta Version: Docs are in development and subject to change.
109
</p>
1110
</aside>
1211
</template>
1312

1413
<style lang="scss" scoped>
14+
@import '../theme/styles/mixins.scss';
15+
1516
.beta-banner {
1617
position: fixed;
1718
z-index: 20;
18-
top: 3.6rem;
19+
top: 0;
1920
left: 0;
2021
right: 0;
2122
display: flex;
@@ -24,14 +25,22 @@ export default {}
2425
background-color: #fffedb;
2526
box-sizing: border-box;
2627
border-bottom: 1px solid #eaecef;
27-
font-weight: bold;
2828
text-align: center;
2929
padding: 10px 20px;
3030
box-sizing: border-box;
3131
3232
p {
3333
margin: 0;
3434
line-height: 1.4;
35+
font-size: 0.7rem;
36+
font-weight: 600;
37+
white-space: nowrap;
38+
overflow: hidden;
39+
text-overflow: ellipsis;
40+
41+
@include breakpoint(700px) {
42+
font-size: 0.8rem;
43+
}
3544
}
3645
}
3746
</style>

src/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ module.exports = {
159159
'link',
160160
{
161161
href:
162-
'https://fonts.googleapis.com/css?family=Inter:300,400,600|Open+Sans:400,600;display=swap',
162+
'https://fonts.googleapis.com/css?family=Inter:300,400,500,600|Open+Sans:400,600;display=swap',
163163
rel: 'stylesheet'
164164
}
165165
],

src/.vuepress/theme/components/NavLinks.vue

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
<template>
2-
<nav
3-
v-if="userLinks.length || repoLink"
4-
class="nav-links"
5-
>
2+
<nav v-if="userLinks.length || repoLink" class="nav-links">
63
<!-- user links -->
7-
<div
8-
v-for="item in userLinks"
9-
:key="item.link"
10-
class="nav-item"
11-
>
12-
<DropdownLink
13-
v-if="item.type === 'links'"
14-
:item="item"
15-
/>
16-
<NavLink
17-
v-else
18-
:item="item"
19-
/>
4+
<div v-for="item in userLinks" :key="item.link" class="nav-item">
5+
<DropdownLink v-if="item.type === 'links'" :item="item" />
6+
<NavLink v-else :item="item" />
207
</div>
218

229
<!-- repo link -->
@@ -47,11 +34,11 @@ export default {
4734
},
4835
4936
computed: {
50-
userNav () {
37+
userNav() {
5138
return this.$themeLocaleConfig.nav || this.$site.themeConfig.nav || []
5239
},
5340
54-
nav () {
41+
nav() {
5542
const { locales } = this.$site
5643
if (locales && Object.keys(locales).length > 1) {
5744
const currentLink = this.$page.path
@@ -62,7 +49,8 @@ export default {
6249
ariaLabel: this.$themeLocaleConfig.ariaLabel || 'Select language',
6350
items: Object.keys(locales).map(path => {
6451
const locale = locales[path]
65-
const text = themeLocales[path] && themeLocales[path].label || locale.lang
52+
const text =
53+
(themeLocales[path] && themeLocales[path].label) || locale.lang
6654
let link
6755
// Stay on the current page
6856
if (locale.lang === this.$lang) {
@@ -83,25 +71,23 @@ export default {
8371
return this.userNav
8472
},
8573
86-
userLinks () {
74+
userLinks() {
8775
return (this.nav || []).map(link => {
8876
return Object.assign(resolveNavLinkItem(link), {
8977
items: (link.items || []).map(resolveNavLinkItem)
9078
})
9179
})
9280
},
9381
94-
repoLink () {
82+
repoLink() {
9583
const { repo } = this.$site.themeConfig
9684
if (repo) {
97-
return /^https?:/.test(repo)
98-
? repo
99-
: `https://github.com/${repo}`
85+
return /^https?:/.test(repo) ? repo : `https://github.com/${repo}`
10086
}
10187
return null
10288
},
10389
104-
repoLabel () {
90+
repoLabel() {
10591
if (!this.repoLink) return
10692
if (this.$site.themeConfig.repoLabel) {
10793
return this.$site.themeConfig.repoLabel
@@ -128,6 +114,7 @@ export default {
128114
a
129115
line-height 1.4rem
130116
color inherit
117+
font-weight 500
131118
&:hover, &.router-link-active
132119
color $accentColor
133120
.nav-item

src/.vuepress/theme/components/Sidebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default {
4242
font-size 1.1em
4343
padding 0.5rem 0 0.5rem 1.5rem
4444
& > .sidebar-links
45-
padding calc(1.5rem + 3rem) 0 // add $betaBannerHeight
45+
padding 1.5rem 0
4646
& > li > a.sidebar-link
4747
font-size 1.1em
4848
line-height 1.7

src/.vuepress/theme/styles/index.styl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ body
2323
.navbar
2424
position fixed
2525
z-index 20
26-
top 0
26+
top 37px
2727
left 0
2828
right 0
2929
height $navbarHeight
@@ -110,7 +110,7 @@ strong
110110
font-weight 600
111111

112112
h1, h2, h3, h4, h5, h6
113-
font-weight 600
113+
font-weight 500
114114
line-height 1.25
115115

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

136136
h1
137137
font-size 2.2rem
138+
font-weight 600
138139

139140
h2
140141
font-size 1.65rem

0 commit comments

Comments
 (0)