Skip to content

Commit 2d04b0b

Browse files
authored
Fix/194 banner on mobile (#198)
* fix (#194): update mobile banner styles * feature: add responsive mixin for future styles
1 parent 1657ad3 commit 2d04b0b

File tree

5 files changed

+32
-19
lines changed

5 files changed

+32
-19
lines changed

src/.vuepress/components/BetaBanner.vue

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,32 @@ export default {}
66
<aside class="beta-banner">
77
<p>
88
⚠️ Beta Version: Docs are still under development and are subject to
9-
change. ⚠️
9+
change.
1010
</p>
1111
</aside>
1212
</template>
1313

14-
<style></style>
14+
<style lang="scss" scoped>
15+
.beta-banner {
16+
position: fixed;
17+
z-index: 20;
18+
top: 3.6rem;
19+
left: 0;
20+
right: 0;
21+
display: flex;
22+
align-items: center;
23+
justify-content: center;
24+
background-color: #fffedb;
25+
box-sizing: border-box;
26+
border-bottom: 1px solid #eaecef;
27+
font-weight: bold;
28+
text-align: center;
29+
padding: 10px 20px;
30+
box-sizing: border-box;
31+
32+
p {
33+
margin: 0;
34+
line-height: 1.4;
35+
}
36+
}
37+
</style>

src/.vuepress/styles/index.styl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,21 +125,6 @@
125125
}
126126
}
127127

128-
.beta-banner
129-
position fixed
130-
z-index 20
131-
top $navbarHeight
132-
left 0
133-
right 0
134-
height 3rem
135-
display flex
136-
align-items center
137-
justify-content center
138-
background-color #fffedb
139-
box-sizing border-box
140-
border-bottom 1px solid $borderColor
141-
font-weight bold
142-
143128
.scrimba,
144129
.vueschool {
145130
background-color: #e7ecf3;

src/.vuepress/theme/styles/index.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ body
4747
position fixed
4848
z-index 10
4949
margin 0
50-
top $navbarHeight
50+
top 6.6rem // $navbarHeight + $betaBannerHeight
5151
left 0
5252
bottom 0
5353
box-sizing border-box
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@mixin breakpoint($breakpoint) {
2+
@media (min-width: $breakpoint) {
3+
@content;
4+
}
5+
}

src/.vuepress/theme/styles/mobile.styl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $mobileSidebarWidth = $sidebarWidth * 0.82
1313
// wide mobile
1414
@media (max-width: $MQMobile)
1515
.sidebar
16-
top 0
16+
top $navbarHeight
1717
padding-top $navbarHeight
1818
transform translateX(-100%)
1919
transition transform .2s ease

0 commit comments

Comments
 (0)