hugo-book-theme/assets/book.scss
2019-08-06 11:33:42 +02:00

269 lines
3.9 KiB
SCSS

@import "normalize";
@import "variables";
@import "utils";
@import "markdown";
@import "shortcodes";
html {
font-size: $font-size-base;
letter-spacing: 0.33px;
scroll-behavior: smooth;
}
html,
body {
min-width: $body-min-width;
overflow-x: hidden;
}
body {
color: $body-font-color;
background: $body-background;
font-family: sans-serif;
font-weight: $body-font-weight;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
box-sizing: border-box;
* {
box-sizing: inherit;
}
}
h1,
h2,
h3,
h4,
h5 {
font-weight: $body-font-weight;
}
a {
text-decoration: none;
color: $color-link;
&:visited {
color: $color-visited-link;
}
}
img {
vertical-align: baseline;
}
aside nav ul {
padding: 0;
margin: 0;
list-style: none;
li {
margin: 1em 0;
}
a {
display: block;
}
a:hover {
opacity: 0.5;
}
ul {
padding-left: $padding-16;
}
}
ul.pagination {
display: flex;
justify-content: center;
list-style-type: none;
.page-item a {
padding: $padding-16;
}
}
.container {
max-width: $container-max-width;
margin: 0 auto;
}
.book-brand {
margin-top: 0;
}
.book-menu {
flex: 0 0 $menu-width;
font-size: $font-size-14;
nav {
width: $menu-width;
padding: $padding-16;
@include fixed;
}
@include dark-links;
}
.book-section-flat {
margin-bottom: $padding-16 * 2;
&:not(:first-child) {
margin-top: $padding-16 * 2;
}
> a,
> span {
font-weight: bolder;
}
> ul {
padding-left: 0;
}
}
.book-page {
min-width: $body-min-width;
flex-grow: 1;
padding: $padding-16;
}
.book-header {
margin-bottom: $padding-16;
display: none;
}
.book-search {
border: 0;
border-bottom: $padding-1 solid $gray-200;
outline: none;
// padding: $padding-4 $padding-8 $padding-4 $padding-16+$padding-4;
padding: $padding-4 $padding-8 $padding-4 0;
margin-bottom: $padding-4;
width: 100%;
// background: url("svg/search.svg") left center no-repeat;
// background-size: $padding-16;
&:focus {
border-bottom-color: $body-font-color;
}
}
.book-toc {
flex: 0 0 $toc-width;
font-size: $font-size-12;
nav {
width: $toc-width;
padding: $padding-16;
@include fixed;
}
img {
height: 1em;
}
nav > ul > li:first-child {
margin-top: 0;
}
// Classes to hide nested levels of ToC (can be replaced by @for, but it's more clear like this)
&.level-1 ul ul,
&.level-2 ul ul ul,
&.level-3 ul ul ul ul,
&.level-4 ul ul ul ul ul,
&.level-5 ul ul ul ul ul ul,
&.level-6 ul ul ul ul ul ul ul {
display: none;
}
}
.book-footer {
display: flex;
padding-top: $padding-16;
font-size: $font-size-14;
img {
height: 1em;
}
}
.book-posts {
min-width: $body-min-width;
max-width: $sm-breakpoint;
flex-grow: 1;
padding: $padding-16;
article {
padding-bottom: $padding-16;
}
}
.book-home {
padding: $padding-16;
}
// Responsive styles
aside nav,
.book-page,
.book-posts,
.markdown {
transition: 0.2s ease-in-out;
transition-property: transform, margin-left, opacity;
will-change: transform, margin-left;
}
@media screen and (max-width: $md-breakpoint) {
.book-toc {
display: none;
}
}
@media screen and (max-width: $sm-breakpoint) {
.book-menu {
margin-left: -$menu-width;
font-size: $font-size-base;
}
.book-header {
display: flex;
}
#menu-control:checked + main {
.book-menu nav,
.book-page,
.book-posts {
transform: translateX($menu-width);
}
.book-header label {
transform: rotate(90deg);
}
.markdown {
opacity: 0.25;
}
}
}
// Extra space for big screens
@media screen and (min-width: $container-max-width) {
.book-page,
.book-posts,
.book-menu nav,
.book-toc nav {
padding: $padding-16 * 2 $padding-16;
}
}
// Add fonts
@import "fonts";
// Add custom defined styles
@import "custom";