From 29bdd95f7711922d57c143e0a8b3c0b0ac334096 Mon Sep 17 00:00:00 2001
From: ULIVZ <472590061@qq.com>
Date: Wed, 18 Apr 2018 22:10:50 +0800
Subject: [PATCH] feat($sidebar): support click the part outside sidebar to
close the sidebar.
---
lib/default-theme/Layout.vue | 1 +
lib/default-theme/styles/theme.styl | 24 +++++++++++++++++++-----
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/lib/default-theme/Layout.vue b/lib/default-theme/Layout.vue
index 91ecbfea86..5423e2f0b9 100644
--- a/lib/default-theme/Layout.vue
+++ b/lib/default-theme/Layout.vue
@@ -4,6 +4,7 @@
@touchstart="onTouchStart"
@touchend="onTouchEnd">
+
diff --git a/lib/default-theme/styles/theme.styl b/lib/default-theme/styles/theme.styl
index 49ee40819e..1118ac3acb 100644
--- a/lib/default-theme/styles/theme.styl
+++ b/lib/default-theme/styles/theme.styl
@@ -29,6 +29,15 @@ body
box-sizing border-box
border-bottom 1px solid $borderColor
+.sidebar-mask
+ position fixed
+ z-index 9
+ top 0
+ left 0
+ width 100vw
+ height 100vh
+ display none
+
.sidebar
font-size 15px
background-color #fff
@@ -149,11 +158,16 @@ th, td
.custom-layout
padding-top $navbarHeight
-.theme-container.no-navbar
- .content:not(.custom)
- h1, h2, h3, h4, h5, h6
- margin-top 1.5rem
- padding-top 0
+.theme-container
+ &.sidebar-open
+ .sidebar-mask
+ display: block
+ &.no-navbar
+ .content:not(.custom)
+ h1, h2, h3, h4, h5, h6
+ margin-top 1.5rem
+ padding-top 0
+
@media (min-width: ($MQMobile + 1px))
.theme-container.no-sidebar