From 3020a7eb6a578b99b255bd5f72c4ee2cac7d5209 Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Thu, 16 Jul 2020 15:57:28 -0400 Subject: [PATCH 1/2] fix (#194): update mobile banner styles --- src/.vuepress/components/BetaBanner.vue | 27 +++++++++++++++++++++++-- src/.vuepress/styles/index.styl | 15 -------------- src/.vuepress/theme/styles/index.styl | 2 +- src/.vuepress/theme/styles/mobile.styl | 2 +- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/.vuepress/components/BetaBanner.vue b/src/.vuepress/components/BetaBanner.vue index 672389ee41..ca2906f0fe 100644 --- a/src/.vuepress/components/BetaBanner.vue +++ b/src/.vuepress/components/BetaBanner.vue @@ -6,9 +6,32 @@ export default {} - + diff --git a/src/.vuepress/styles/index.styl b/src/.vuepress/styles/index.styl index 0785548d63..1ed44dd2bd 100644 --- a/src/.vuepress/styles/index.styl +++ b/src/.vuepress/styles/index.styl @@ -125,21 +125,6 @@ } } -.beta-banner - position fixed - z-index 20 - top $navbarHeight - left 0 - right 0 - height 3rem - display flex - align-items center - justify-content center - background-color #fffedb - box-sizing border-box - border-bottom 1px solid $borderColor - font-weight bold - .scrimba, .vueschool { background-color: #e7ecf3; diff --git a/src/.vuepress/theme/styles/index.styl b/src/.vuepress/theme/styles/index.styl index b63f1b4093..5a0d16ae99 100644 --- a/src/.vuepress/theme/styles/index.styl +++ b/src/.vuepress/theme/styles/index.styl @@ -47,7 +47,7 @@ body position fixed z-index 10 margin 0 - top $navbarHeight + top 6.6rem // $navbarHeight + $betaBannerHeight left 0 bottom 0 box-sizing border-box diff --git a/src/.vuepress/theme/styles/mobile.styl b/src/.vuepress/theme/styles/mobile.styl index f5bd32739d..88a9d6be9c 100644 --- a/src/.vuepress/theme/styles/mobile.styl +++ b/src/.vuepress/theme/styles/mobile.styl @@ -13,7 +13,7 @@ $mobileSidebarWidth = $sidebarWidth * 0.82 // wide mobile @media (max-width: $MQMobile) .sidebar - top 0 + top $navbarHeight padding-top $navbarHeight transform translateX(-100%) transition transform .2s ease From a54f94fbd7e1ee47bf6a7932b1788b587f7b123b Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Thu, 16 Jul 2020 15:57:37 -0400 Subject: [PATCH 2/2] feature: add responsive mixin for future styles --- src/.vuepress/theme/styles/mixins.scss | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/.vuepress/theme/styles/mixins.scss diff --git a/src/.vuepress/theme/styles/mixins.scss b/src/.vuepress/theme/styles/mixins.scss new file mode 100644 index 0000000000..8627020aa2 --- /dev/null +++ b/src/.vuepress/theme/styles/mixins.scss @@ -0,0 +1,5 @@ +@mixin breakpoint($breakpoint) { + @media (min-width: $breakpoint) { + @content; + } +}