hacks-guide-minimal-mistake.../_sass/minimal-mistakes/_sidebar.scss

354 lines
6 KiB
SCSS
Raw Normal View History

2016-03-11 04:29:30 +01:00
/* ==========================================================================
SIDEBAR
========================================================================== */
2016-03-20 20:20:33 +01:00
/*
Default
========================================================================== */
2016-03-11 04:29:30 +01:00
.sidebar {
@include clearfix();
// @include breakpoint(max-width $large) {
// /* fix z-index order of follow links */
// position: relative;
// z-index: 10;
// -webkit-transform: translate3d(0, 0, 0);
// transform: translate3d(0, 0, 0);
// }
2016-03-21 21:36:24 +01:00
2016-03-20 20:20:33 +01:00
@include breakpoint($large) {
float: left;
width: calc(#{$right-sidebar-width-narrow} - 1em);
2016-04-05 22:14:35 +02:00
opacity: 0.75;
-webkit-transition: opacity 0.2s ease-in-out;
transition: opacity 0.2s ease-in-out;
2016-04-05 22:14:35 +02:00
&:hover {
opacity: 1;
}
&.sticky {
overflow-y: auto;
/* calculate height of nav list
viewport height - nav height - masthead x-padding
*/
max-height: calc(100vh - #{$nav-height} - 2em);
}
2016-03-11 04:29:30 +01:00
}
2016-03-21 21:36:24 +01:00
@include breakpoint($x-large) {
width: calc(#{$right-sidebar-width} - 1em);
}
> * {
margin-top: 1em;
margin-bottom: 1em;
}
h2,
h3,
h4,
h5,
h6 {
margin-bottom: 0;
font-family: $sans-serif-narrow;
}
2016-03-21 21:36:24 +01:00
p,
li {
2016-03-21 21:36:24 +01:00
font-family: $sans-serif;
font-size: $type-size-6;
2016-03-31 04:20:55 +02:00
line-height: 1.5;
}
2016-03-21 21:36:24 +01:00
img {
width: 100%;
&.emoji {
width: 20px;
height: 20px;
}
}
2016-03-11 04:29:30 +01:00
}
2016-03-20 20:20:33 +01:00
.sidebar__right {
margin-bottom: 1em;
2016-03-21 21:36:24 +01:00
2016-03-20 20:20:33 +01:00
@include breakpoint($large) {
position: absolute;
top: 0;
right: 0;
width: $right-sidebar-width-narrow;
margin-right: -1 * $right-sidebar-width-narrow;
padding-left: 1em;
z-index: 10;
&.sticky {
@include clearfix();
position: -webkit-sticky;
position: sticky;
top: 2em;
float: right;
.toc {
.toc__menu {
overflow-y: auto;
max-height: calc(100vh - 7em);
}
}
}
2016-03-20 20:20:33 +01:00
}
2016-03-21 21:36:24 +01:00
2016-03-20 20:20:33 +01:00
@include breakpoint($x-large) {
width: $right-sidebar-width;
margin-right: -1 * $right-sidebar-width;
2016-03-20 20:20:33 +01:00
}
}
.splash .sidebar__right {
@include breakpoint($large) {
position: relative;
float: right;
margin-right: 0;
}
@include breakpoint($x-large) {
margin-right: 0;
}
}
2016-03-11 04:29:30 +01:00
/*
Author profile and links
========================================================================== */
.author__avatar {
2016-03-21 03:15:43 +01:00
display: table-cell;
vertical-align: top;
width: 36px;
height: 36px;
2016-03-21 21:36:24 +01:00
2016-03-20 20:20:33 +01:00
@include breakpoint($large) {
2016-03-21 03:15:43 +01:00
display: block;
width: auto;
height: auto;
}
2016-03-21 21:36:24 +01:00
img {
max-width: 110px;
border-radius: 50%;
@include breakpoint($large) {
padding: 5px;
border: 1px solid $border-color;
}
}
}
.author__content {
2016-03-21 03:15:43 +01:00
display: table-cell;
vertical-align: top;
padding-left: 15px;
2016-03-25 14:39:18 +01:00
padding-right: 25px;
2016-03-21 03:15:43 +01:00
line-height: 1;
2016-03-21 21:36:24 +01:00
2016-03-20 20:20:33 +01:00
@include breakpoint($large) {
2016-03-21 03:15:43 +01:00
display: block;
width: 100%;
2016-03-21 03:15:43 +01:00
padding-left: 0;
padding-right: 0;
}
a {
color: inherit;
text-decoration: none;
}
}
2016-03-11 04:29:30 +01:00
.author__name {
margin: 0;
2016-03-21 21:36:24 +01:00
2016-03-20 20:20:33 +01:00
@include breakpoint($large) {
margin-top: 10px;
margin-bottom: 10px;
}
2016-03-11 04:29:30 +01:00
}
2016-03-21 03:15:43 +01:00
.sidebar .author__name {
font-family: $sans-serif;
font-size: $type-size-5;
2016-03-21 03:15:43 +01:00
}
2016-03-11 04:29:30 +01:00
.author__bio {
2016-03-25 14:39:18 +01:00
margin: 0;
2016-03-21 21:36:24 +01:00
2016-03-20 20:20:33 +01:00
@include breakpoint($large) {
2016-03-25 14:39:18 +01:00
margin-top: 10px;
margin-bottom: 20px;
}
2016-03-11 04:29:30 +01:00
}
2016-03-21 05:03:46 +01:00
.author__urls-wrapper {
2016-03-21 03:15:43 +01:00
position: relative;
display: table-cell;
vertical-align: middle;
2016-03-21 03:15:43 +01:00
font-family: $sans-serif;
z-index: 20;
2016-03-21 05:03:46 +01:00
cursor: pointer;
2016-03-21 21:36:24 +01:00
2016-03-25 14:39:18 +01:00
li:last-child {
a {
margin-bottom: 0;
}
}
.author__urls {
span.label {
padding-left: 5px;
}
}
2016-03-21 03:15:43 +01:00
@include breakpoint($large) {
display: block;
}
button {
position: relative;
margin-bottom: 0;
&:before {
@supports (pointer-events: none) {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
}
&.open {
&:before {
pointer-events: auto;
}
}
2016-03-21 05:03:46 +01:00
@include breakpoint($large) {
display: none;
}
2016-03-21 03:15:43 +01:00
}
}
.author__urls {
2016-03-21 03:15:43 +01:00
display: none;
position: absolute;
right: 0;
2016-03-21 05:03:46 +01:00
margin-top: 15px;
2016-03-21 03:15:43 +01:00
padding: 10px;
2016-03-21 05:03:46 +01:00
list-style-type: none;
2016-03-21 03:15:43 +01:00
border: 1px solid $border-color;
border-radius: $border-radius;
background: $background-color;
box-shadow: 0 2px 4px 0 rgba(#000, 0.16), 0 2px 10px 0 rgba(#000, 0.12);
cursor: default;
2016-03-21 21:36:24 +01:00
&.is--visible {
display: block;
}
2016-03-21 05:03:46 +01:00
@include breakpoint($large) {
display: block;
2016-03-21 17:37:10 +01:00
position: relative;
2016-03-21 05:03:46 +01:00
margin: 0;
padding: 0;
border: 0;
2016-03-21 17:37:10 +01:00
background: transparent;
box-shadow: none;
2016-03-21 05:03:46 +01:00
}
2016-03-21 21:36:24 +01:00
2016-03-21 05:03:46 +01:00
&:before {
display: block;
2016-03-21 03:15:43 +01:00
content: "";
position: absolute;
top: -11px;
left: calc(50% - 10px);
width: 0;
2016-03-21 03:15:43 +01:00
border-style: solid;
border-width: 0 10px 10px;
2016-03-21 05:03:46 +01:00
border-color: $border-color transparent;
z-index: 0;
2016-03-21 21:36:24 +01:00
2016-03-21 05:03:46 +01:00
@include breakpoint($large) {
display: none;
}
2016-03-21 03:15:43 +01:00
}
2016-03-21 21:36:24 +01:00
2016-03-21 05:03:46 +01:00
&:after {
display: block;
2016-03-21 05:03:46 +01:00
content: "";
2016-03-21 03:15:43 +01:00
position: absolute;
top: -10px;
left: calc(50% - 10px);
width: 0;
2016-03-21 03:15:43 +01:00
border-style: solid;
border-width: 0 10px 10px;
border-color: $background-color transparent;
2016-03-21 05:03:46 +01:00
z-index: 1;
2016-03-21 21:36:24 +01:00
2016-03-21 05:03:46 +01:00
@include breakpoint($large) {
display: none;
}
2016-03-21 03:15:43 +01:00
}
2016-03-21 21:36:24 +01:00
ul {
padding: 10px;
list-style-type: none;
}
li {
white-space: nowrap;
}
a {
2016-03-21 03:15:43 +01:00
display: block;
margin-bottom: 5px;
padding-right: 5px;
2016-03-23 03:59:39 +01:00
padding-top: 2px;
padding-bottom: 2px;
2016-04-06 03:37:16 +02:00
color: inherit;
font-size: $type-size-5;
text-decoration: none;
2016-03-21 21:36:24 +01:00
&:hover {
text-decoration: underline;
}
2016-03-11 04:29:30 +01:00
}
}
/*
Wide Pages
========================================================================== */
.wide .sidebar__right {
margin-bottom: 1em;
@include breakpoint($large) {
position: initial;
top: initial;
right: initial;
width: initial;
margin-right: initial;
padding-left: initial;
z-index: initial;
&.sticky {
float: none;
}
}
@include breakpoint($x-large) {
width: initial;
margin-right: initial;
}
}