hugo-book/assets/book.scss

236 lines
3.1 KiB
SCSS
Raw Normal View History

@import "normalize";
2018-11-24 14:10:43 +00:00
@import "variables";
@import "markdown";
2019-05-22 12:37:31 +00:00
@import "shortcode";
2018-11-24 14:10:43 +00:00
@import "utils";
2018-09-05 14:22:04 +00:00
html {
font-size: $font-size-base;
2018-11-24 14:10:43 +00:00
letter-spacing: 0.33px;
scroll-behavior: smooth;
2018-09-05 14:22:04 +00:00
}
2018-11-24 14:10:43 +00:00
html,
body {
2018-09-05 14:22:04 +00:00
min-width: $body-min-width;
overflow-x: hidden;
2018-09-05 14:22:04 +00:00
}
body {
2018-09-13 16:07:55 +00:00
color: $body-font-color;
background: $body-background;
font-family: sans-serif;
font-weight: $body-font-weight;
2018-11-07 11:54:18 +00:00
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
box-sizing: border-box;
* {
box-sizing: inherit;
}
2018-09-05 14:22:04 +00:00
}
2018-11-24 14:10:43 +00:00
h1,
h2,
h3,
h4,
h5 {
2018-09-27 23:12:07 +00:00
font-weight: 400;
}
a {
text-decoration: none;
color: $color-link;
2018-09-24 15:03:23 +00:00
&:visited {
color: $color-visited-link;
}
2018-09-05 14:22:04 +00:00
}
img {
vertical-align: middle;
}
aside nav ul {
2018-11-24 14:10:43 +00:00
padding: 0;
margin: 0;
list-style: none;
li {
margin: 1em 0;
}
a {
display: block;
}
2018-11-25 11:06:09 +00:00
a:hover {
opacity: 0.5;
2018-11-25 11:06:09 +00:00
}
ul {
padding-left: $padding-16;
2018-09-24 15:03:23 +00:00
}
2018-11-24 14:10:43 +00:00
}
ul.pagination {
display: flex;
justify-content: center;
.page-item a {
padding: $padding-16;
}
}
2018-11-24 14:10:43 +00:00
.container {
max-width: $container-max-width;
margin: 0 auto;
2018-09-24 15:03:23 +00:00
}
2018-11-24 14:10:43 +00:00
.book-brand {
margin-top: 0;
2018-09-05 14:22:04 +00:00
}
2018-11-24 14:10:43 +00:00
.book-menu {
flex: 0 0 $menu-width;
font-size: $font-size-14;
2018-11-24 14:10:43 +00:00
nav {
width: $menu-width;
padding: $padding-16;
2018-11-24 14:10:43 +00:00
@include fixed;
}
2018-09-05 14:22:04 +00:00
2018-11-25 12:30:25 +00:00
@include dark-links;
2018-11-24 14:10:43 +00:00
}
2018-09-05 14:22:04 +00:00
.book-section-flat {
margin-bottom: $padding-16 * 2;
margin-top: $padding-16 * 2;
> a,
> span {
font-weight: 600;
}
> ul {
padding-left: 0;
}
}
2018-11-24 14:10:43 +00:00
.book-page {
min-width: $body-min-width;
flex-grow: 1;
2018-11-24 14:10:43 +00:00
padding: $padding-16;
}
2018-09-24 15:03:23 +00:00
2018-11-24 14:10:43 +00:00
.book-header {
margin-bottom: $padding-16;
display: none;
}
2018-09-29 23:22:39 +00:00
2018-11-24 14:10:43 +00:00
.book-toc {
flex: 0 0 $toc-width;
font-size: $font-size-12;
2018-11-24 14:10:43 +00:00
nav {
width: $toc-width;
padding: $padding-16;
2018-09-27 23:12:07 +00:00
2018-11-24 14:10:43 +00:00
@include fixed;
}
nav > ul > li:first-child {
margin-top: 0;
}
2018-11-24 14:10:43 +00:00
}
2019-03-31 21:48:17 +00:00
.book-footer {
display: flex;
padding-top: $padding-16;
2019-03-31 21:48:17 +00:00
font-size: $font-size-14;
align-items: baseline;
img {
2019-05-23 14:43:54 +00:00
width: 1em;
height: 1em;
2019-03-31 21:48:17 +00:00
}
}
2018-11-24 14:10:43 +00:00
.book-posts {
min-width: $body-min-width;
max-width: $sm-breakpoint;
flex-grow: 1;
2018-11-24 14:10:43 +00:00
padding: $padding-16;
2018-09-24 15:03:23 +00:00
article {
padding-bottom: $padding-16;
2018-09-05 14:22:04 +00:00
}
2018-09-24 15:03:23 +00:00
}
2018-09-05 14:22:04 +00:00
.book-home {
padding: $padding-16;
}
// Responsive styles
2018-11-24 14:10:43 +00:00
aside nav,
.book-page,
2019-01-24 22:30:31 +00:00
.book-posts,
2018-11-24 14:10:43 +00:00
.markdown {
transition: 0.2s ease-in-out;
transition-property: transform, margin-left, opacity;
will-change: transform, margin-left;
}
2018-11-24 14:10:43 +00:00
@media screen and (max-width: $md-breakpoint) {
.book-toc {
display: none;
2018-09-05 14:22:04 +00:00
}
}
2018-09-05 14:22:04 +00:00
2018-11-24 14:10:43 +00:00
@media screen and (max-width: $sm-breakpoint) {
.book-menu {
margin-left: -$menu-width;
}
2018-09-05 14:22:04 +00:00
2018-11-24 14:10:43 +00:00
.book-header {
display: flex;
2018-09-05 14:22:04 +00:00
}
2018-09-29 23:22:39 +00:00
#menu-control:checked + main {
2018-11-24 14:10:43 +00:00
.book-menu nav,
2019-01-24 22:30:31 +00:00
.book-page,
.book-posts {
2018-11-24 14:10:43 +00:00
transform: translateX($menu-width);
}
2018-11-24 14:10:43 +00:00
.book-header label {
transform: rotate(90deg);
}
.markdown {
2018-11-24 14:10:43 +00:00
opacity: 0.25;
}
2018-09-13 16:07:55 +00:00
}
2018-09-24 15:03:23 +00:00
}
// Extra space for big screens
2018-11-24 14:10:43 +00:00
@media screen and (min-width: $container-max-width) {
.book-page,
.book-posts,
2018-11-24 14:10:43 +00:00
.book-menu nav,
.book-toc nav {
padding: $padding-16 * 2 $padding-16;
}
}
// Add fonts
@import "fonts";
// Add custom defined styles
@import "custom";