hacks-guide-minimal-mistake.../assets/_scss/_sidebar.scss
2016-03-24 12:14:40 -04:00

223 lines
No EOL
3.9 KiB
SCSS

/* ==========================================================================
SIDEBAR
========================================================================== */
/*
Default
========================================================================== */
.sidebar {
@include clearfix();
margin-bottom: 1em;
@include breakpoint($large) {
@include span(2 of 12);
@include suffix(0.25 of 12);
}
@include breakpoint($x-large) {
padding-right: 0;
}
h2, h3, h4, h5, h6 {
margin-bottom: 0;
font-family: $sans-serif-narrow;
}
h3 {
font-size: 20px;
}
h4 {
font-size: 18px;
}
p, li {
font-family: $sans-serif;
font-size: 14px;
line-height: 1.2;
}
img {
width: 100%;
}
}
.sidebar__right {
@include breakpoint($medium) {
position: absolute;
top: 0;
right: 1em;
width: $right-sidebar-width-narrow;
padding-left: 2em;
@include breakpoint($large) {
width: $right-sidebar-width;
}
@include breakpoint($x-large) {
width: $right-sidebar-width-wide;
padding-left: span(1 of 12);
}
}
@include breakpoint($large) {
right: calc(50% - (0.5 * #{$large}) + 1em); // 50% - 1/2 of wrapper's max-width + wrapper padding
}
@include breakpoint($x-large) {
right: calc(50% - (0.5 * #{$x-large}) + 1em); // 50% - 1/2 of wrapper's max-width + wrapper padding
}
}
/*
Author profile and links
========================================================================== */
.author__avatar {
display: table-cell;
vertical-align: top;
width: 36px;
height: 36px;
@include breakpoint($large) {
display: block;
width: 100%;
height: 100%;
}
img {
max-width: 110px;
border-radius: 50%;
}
}
.author__content {
display: table-cell;
vertical-align: top;
vertical-align: top;
padding-left: 15px;
padding-right: 15px;
line-height: 1;
@include breakpoint($large) {
display: block;
width: 100%;
padding-left: 0;
padding-right: 0;
}
}
.author__name {
margin: 0;
font-size: 18px;
@include breakpoint($large) {
margin-top: 10px;
margin-bottom: 10px;
font-size: 20px;
}
}
.sidebar .author__name {
font-family: $sans-serif;
}
.author__bio {
margin-bottom: 10px;
@include breakpoint($large) {
margin-bottom: 20px;
}
}
.author__urls-wrapper {
position: relative;
display: table-cell;
vertical-align: middle;
font-family: $sans-serif;
z-index: 9999;
position: relative;
cursor: pointer;
@include breakpoint($large) {
display: block;
}
.btn {
@include breakpoint($large) {
display: none;
}
}
}
.author__urls {
display: none;
position: absolute;
right: 0;
margin-top: 15px;
padding: 10px;
list-style-type: none;
border: 1px solid $border-color;
border-radius: $border-radius;
background: #fff;
z-index: -1;
box-shadow: 0 0 10px rgba(#000, 0.25);
@include breakpoint($large) {
display: block;
position: relative;
margin: 0;
padding: 0;
border: 0;
background: transparent;
box-shadow: none;
}
&:before {
display: block;
content: "";
position: absolute;
top: -11px;
left: calc(50% - 10px);
width: 0;
border-style: solid;
border-width: 0 10px 10px;
border-color: $border-color transparent;
z-index: 0;
@include breakpoint($large) {
display: none;
}
}
&:after {
display: block;
content: "";
position: absolute;
top: -10px;
left: calc(50% - 10px);
width: 0;
border-style: solid;
border-width: 0 10px 10px;
border-color: #fff transparent;
z-index: 1;
@include breakpoint($large) {
display: none;
}
}
a {
display: block;
margin-bottom: 5px;
padding-right: 5px;
padding-top: 2px;
padding-bottom: 2px;
font-size: 14px;
text-decoration: none;
white-space: nowrap;
&:hover {
text-decoration: underline;
}
}
}