Add intermediate style to fit right sidenotes

This commit is contained in:
Danila Fedorin 2020-02-03 13:38:21 -08:00
parent 8d22acfe78
commit 153349f3d5
2 changed files with 44 additions and 22 deletions

View File

@ -1,5 +1,6 @@
@import "style.scss"; @import "style.scss";
$sidenote-accommodate-shrink: 10rem;
$sidenote-width: 30rem; $sidenote-width: 30rem;
$sidenote-offset: 1.5rem; $sidenote-offset: 1.5rem;
$sidenote-padding: 1rem; $sidenote-padding: 1rem;
@ -45,8 +46,13 @@ $sidenote-highlight-border-width: .2rem;
margin-left: -($sidenote-width + $sidenote-offset); margin-left: -($sidenote-width + $sidenote-offset);
} }
@media screen and @include bordered-block;
(max-width: $container-width + 2 * ($sidenote-width + 2 * $sidenote-offset)) { padding: $sidenote-padding;
box-sizing: border-box;
text-align: left;
}
@mixin hidden-sidenote {
position: static; position: static;
margin-top: 1rem; margin-top: 1rem;
margin-bottom: 1rem; margin-bottom: 1rem;
@ -56,18 +62,34 @@ $sidenote-highlight-border-width: .2rem;
.sidenote-checkbox:checked ~ & { .sidenote-checkbox:checked ~ & {
display: block; display: block;
} }
}
&.sidenote-left { @media screen and
(max-width: $container-width + 2 * ($sidenote-width + 2 * $sidenote-offset)) {
.sidenote-content.sidenote-left {
@include hidden-sidenote;
margin-left: 0rem; margin-left: 0rem;
} }
&.sidenote-right { .container {
margin-right: 0rem; position: relative;
left: -$sidenote-width/2
} }
} }
@include bordered-block; @media screen and
padding: $sidenote-padding; (max-width: $container-width + ($sidenote-width + 3 * $sidenote-offset)) {
box-sizing: border-box; .post-content {
text-align: left; max-width: 100%;
} }
.sidenote-content.sidenote-right {
@include hidden-sidenote;
margin-right: 0rem;
}
.container {
position: initial;
}
}

View File

@ -1,4 +1,4 @@
$container-width: 50rem; $container-width: 45rem;
$standard-border-width: .075rem; $standard-border-width: .075rem;
$primary-color: #36e281; $primary-color: #36e281;