Skip to content

Commit 84e9516

Browse files
author
reco_luan
committed
fix(vuepress-theme-reco): fix some style problems
ISSUES CLOSED: #231
1 parent 5efa924 commit 84e9516

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

example/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = {
5858
search: true,
5959
searchMaxSuggestions: 10,
6060
// 自动形成侧边导航
61-
// subSidebar: 'auto',
61+
subSidebar: 'auto',
6262
sidebarDepth: 4,
6363
// 最后更新时间
6464
lastUpdated: 'Last Updated',

example/views/sidebargroup/bar1.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
---
2-
title: bar1
3-
---
1+
# bar test
42

53
bar1

packages/vuepress-theme-reco/components/Page.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<main class="page" :style="pageStyle">
33
<ModuleTransition>
44
<div v-show="recoShowModule && $page.title" class="page-title">
5-
<h1>{{$page.title}}</h1>
5+
<h1 class="title">{{$page.title}}</h1>
66
<PageInfo :pageInfo="$page" :showAccessNumber="showAccessNumber"></PageInfo>
77
</div>
88
</ModuleTransition>
@@ -175,6 +175,10 @@ export default {
175175
}
176176
},
177177
178+
created () {
179+
console.log(this)
180+
},
181+
178182
methods: {
179183
createEditLink (repo, docsRepo, docsDir, docsBranch, path) {
180184
const bitbucket = /bitbucket.org/

packages/vuepress-theme-reco/components/SubSidebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { isActive } from '@theme/helpers/utils'
44
export default {
55
computed: {
66
headers () {
7-
return this.showSubSidebar ? this.$page.headers || [] : []
7+
return this.$showSubSideBar ? this.$page.headers : []
88
}
99
},
1010
methods: {

packages/vuepress-theme-reco/styles/theme.styl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ body
6464
border-radius 4px
6565
img
6666
max-width 100%
67+
*:first-child
68+
margin-top 0
6769

6870
.content__default.custom
6971
padding 0
@@ -111,17 +113,17 @@ h1, h2, h3, h4, h5, h6
111113
font-weight 500
112114
line-height 1.25
113115
.content__default:not(.custom) > &
114-
margin-top (0.5rem - $navbarHeight)
115-
padding-top ($navbarHeight + 1rem)
116+
margin-top (2.1rem - $navbarHeight)
117+
padding-top $navbarHeight
116118
margin-bottom 0
117119
&:first-child
118120
margin-top -3.5rem
119-
margin-bottom 1rem
120-
+ p, + pre, + .custom-block
121-
margin-top 2rem
122121

123122
h1
123+
display none
124124
font-size 1.6rem
125+
&.title
126+
display block
125127

126128
h2
127129
position relative

0 commit comments

Comments
 (0)