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

167 lines
3.5 KiB
Stylus
Raw Normal View History

@require "common/variables.styl";
@require "./common/animated.styl";
.page-template {
2020-04-01 12:09:06 +08:00
padding-top: $header-height;
position: relative;
.page-top {
position: fixed;
top: 0;
width: 100%;
2020-04-01 12:09:06 +08:00
height: $header-height;
2020-04-01 23:03:38 +08:00
z-index: $z-index-5;
box-sizing: border-box;
transition();
}
.page-middle {
width: 100%;
2020-04-01 12:09:06 +08:00
display: flex;
justify-content: center;
padding: $component-interspace 0;
2020-04-01 12:09:06 +08:00
.main-content {
width: $main-content-width;
2020-04-01 12:09:06 +08:00
height: 100%;
position: relative;
box-sizing: border-box;
2020-04-29 16:37:13 +08:00
if (hexo-config('magic.enable') && hexo-config('magic.sidebar.enable')) {
2020-04-29 16:37:13 +08:00
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;
2020-04-29 16:37:13 +08:00
if (hexo-config('magic.sidebar.position') == left) {
left: 0;
} else {
right: 0;
}
width: $sidebar-width;
box-sizing: border-box;
}
}
2020-04-21 10:47:36 +08:00
.main-content-left {
position: relative;
2020-04-29 16:37:13 +08:00
if (hexo-config('magic.sidebar.position') == left) {
float: right;
} else {
float: left;
}
2020-04-21 10:47:36 +08:00
width: 100%;
box-sizing: border-box;
2020-04-21 10:47:36 +08:00
}
2020-04-21 10:47:36 +08:00
}
.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();
}
2020-04-28 23:20:17 +08:00
.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;
2020-04-26 15:16:53 +08:00
width: $tool-button-width;
height: $tool-button-width;
border-radius: 5px;
2020-04-26 15:16:53 +08:00
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);
} else {
border: 1px solid var(--third-text-color);
}
&:hover {
transition();
color: var(--background-color);
background: var(--primary-color);
}
}
}
}
2020-04-28 23:20:17 +08:00
.page-bottom {
width: 100%;
}
}
.page-top-shrink {
2020-04-28 23:20:17 +08:00
transition();
2020-04-01 12:09:06 +08:00
padding-top: $header-shrink-height;
.page-top {
2020-04-01 12:09:06 +08:00
height: $header-shrink-height;
}
.sidebar-tools {
top: $header-shrink-height + $component-interspace !important;
2020-04-03 18:18:42 +08:00
}
2020-04-21 10:47:36 +08:00
2020-04-03 18:18:42 +08:00
}
@media screen and (max-width: $media-max-width) {
.main-content {
width: $main-content-width * 1.2 !important;
}
2020-04-05 00:42:07 +08:00
.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);
2020-04-21 10:47:36 +08:00
}
//.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);
}
2020-04-05 00:42:07 +08:00
}