Skip to content

Commit 6bec651

Browse files
author
luchunyu
committed
fix(docs): fix doc sidebar not in mobile with fixed
fix #29
1 parent c778d88 commit 6bec651

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

docs/layouts/component.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
)
1616
| {{sub.title}}
1717
span.is-text-gray-6.has-margin-left-sm(v-if="sub.name") {{ sub.name }}
18-
c-box-item.content(xs=12 sm=8 md=9 lg=10)
18+
c-box-item.content(xs=12 sm="8 offset-4" md="9 offset-3" lg="10 offset-2")
1919
transition(name='fade')
2020
router-view.c-container.is-lg
2121
c-footer

docs/styles/theme.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
}
8787

8888
.main {
89-
height: calc(100vh - 4em);
9089
margin-top: 4em;
9190

9291
& .sidebar,
@@ -95,13 +94,19 @@
9594
}
9695

9796
& .sidebar {
98-
position: relative;
97+
position: fixed;
98+
height: calc(100vh - 4em);
9999
background: #fff;
100100
box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
101101
padding-bottom: 5em;
102102
}
103103
}
104104

105+
[media="xs"] .main .sidebar {
106+
position: relative;
107+
height: auto;
108+
}
109+
105110
.hero {
106111
width: 100%;
107112
min-height: calc(100vh - 9.04em);

0 commit comments

Comments
 (0)