8000 docs: hide previewer if there has no preview link · PeachScript/vue-infinite-loading@cb06df9 · GitHub
[go: up one dir, main page]

Skip to content

Commit cb06df9

Browse files
committed
docs: hide previewer if there has no preview link
1 parent 9380305 commit cb06df9

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

docs/.vuepress/theme/layouts/Layout.vue

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
:class="[
55
{ 'doc-mode': !isHomepage },
66
{ 'start-mode': isInitializing },
7+
{ 'preview-mode': $page.frontmatter.previewLink },
78
...pageClasses
89
]"
910
@touchstart="onTouchStart"
@@ -135,6 +136,11 @@ body
135136
@media (min-width $mq-narrow + 1)
136137
padding-left $s-sidebar-width
137138
139+
.content:not(.custom),
140+
.page-edit,
141+
.page-nav
142+
margin-left 0
143+
138144
.theme-container
139145
.previewer
140146
position absolute
@@ -143,6 +149,7 @@ body
143149
right 100% - $s-home-divide-ratio
144150
margin-right $s-home-middle-gap
145151
transition all 0.6s cubic-bezier(0.645, 0.045, 0.355, 1)
152+
transform-origin right bottom
146153
147154
@media (max-width 1080px)
148155
margin-right ($s-home-middle-gap / 4)
@@ -241,10 +248,6 @@ body
241248
color lighten($c-basic-light, 15%)
242249
font-size 14px
243250
244-
@media (min-width $mq-narrow + 1)
245-
.page
246-
margin-right $s-preview-width + $s-edge-gap
247-
248251
&:not(.doc-mode)
249252
.navbar
250253
background transparent
@@ -330,7 +333,7 @@ body
330333
transform translate(-50%, 30px)
331334
332335
.footer
333-
margin-top 0
336+
margin-top -80px
334337
opacity 0
335338
visibility hidden
336339
@@ -341,6 +344,17 @@ body
341344
visibility hidden
342345
pointer-events none
343346
347+
&:not(.preview-mode)
348+
.previewer
349+
opacity 0
350+
visibility hidden
351+
transform scale(0)
352+
353+
&.preview-mode
354+
@media (min-width $mq-narrow + 1)
355+
.page
356+
margin-right $s-preview-width + $s-edge-gap
357+
344358
// content transition
345359
.content-fade-enter-active,
346360
.content-fade-leave-active

0 commit comments

Comments
 (0)
0