fix: sidebar

This commit is contained in:
shenyu 2021-04-09 13:57:44 +08:00
parent 1292dbff48
commit 6270c15b76
2 changed files with 7 additions and 8 deletions

View File

@ -28,12 +28,6 @@
<aside class="sidebar on">
<%- partial('_partial/sidebar') %>
</aside>
<script>
if (window.matchMedia("(max-width: 768px)").matches) {
document.querySelector('.content').classList.remove('on');
document.querySelector('.sidebar').classList.remove('on');
}
</script>
<%- partial('_partial/modal') %>
<%- partial('_partial/after-footer') %>

View File

@ -25,7 +25,12 @@ if hexo-config('mouse.enable')
@media(max-width: 768px)
.tocbot
display none !important
.content
.sidebar
left 0
&.on
transform translateX($aside-width)
left - $aside-width
.content
transform translateX($aside-width)
&.on
transform translateX(0)