Skip to content

Commit 85ff630

Browse files
committed
feat($theme-default): using '.theme-default-content' to replace '.content' in <Content /> outlet.
1 parent d84bfe7 commit 85ff630

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

packages/@vuepress/theme-default/components/Home.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</div>
3939
</div>
4040

41-
<Content class="content custom"/>
41+
<Content class="theme-default-content custom"/>
4242

4343
<div
4444
class="footer"

packages/@vuepress/theme-default/components/Page.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<main class="page">
33
<slot name="top"/>
44

5-
<Content class="content"/>
5+
<Content class="theme-default-content"/>
66

77
<footer class="page-edit">
88
<div

packages/@vuepress/theme-default/styles/index.styl

+22-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
@require './wrapper'
55
@require './toc'
66

7+
$contentClass = '.theme-default-content'
8+
79
html, body
810
padding 0
911
margin 0
@@ -53,22 +55,26 @@ body
5355
border-right 1px solid $borderColor
5456
overflow-y auto
5557

56-
.content:not(.custom)
58+
{$contentClass}:not(.custom)
5759
@extend $wrapper
5860
> *:first-child
5961
margin-top $navbarHeight
62+
6063
a:hover
6164
text-decoration underline
65+
6266
p.demo
6367
padding 1rem 1.5rem
6468
border 1px solid #ddd
6569
border-radius 4px
70+
6671
img
6772
max-width 100%
6873

69-
.content.custom
74+
{$contentClass}.custom
7075
padding 0
7176
margin 0
77+
7278
img
7379
max-width 100%
7480

@@ -94,6 +100,7 @@ blockquote
94100
border-left .5rem solid #dfe2e5
95101
margin 0.5rem 0
96102
padding .25rem 0 .25rem 1rem
103+
97104
& > p
98105
margin 0
99106

@@ -106,15 +113,19 @@ strong
106113
h1, h2, h3, h4, h5, h6
107114
font-weight 600
108115
line-height 1.25
109-
.content:not(.custom) > &
116+
117+
{$contentClass}:not(.custom) > &
110118
margin-top (0.5rem - $navbarHeight)
111119
padding-top ($navbarHeight + 1rem)
112120
margin-bottom 0
121+
113122
&:first-child
114123
margin-top -1.5rem
115124
margin-bottom 1rem
125+
116126
+ p, + pre, + .custom-block
117127
margin-top 2rem
128+
118129
&:hover .header-anchor
119130
opacity: 1
120131

@@ -136,6 +147,7 @@ a.header-anchor
136147
padding-right 0.23em
137148
margin-top 0.125em
138149
opacity 0
150+
139151
&:hover
140152
text-decoration none
141153

@@ -157,6 +169,7 @@ table
157169

158170
tr
159171
border-top 1px solid #dfe2e5
172+
160173
&:nth-child(2n)
161174
background-color #f6f8fa
162175

@@ -168,10 +181,12 @@ th, td
168181
&.sidebar-open
169182
.sidebar-mask
170183
display: block
184+
171185
&.no-navbar
172-
.content:not(.custom) > h1, h2, h3, h4, h5, h6
173-
margin-top 1.5rem
174-
padding-top 0
186+
{$contentClass}:not(.custom) > h1, h2, h3, h4, h5, h6
187+
margin-top 1.5rem
188+
padding-top 0
189+
175190
.sidebar
176191
top 0
177192

@@ -180,6 +195,7 @@ th, td
180195
.theme-container.no-sidebar
181196
.sidebar
182197
display none
198+
183199
.page
184200
padding-left 0
185201

0 commit comments

Comments
 (0)