Skip to content

Commit e800049

Browse files
committed
docs: improve small screen compatibility for Intro & Layout component
1 parent dab5db1 commit e800049

File tree

2 files changed

+48
-17
lines changed

2 files changed

+48
-17
lines changed

docs/.vuepress/theme/components/Intro.vue

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<ul class="feat-list"
1616
v-if="data.features && data.features">
1717
<li v-for="(feature, index) in data.features">
18+
<div class="feat-img"></div>
1819
<h3 v-text="feature.title"></h3>
1920
{{ feature.details }}
2021
</li>
@@ -61,10 +62,16 @@ export default {
6162
@media (max-width 1080px)
6263
width 590px
6364
65+
@media (max-width $mq-mobile)
66+
width auto
67+
6468
> p
6569
margin 0 0 40px
6670
color $c-basic-light
6771
72+
@media (max-width $mq-mobile)
73+
line-height 1.28
74+
6875
.button + .button
6976
margin-left 20px
7077
@@ -74,33 +81,45 @@ export default {
7481
margin-top 60px
7582
padding 0
7683
84+
@media (max-width $mq-mobile)
85+
flex-direction column
86+
margin-top 40px
87+
7788
li
7889
flex 1
7990
color $c-basic-light
8091
line-height 1.42857
8192
word-break break-all
8293
8394
&:not(:last-child)
84-
margin-right 40px
95+
@media (min-width $mq-mobile + 1)
96+
margin-right 40px
97+
98+
@media (max-width $mq-mobile)
99+
margin-bottom 20px
100+
101+
.feat-img
102+
margin 0 auto
103+
max-width 200px
85104
86-
&::before
87-
content ''
88-
display block
89-
padding-top 57%
90-
background no-repeat center top/90%
91-
filter grayscale(50%)
92-
transition filter 0.3s
105+
&::before
106+
content ''
107+
display block
108+
padding-top 57%
109+
background no-repeat center top/90%
110+
filter grayscale(50%)
111+
transition filter 0.3s
93112
94-
&:first-child::before
113+
&:first-child .feat-img::before
95114
background-image url('../assets/images/icon-box.png')
96115
97-
&:nth-child(2)::before
116+
&:nth-child(2) .feat-img::before
98117
background-image url('../assets/images/icon-dir.png')
99118
100-
&:last-child::before
119+
&:last-child .feat-img::before
101120
background-image url('../assets/images/icon-msg.png')
102121
103-
&:hover::before
122+
&:hover .feat-img::before
104123
filter none
105124
106125
h3

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ body
121121
transition all 0.3s
122122
123123
.sidebar
124-
@media (min-width $mq-mobile)
124+
@media (min-width $mq-mobile + 1)
125125
width $s-sidebar-width * 0.82
126126
background $c-bg
127127
128-
@media (min-width $mq-narrow)
128+
@media (min-width $mq-narrow + 1)
129129
width $s-sidebar-width
130130
131131
.page
132-
@media (min-width $mq-mobile)
132+
@media (min-width $mq-mobile + 1)
133133
padding-left $s-sidebar-width * 0.82
134134
135-
@media (min-width $mq-narrow)
135+
@media (min-width $mq-narrow + 1)
136136
padding-left $s-sidebar-width
137137
138138
.theme-container
@@ -171,6 +171,11 @@ body
171171
margin-left 0
172172
transform translateX(-50%)
173173
174+
@media (max-width $mq-mobile)
175+
top 60px
176+
width 150px
177+
height 150px
178+
174179
+ h1
175180
position absolute
176181
z-index 100
@@ -189,6 +194,10 @@ body
189194
margin-left 0
190195
transform translateX(-50%)
191196
197+
@media (max-width $mq-mobile)
198+
top 200px
199+
font-size 26px
200+
192201
&,
193202
+ h1
194203
transition all 0.6s cubic-bezier(0.645, 0.045, 0.355, 1)
@@ -211,6 +220,9 @@ body
211220
transform translateX(-50%)
212221
transition-delay 0.3s
213222
223+
@media (max-width $mq-mobile)
224+
top 250px
225+
214226
.footer
215227
margin-top 800px
216228
padding 15px 0
@@ -223,7 +235,7 @@ body
223235
color lighten($c-basic-light, 15%)
224236
font-size 14px
225237
226-
@media (min-width $mq-narrow)
238+
@media (min-width $mq-narrow + 1)
227239
.page
228240
margin-right $s-preview-width + $s-edge-gap
229241

0 commit comments

Comments
 (0)