hexo-theme-keep/source/css/layout/page.styl

167 lines
3.5 KiB
Stylus

@require "common/variables.styl";
@require "./common/animated.styl";
.page-template {
padding-top: $header-height;
position: relative;
.page-top {
position: fixed;
top: 0;
width: 100%;
height: $header-height;
z-index: $z-index-5;
box-sizing: border-box;
transition();
}
.page-middle {
width: 100%;
display: flex;
justify-content: center;
padding: $component-interspace 0;
.main-content {
width: $main-content-width;
height: 100%;
position: relative;
box-sizing: border-box;
if (hexo-config('magic.enable') && hexo-config('magic.sidebar.enable')) {
if (hexo-config('magic.sidebar.position') == left) {
padding-left: $sidebar-width + $component-interspace;
} else {
padding-right: $sidebar-width + $component-interspace;
}
.main-content-right {
position: absolute;
if (hexo-config('magic.sidebar.position') == left) {
left: 0;
} else {
right: 0;
}
width: $sidebar-width;
box-sizing: border-box;
}
}
.main-content-left {
position: relative;
if (hexo-config('magic.sidebar.position') == left) {
float: right;
} else {
float: left;
}
width: 100%;
box-sizing: border-box;
}
}
.sidebar-tools {
position: fixed;
top: $header-height + $component-interspace;
if (hexo-config('side_tools.position') == left) {
left: ((100% - $main-content-width) / 4);
} else {
right: ((100% - $main-content-width) / 4);
}
transition();
}
.scroll-to-top {
display: none;
position: fixed;
if (hexo-config('back2top.position') == left) {
left: ((100% - $main-content-width) / 4);
} else {
right: ((100% - $main-content-width) / 4);
}
bottom: $component-interspace;
li {
cursor: pointer;
width: $tool-button-width;
height: $tool-button-width;
border-radius: 5px;
font-size: 1em;
display: flex;
align-items: center;
justify-content: center;
background: var(--background-color);
if (hexo-config('magic.enable') == true) {
magic-style(1.1, 1.1);
} else {
border: 1px solid var(--third-text-color);
}
&:hover {
transition();
color: var(--background-color);
background: var(--primary-color);
}
}
}
}
.page-bottom {
width: 100%;
}
}
.page-top-shrink {
transition();
padding-top: $header-shrink-height;
.page-top {
height: $header-shrink-height;
}
.sidebar-tools {
top: $header-shrink-height + $component-interspace !important;
}
}
@media screen and (max-width: $media-max-width) {
.main-content {
width: $main-content-width * 1.2 !important;
}
.sidebar-tools {
if (hexo-config('side_tools.position') == left) {
left: 2% !important;
transform-origin: left top;
} else {
right: 2% !important;
transform-origin: right top;
}
transform: scale(0.8);
}
//.sidebar-toc {
// right: 2% !important;
//}
.scroll-to-top {
if (hexo-config('back2top.position') == left) {
left: 2% !important;
transform-origin: left bottom;
} else {
right: 2% !important;
transform-origin: right bottom;
}
transform: scale(0.8);
}
}