mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +00:00
Fix body.sidebar-active content width
This commit is contained in:
parent
c90f82ef4f
commit
0e79d308ed
@ -1,6 +1,8 @@
|
|||||||
if (hexo-config('sidebar.position') == 'right') {
|
if (hexo-config('sidebar.position') == 'right') {
|
||||||
.sidebar-active {
|
.sidebar-active {
|
||||||
+desktop() {
|
// Note: $sidebar-desktop + $content-desktop-large should be greater than desktop-large threshold
|
||||||
|
// Otherwise a horizontal scrollbar will appear
|
||||||
|
+desktop-large() {
|
||||||
padding-right: $sidebar-desktop;
|
padding-right: $sidebar-desktop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -14,7 +16,7 @@ if (hexo-config('sidebar.position') == 'right') {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
.sidebar-active {
|
.sidebar-active {
|
||||||
+desktop() {
|
+desktop-large() {
|
||||||
padding-left: $sidebar-desktop;
|
padding-left: $sidebar-desktop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,14 +95,8 @@ if (hexo-config('sidebar.position') == 'right') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-dimmer {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
+tablet-mobile() {
|
|
||||||
.sidebar-dimmer {
|
.sidebar-dimmer {
|
||||||
background: black;
|
background: black;
|
||||||
display: block;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
left: 0;
|
left: 0;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@ -116,4 +112,9 @@ if (hexo-config('sidebar.position') == 'right') {
|
|||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+desktop-large() {
|
||||||
|
.sidebar-dimmer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
@import '_variables/base';
|
||||||
|
|
||||||
body { margin-top: 2rem; }
|
body { margin-top: 2rem; }
|
||||||
|
|
||||||
.use-motion .menu-item,
|
.use-motion .menu-item,
|
||||||
@ -30,7 +32,7 @@ body { margin-top: 2rem; }
|
|||||||
.sidebar-panel { display: block; }
|
.sidebar-panel { display: block; }
|
||||||
|
|
||||||
.noscript-warning {
|
.noscript-warning {
|
||||||
background-color: #f55;
|
background-color: lighten($red, 20%);
|
||||||
color: white;
|
color: white;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
@ -40,5 +42,5 @@ body { margin-top: 2rem; }
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 50;
|
z-index: $zindex-5;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -286,7 +286,7 @@ NexT.utils = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
updateSidebarPosition: function() {
|
updateSidebarPosition: function() {
|
||||||
if (window.innerWidth < 992 || CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') return;
|
if (window.innerWidth < 1200 || CONFIG.scheme === 'Pisces' || CONFIG.scheme === 'Gemini') return;
|
||||||
// Expand sidebar on post detail page by default, when post has a toc.
|
// Expand sidebar on post detail page by default, when post has a toc.
|
||||||
const hasTOC = document.querySelector('.post-toc');
|
const hasTOC = document.querySelector('.post-toc');
|
||||||
let display = CONFIG.page.sidebar;
|
let display = CONFIG.page.sidebar;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user