hacks-guide-minimal-mistake.../_sass/page.scss

741 lines
13 KiB
SCSS
Raw Normal View History

2015-01-21 15:32:22 +01:00
/* ==========================================================================
Page layout
========================================================================== */
2013-09-07 16:10:55 +02:00
body {
2014-07-31 19:09:32 +02:00
background-color: $bodycolor;
font-family: $base-font;
color: $text-color;
2013-05-24 16:25:31 +02:00
}
2015-01-21 15:32:22 +01:00
2015-04-17 12:43:36 +02:00
/*
2015-01-21 15:32:22 +01:00
Header
========================================================================== */
2013-05-24 16:25:31 +02:00
.navigation-wrapper {
2014-07-31 19:09:32 +02:00
@include container;
padding: 2em 0 1em;
2014-07-31 19:09:32 +02:00
font-family: $heading-font;
2013-05-24 16:25:31 +02:00
font-weight: 700;
text-transform: uppercase;
2014-07-31 19:09:32 +02:00
@include clearfix;
2013-05-24 16:25:31 +02:00
}
2015-01-21 15:32:22 +01:00
/* Site name */
2013-05-24 16:25:31 +02:00
.site-name {
2014-07-31 19:09:32 +02:00
@include grid(12,10);
@include prefix(12,1);
@include suffix(12,1);
2013-05-24 16:25:31 +02:00
margin-bottom: 1em;
float: none;
display: block;
2014-07-31 19:09:32 +02:00
@include font-rem(24);
@media #{$small} {
@include grid(12,2);
@include prefix(12,0.5);
@include suffix(12,0.5);
@include font-rem(16);
}
2014-07-31 19:09:32 +02:00
@media #{$x-large} {
@include grid(12,1.5);
@include prefix(12,2);
}
2013-05-24 16:25:31 +02:00
}
2015-01-21 15:32:22 +01:00
/* Top navigation links */
2013-05-24 16:25:31 +02:00
.top-navigation {
2014-07-31 19:09:32 +02:00
@include grid(12,10);
@include prefix(12,1);
@include suffix(12,1);
2013-05-24 16:25:31 +02:00
margin-bottom: 1em;
float: none;
display: block;
2014-07-31 19:09:32 +02:00
@media #{$small} {
@include grid(12,9);
@include prefix(12,0);
@include suffix(12,0);
}
2014-07-31 19:09:32 +02:00
@media #{$x-large} {
@include grid(12,8);
}
2013-05-24 16:25:31 +02:00
ul {
margin: 0;
padding: 0;
2014-02-13 20:20:28 +01:00
clear: both;
list-style-type: none;
2013-05-24 16:25:31 +02:00
}
li {
2014-02-13 20:20:28 +01:00
display: block;
2013-05-24 16:25:31 +02:00
list-style-type: none;
2014-07-31 19:09:32 +02:00
border-bottom: 1px solid lighten($black,80);
border-bottom: 1px solid fade($black,10);
@include font-rem(16);
2014-02-13 20:20:28 +01:00
&:last-child {
border-bottom: 0 solid transparent;
}
2014-07-31 19:09:32 +02:00
@media #{$small} {
2014-02-13 20:20:28 +01:00
display: inline;
margin-right: 25px;
white-space: nowrap;
border-bottom: 0 solid transparent;
}
2015-04-17 12:43:36 +02:00
a {
2014-02-13 20:20:28 +01:00
display: block;
padding: 10px 0;
2013-05-24 16:25:31 +02:00
decoration: none;
border-bottom: 0 solid transparent;
2014-07-31 19:09:32 +02:00
@include transition(all .2s);
@media #{$small} {
2014-02-13 20:20:28 +01:00
display: inline;
padding: 0;
}
2013-05-24 16:25:31 +02:00
}
}
}
2015-01-21 15:32:22 +01:00
/* Animated lines for mobile nav button */
2014-07-31 19:09:32 +02:00
$button-size: 1.5rem;
@mixin navicon-line() {
2014-02-13 20:20:28 +01:00
display: inline-block;
2014-07-31 19:09:32 +02:00
width: $button-size;
height: $button-size/7;
2014-02-13 20:20:28 +01:00
// line color
2014-07-31 19:09:32 +02:00
background: $white;
border-radius: $button-size/14;
2014-02-13 20:20:28 +01:00
transition: .3s;
}
.navicon-lines-button {
2014-07-31 19:09:32 +02:00
padding: $button-size/4 $button-size/2;
2014-02-13 20:20:28 +01:00
transition: .3s;
cursor: pointer;
user-select: none;
2014-07-31 19:09:32 +02:00
border-radius: $button-size/7;
2014-02-13 20:20:28 +01:00
}
.navicon-lines-button:hover {
2014-02-13 20:20:28 +01:00
opacity: 1;
}
.navicon-lines-button:active {
2014-02-13 20:20:28 +01:00
transition: 0;
}
.navicon-lines {
2014-02-13 20:20:28 +01:00
margin-right: 10px;
2014-07-31 19:09:32 +02:00
margin-bottom: $button-size/5;
2014-02-13 20:20:28 +01:00
// create middle line
2014-07-31 19:09:32 +02:00
@include navicon-line;
2014-02-13 20:20:28 +01:00
position: relative;
// create the upper and lower lines as pseudo-elements of the middle line
&:before,
&:after {
2014-07-31 19:09:32 +02:00
@include navicon-line;
2014-02-13 20:20:28 +01:00
position: absolute;
left: 0;
content: '';
2014-07-31 19:09:32 +02:00
-webkit-transform-origin: $button-size/14 center;
transform-origin: $button-size/14 center;
2014-02-13 20:20:28 +01:00
}
2014-07-31 19:09:32 +02:00
&:before { top: $button-size/4; }
&:after { top: -$button-size/4; }
2014-02-13 20:20:28 +01:00
}
.navicon-lines-button:hover {
2014-02-13 20:20:28 +01:00
opacity: 1;
.navicon-lines {
2014-07-31 19:09:32 +02:00
&:before { top: $button-size/3.5; }
&:after { top: -$button-size/3.5; }
2014-02-13 20:20:28 +01:00
}
}
.navicon-lines-button.x.active .navicon-lines {
2014-02-13 20:20:28 +01:00
// hide the middle line
background: transparent;
// overlap the lines by setting both their top values to 0
&:before,
&:after {
-webkit-transform-origin: 50% 50%;
transform-origin: 50% 50%;
top: 0;
2014-07-31 19:09:32 +02:00
width: $button-size;
2014-02-13 20:20:28 +01:00
}
// rotate the lines to form the x shape
&:before {
-webkit-transform: rotate3d(0,0,1,45deg);
transform: rotate3d(0,0,1,45deg);
}
&:after {
-webkit-transform: rotate3d(0,0,1,-45deg);
transform: rotate3d(0,0,1,-45deg);
}
}
// Style the toggle menu link and hide it
.nav .navtoggle {
2014-07-31 19:09:32 +02:00
@include font-rem(18);
2014-02-13 20:20:28 +01:00
font-weight: normal;
2014-07-31 19:09:32 +02:00
background-color: $black;
2015-04-17 12:43:36 +02:00
color: $white;
2014-02-13 20:20:28 +01:00
border: none;
cursor: pointer;
2014-07-31 19:09:32 +02:00
@media #{$small} {
2014-02-13 20:20:28 +01:00
display: none;
}
}
.nav button {
border: none;
background: none;
}
.navtoggle i {
2014-02-13 20:20:28 +01:00
z-index:-1;
}
.icon-menu {
position: relative;
top: 3px;
line-height: 0;
}
// When JavaScript is disabled, we hide the toggle button
.no-js .nav .navtoggle {
display: none;
}
// When JavaScript is disabled, we show the menu
.no-js .nav ul {
max-height: 30em;
overflow: hidden;
}
// When JavaScript is enabled, we hide the menu
.js .nav ul {
max-height: 0;
overflow: hidden;
2014-07-31 19:09:32 +02:00
@media #{$small} {
2014-02-13 20:20:28 +01:00
max-height: 30em;
}
}
// Displaying the menu when the user has clicked on the button
2015-04-17 12:43:36 +02:00
.js .nav .active + ul {
2014-02-13 20:20:28 +01:00
max-height: 30em;
overflow: hidden;
-webkit-transition: max-height .4s;
-moz-transition: max-height .4s;
-o-transition: max-height .4s;
-ms-transition: max-height .4s;
transition: max-height .4s;
}
2015-01-21 15:32:22 +01:00
/* Main content */
2013-05-24 16:25:31 +02:00
#main {
counter-reset: captions;
2014-07-31 19:09:32 +02:00
@include container;
@include clearfix;
2013-05-24 16:25:31 +02:00
clear: both;
margin-top: 2em;
h1 {
margin-top: 0;
}
.post,
.page {
2014-07-31 19:09:32 +02:00
@include container;
@include grid(12,10);
@include prefix(12,1);
@include suffix(12,1);
2013-05-24 16:25:31 +02:00
margin-bottom: 2em;
2014-07-31 19:09:32 +02:00
@media #{$small} {
@include grid(12,8);
2014-07-31 19:09:32 +02:00
@include prefix(12,0);
@include suffix(12,0);
}
@media #{$large} {
@include grid(12,6);
}
2014-07-31 19:09:32 +02:00
@media #{$x-large} {
@include grid(12,5);
}
2013-05-24 16:25:31 +02:00
}
}
2015-01-21 15:32:22 +01:00
/* Index listing specific styling */
2013-05-24 16:25:31 +02:00
#index {
2014-07-31 19:09:32 +02:00
@include container;
@include grid(12,10);
@include prefix(12,1);
@include suffix(12,1);
2013-05-24 16:25:31 +02:00
margin-bottom: 2em;
2014-07-31 19:09:32 +02:00
@media #{$small} {
@include grid(12,8);
2014-07-31 19:09:32 +02:00
@include prefix(12,0);
@include suffix(12,0);
}
@media #{$large} {
@include grid(12,6);
}
2014-07-31 19:09:32 +02:00
@media #{$x-large} {
@include grid(12,5);
}
2013-09-07 18:26:18 +02:00
h3 {
margin: 0;
padding-bottom: .5em;
2014-07-31 19:09:32 +02:00
@include font-rem(28);
border-bottom: 1px solid lighten($black,70);
2013-09-07 18:26:18 +02:00
}
2013-05-24 16:25:31 +02:00
article {
h2 {
margin-bottom: 4px;
2014-07-31 19:09:32 +02:00
@include font-rem(20);
&.link-post {
2014-07-31 19:09:32 +02:00
margin-bottom: 0px + $doc-line-height;
margin-bottom: 0rem + ($doc-line-height / $doc-font-size);
}
}
p {
2014-07-31 19:09:32 +02:00
@include font-rem(14);
2013-05-24 16:25:31 +02:00
}
p+p {
text-indent: 0;
}
}
}
2015-01-21 15:32:22 +01:00
/* Large feature header image */
2013-05-24 16:25:31 +02:00
.image-wrap {
position: relative;
margin-bottom: 2em;
2014-10-03 21:14:20 +02:00
@include clearfix;
2013-05-24 16:25:31 +02:00
&:after {
content: " ";
display: block;
position: absolute;
bottom: 0;
2013-05-24 16:25:31 +02:00
left: 8%;
width: 0;
height: 0;
border: 10px solid transparent;
2014-07-31 19:09:32 +02:00
border-bottom-color: $bodycolor;
@media #{$small} {
left: 25%;
}
@media #{$large} {
border-width: 20px;
}
2014-07-31 19:09:32 +02:00
@media #{$x-large} {
left: 33.333333333%;
}
2013-05-24 16:25:31 +02:00
}
img {
width: 100%;
height: auto;
-ms-interpolation-mode: bicubic;
}
.headline-wrap {
position: absolute;
bottom: 25px;
2014-07-31 19:09:32 +02:00
@include prefix(12,1);
@media #{$small} {
left: 25%;
margin-left: 0;
}
2014-07-31 19:09:32 +02:00
@media #{$x-large} {
@include prefix(12,1);
}
2013-05-24 16:25:31 +02:00
h1, h2 {
2014-07-31 19:09:32 +02:00
color: $white;
@include text-shadow(0 1px 2px rgba(0,0,0,.25));
2013-05-24 16:25:31 +02:00
}
}
}
2015-01-21 15:32:22 +01:00
/* Post byline */
2013-05-24 16:25:31 +02:00
.byline {
clear: both;
font-size: 80%;
}
.article-author-side,
2013-05-24 16:25:31 +02:00
.article-author-bottom {
2013-09-07 16:10:55 +02:00
h3 {
margin-bottom: 0;
2013-05-24 16:25:31 +02:00
}
p {
font-size: 80%;
font-style: italic;
}
a, a:hover {
border-bottom: 0 solid transparent;
}
}
2015-01-21 15:32:22 +01:00
/* Default social media links in author sidebar */
2013-09-07 18:57:20 +02:00
.author-social {
display: block;
margin-bottom: 5px;
2014-07-31 19:09:32 +02:00
@include font-rem(14);
color: $black;
2013-09-07 18:57:20 +02:00
&:visited {
2014-07-31 19:09:32 +02:00
color: $black;
2013-09-07 18:57:20 +02:00
}
&:hover {
2014-07-31 19:09:32 +02:00
@include scale(1.1);
2013-09-07 18:57:20 +02:00
}
&:active {
2014-07-31 19:09:32 +02:00
@include translate(0, 2px);
2013-09-07 18:57:20 +02:00
}
.fa {
margin-right: 5px;
}
2013-09-07 18:57:20 +02:00
}
2015-01-21 15:32:22 +01:00
/* Author sidebar */
.article-author-side {
2013-05-24 16:25:31 +02:00
display: none;
.bio-photo {
max-width: 110px;
2014-07-31 19:09:32 +02:00
@include rounded(150px);
}
2014-07-31 19:09:32 +02:00
@media #{$small} {
display: block;
2014-07-31 19:09:32 +02:00
@include grid(12,2);
@include prefix(12,0.5);
@include suffix(12,0.5);
h3,
p,
.author-social {
display: block;
max-width: 125px;
}
h3 {
margin-top: 10px;
margin-bottom: 10px;
}
p {
margin-bottom: 20px;
}
.author-social {
margin-bottom: 5px;
}
}
2014-07-31 19:09:32 +02:00
@media #{$large} {
h3,
.bio-photo,
p,
.author-social {
max-width: 150px;
}
}
2014-07-31 19:09:32 +02:00
@media #{$x-large} {
@include grid(12,1.5);
@include prefix(12,2);
}
2013-05-24 16:25:31 +02:00
}
2015-01-21 15:32:22 +01:00
/* Author module - mobile only */
2013-05-24 16:25:31 +02:00
.article-author-bottom {
2013-09-07 18:57:20 +02:00
margin-bottom: 1em;
2014-07-31 19:09:32 +02:00
@media #{$small} {
display: none;
}
2013-05-24 16:25:31 +02:00
.bio-photo {
float: left;
margin-right: 25px;
max-width: 100px;
2014-07-31 19:09:32 +02:00
@include rounded(150px);
2013-05-24 16:25:31 +02:00
}
2013-09-07 18:57:20 +02:00
.author-social {
display: inline-block;
margin-right: 10px;
2013-09-07 18:57:20 +02:00
}
2014-07-31 19:09:32 +02:00
@media #{$large} {
h3,
.bio-photo,
p,
.author-social {
max-width: 150px;
}
}
2013-09-07 18:57:20 +02:00
}
2015-01-21 15:32:22 +01:00
/* Post content wrapper */
2013-09-07 18:57:20 +02:00
.article-wrap {
// Dotted line underlines for links
p > a,
2015-09-28 14:15:15 +02:00
p > em > a,
p > strong > a,
2013-09-07 18:57:20 +02:00
li > a {
text-decoration: underline;
2013-09-07 18:57:20 +02:00
}
2013-05-24 16:25:31 +02:00
}
2015-01-21 15:32:22 +01:00
/* Table of contents */
2013-05-24 16:25:31 +02:00
.toc {
font-size: 95%;
@media #{$large} {
display: block;
2014-07-31 19:09:32 +02:00
@include grid(12,2);
@include prefix(12,0.5);
@include suffix(12,0.5);
position: absolute;
top: 5.5em;
right: 0;
2014-07-31 19:09:32 +02:00
background-color: $white;
}
2013-05-24 16:25:31 +02:00
header {
2014-07-31 19:09:32 +02:00
background: lighten($black, 10);
2013-05-24 16:25:31 +02:00
}
h3 {
margin: 0;
padding: 5px 10px;
2014-07-31 19:09:32 +02:00
color: $white;
@include font-rem(16);
2014-02-13 16:26:04 +01:00
text-transform: uppercase;
2013-05-24 16:25:31 +02:00
&:hover {
cursor: pointer;
}
}
ul {
margin: 2px 0 0;
padding: 0;
line-height: 1;
}
li {
display: block;
2014-02-13 16:26:04 +01:00
margin: 0 0 1px 0;
2013-05-24 16:25:31 +02:00
padding: 0;
2014-07-31 19:09:32 +02:00
font-family: $heading-font;
2014-02-13 16:26:04 +01:00
list-style-type: none;
2013-05-24 16:25:31 +02:00
&:last-child {
border-bottom-width: 0;
2013-05-24 16:25:31 +02:00
}
a {
2013-05-24 16:25:31 +02:00
padding: 10px;
display: block;
2014-07-31 19:09:32 +02:00
color: $white;
2014-10-03 21:14:20 +02:00
text-decoration: none;
2014-07-31 19:09:32 +02:00
background: lighten($black, 30);
@include opacity(0.7);
@include transition(opacity 0.2s ease-in-out);
2014-02-13 16:26:04 +01:00
&:hover {
2014-07-31 19:09:32 +02:00
@include opacity(1);
2014-02-13 16:26:04 +01:00
}
2013-05-24 16:25:31 +02:00
}
ul {
2014-02-13 16:26:04 +01:00
margin: 1px 0 0;
li a {
padding-left: 20px;
}
2013-05-24 16:25:31 +02:00
}
}
}
2015-01-21 15:32:22 +01:00
/* TOC trigger for collapsing */
2014-10-03 21:14:20 +02:00
#drawer {
max-height: 100%;
2014-10-03 21:14:20 +02:00
overflow: hidden;
&.js-hidden {
max-height: 0;
}
}
2015-01-21 15:32:22 +01:00
/* Image grid - not used */
2013-05-24 16:25:31 +02:00
.image-grid {
2014-07-31 19:09:32 +02:00
@include clearfix;
2013-05-24 16:25:31 +02:00
list-style: none;
margin: 0 0 1em;
padding: 0;
li {
2014-07-31 19:09:32 +02:00
@include grid(12,6);
@media #{$micro} {
width: 33.333333%;
}
2014-07-31 19:09:32 +02:00
@media #{$small} {
width: 25%;
}
2014-07-31 19:09:32 +02:00
@media #{$medium} {
width: 20%;
}
2014-07-31 19:09:32 +02:00
@media #{$large} {
width: 16.666666666%;
}
2013-05-24 16:25:31 +02:00
}
}
2015-01-21 15:32:22 +01:00
/* Recent grid - not used */
2013-05-24 16:25:31 +02:00
.recent-grid {
2014-07-31 19:09:32 +02:00
@include clearfix;
2013-05-24 16:25:31 +02:00
list-style: none;
margin: 1em 0;
li {
display: inline;
2015-04-17 12:43:36 +02:00
a {
2013-05-24 16:25:31 +02:00
border-bottom: 0 solid transparent;
&:hover {
border-bottom: 0 solid transparent;
}
}
}
img {
width: 19%;
margin-bottom: 1%;
}
}
2015-01-21 15:32:22 +01:00
/* Social sharing links */
/* Social media brand buttons */
.social-share {
margin-bottom: 0px + $doc-line-height;
margin-bottom: 0rem + ($doc-line-height / $doc-font-size);
ul, li {
margin: 0;
padding: 0;
list-style: none;
}
li {
display: inline-block;
}
2015-04-17 12:43:36 +02:00
$social:
(facebook, $facebook-color),
(flickr, $flickr-color),
(foursquare, $foursquare-color),
(google-plus, $google-plus-color),
(instagram, $instagram-color),
(linkedin, $linkedin-color),
(pinterest, $pinterest-color),
(rss, $rss-color),
(tumblr, $tumblr-color),
(twitter, $twitter-color),
(vimeo, $vimeo-color),
(youtube, $youtube-color);
@each $socialnetwork, $color in $social {
.#{$socialnetwork} {
background: $color;
2015-04-17 12:43:36 +02:00
}
}
a {
display: block;
padding: 8px 20px;
text-decoration: none !important;
text-transform: uppercase;
@include font-rem(14);
font-family: $heading-font;
font-weight: 700;
color: $white;
opacity: 0.8;
&:hover {
opacity: 1;
}
}
span {
display: none;
@media #{$medium} {
display: inline;
padding-left: 5px;
}
}
h4 {
@include font-rem(14);
margin-bottom: 10px;
text-transform: uppercase;
}
}
2015-01-21 15:32:22 +01:00
/* Footer wrapper */
2013-05-24 16:25:31 +02:00
.footer-wrap {
2014-07-31 19:09:32 +02:00
@include container;
@include clearfix;
2013-05-24 16:25:31 +02:00
clear: both;
padding-bottom: 3em;
a,
a:active,
a:visited,
p,
h4,
h5,
2013-09-07 18:26:18 +02:00
h6,
2015-04-17 12:43:36 +02:00
span {
2014-07-31 19:09:32 +02:00
@include font-rem(14);
2013-09-07 18:26:18 +02:00
}
2013-05-24 16:25:31 +02:00
footer {
2014-07-31 19:09:32 +02:00
@include grid(12,10);
@include prefix(12,1);
@include suffix(12,1);
@media #{$small} {
@include grid(12,6);
@include prefix(12,3);
@include suffix(12,3);
}
2014-07-31 19:09:32 +02:00
@media #{$x-large} {
@include grid(12,4.5);
@include prefix(12,4);
@include suffix(12,3.5);
}
2013-05-24 16:25:31 +02:00
}
}
2015-01-21 15:32:22 +01:00
/* Related articles list */
2013-05-24 16:25:31 +02:00
.related-articles {
2014-07-31 19:09:32 +02:00
@include grid(12,10);
@include prefix(12,1);
@include suffix(12,1);
2013-09-07 18:26:18 +02:00
margin-bottom: 2em;
2014-07-31 19:09:32 +02:00
@media #{$small} {
@include grid(12,6);
@include prefix(12,3);
@include suffix(12,3);
}
2014-07-31 19:09:32 +02:00
@media #{$x-large} {
@include grid(12,4.5);
@include prefix(12,4);
@include suffix(12,3.5);
}
2013-05-24 16:25:31 +02:00
h4 {
text-transform: uppercase;
margin-bottom: 0;
}
li {
margin-bottom: 0;
}
}
2013-09-07 17:59:02 +02:00
2015-04-17 12:43:36 +02:00
/*
2015-01-21 15:32:22 +01:00
Browser upgrade alert
========================================================================== */
2013-09-07 16:10:55 +02:00
.browser-upgrade {
2013-05-24 16:25:31 +02:00
background: #000;
text-align: center;
margin: 0 0 2em 0;
padding: 10px;
text-align: center;
2014-07-31 19:09:32 +02:00
color: $white;
2013-05-24 16:25:31 +02:00
a {
2014-07-31 19:09:32 +02:00
color: $white;
border-bottom: 1px dotted $white;
2013-05-24 16:25:31 +02:00
text-decoration: none;
&:hover {
2014-07-31 19:09:32 +02:00
border-bottom: 1px solid $white;
2013-05-24 16:25:31 +02:00
}
}
2013-09-07 17:59:02 +02:00
}
2015-04-17 12:43:36 +02:00
/*
2015-01-21 15:32:22 +01:00
Google search form
========================================================================== */
2013-09-07 17:59:02 +02:00
#goog-fixurl {
ul {
list-style: none;
margin-left: 0;
padding-left: 0;
li {
list-style-type: none;
}
}
}
#goog-wm-qt {
width: auto;
margin-right: 10px;
margin-bottom: 20px;
padding: 8px 20px;
display: inline-block;
2014-07-31 19:09:32 +02:00
@include font-rem(14);
background-color: $white;
color: $black;
2013-09-07 17:59:02 +02:00
border-width: 2px !important;
border-style: solid !important;
2014-07-31 19:09:32 +02:00
border-color: lighten($black,50);
@include rounded(3px);
2013-09-07 17:59:02 +02:00
}
#goog-wm-sb {
2014-07-31 19:09:32 +02:00
@extend .btn;
2014-04-07 12:29:07 +02:00
}