hacks-guide-minimal-mistake.../assets/_scss/_base.scss

287 lines
4.2 KiB
SCSS
Raw Normal View History

2016-03-10 17:13:54 +01:00
/* ==========================================================================
BASE ELEMENTS
========================================================================== */
body {
margin: 0;
padding: 0;
color: $text-color;
font-family: $serif;
line-height: 1.5;
background-color: $background-color;
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
&.overflow--hidden {
/* when primary navigation is visible, the content in the background won't scroll */
overflow: hidden;
}
}
h1, h2, h3, h4, h5, h6 {
line-height: 1.25;
font-family: $sans-serif;
}
h1 {
font-size: 32px;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
h2 {
font-size: 28px;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
h3 {
font-size: 24px;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
h4 {
font-size: 18px;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
h5 {
font-size: 16px;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
h6 {
font-size: 14px;
}
small {
font-size: 0.8rem;
}
u,
ins {
text-decoration: none;
border-bottom: 1px solid $text-color;
a {
color: inherit;
}
}
del a {
color: inherit;
}
/* reduce orphans and widows when printing */
p, pre, blockquote, ul, ol, dl, figure, table, fieldset {
orphans: 3;
widows: 3;
}
2016-03-10 19:06:59 +01:00
/* abbreviations */
2016-03-10 17:13:54 +01:00
abbr[title],
abbr[data-original-title] {
text-decoration: none;
cursor: help;
border-bottom: 1px dotted $text-color;
}
2016-03-10 19:06:59 +01:00
/* blockquotes */
2016-03-10 17:13:54 +01:00
blockquote {
margin: 2em 1em 2em 0;
padding-left: 1em;
padding-right: 1em;
font-style: italic;
border-left: 0.25em solid $accent-color;
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
a {
color: inherit;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
cite {
font-family: $sans-serif;
font-size: 14px;
font-style: normal;
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
&:before {
content: "\2014";
padding-right: 5px;
}
}
}
2016-03-10 19:06:59 +01:00
/* links */
2016-03-10 17:13:54 +01:00
a {
&:focus {
@extend %tab-focus;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
&:hover,
&:active {
outline: 0;
}
2016-03-21 21:36:24 +01:00
&:hover {
img {
box-shadow: 0 0 10px rgba(#000, 0.25);
}
}
2016-03-10 17:13:54 +01:00
}
2016-03-10 19:06:59 +01:00
/* code */
2016-03-10 17:13:54 +01:00
tt, code, kbd, samp, pre {
font-family: $monospace;
2016-03-28 03:23:04 +02:00
font-size: 12px;
2016-03-10 17:13:54 +01:00
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
pre {
overflow-x: auto; // add scrollbars to wide code blocks
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
p code,
li code,
figcaption code {
padding-top: 0.1rem;
padding-bottom: 0.1rem;
2016-03-25 14:33:28 +01:00
background: $code-background-color;
2016-03-23 03:59:39 +01:00
border: 1px solid $lighter-gray;
2016-03-10 17:13:54 +01:00
border-radius: $border-radius;
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
&:before, &:after {
letter-spacing: -0.2em;
content: "\00a0"; // non-breaking space
}
}
2016-03-10 19:06:59 +01:00
/* horizontal rule */
2016-03-10 17:13:54 +01:00
hr {
display: block;
margin: 1em 0;
border: 0;
border-top: 1px solid $border-color;
}
/*
Media and embeds
========================================================================== */
/* Figures and images */
figure {
display: flex;
justify-content: space-between;
align-items: flex-start;
flex-wrap: wrap;
margin: 2em 0;
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
img,
iframe,
.fluid-width-video-wrapper {
margin-bottom: 1em;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
img {
width: 100%;
border-radius: $border-radius;
transition: box-shadow 0.3s;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
> a {
display: block;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
&.half {
> a,
> img {
@include breakpoint($small) {
width: calc(50% - 0.5em);
}
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
figcaption {
width: 100%;
}
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
&.third {
> a,
> img {
@include breakpoint($small) {
width: calc(33.3333% - 0.5em);
}
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
figcaption {
width: 100%;
}
}
}
/* Figure captions */
figcaption {
margin-bottom: 0.65rem;
color: mix(#fff, $text-color, 25%);
font-family: $sans-serif;
font-size: 0.8rem;
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
a {
color: inherit;
text-decoration: none;
border-bottom: 1px solid $light-gray;
transition: border 0.4s ease-in-out;
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
&:hover {
color: #000;
border-bottom-color: #000;
}
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
code {
font-size: 0.64rem;
}
}
/* Fix IE9 SVG bug */
svg:not(:root) {
overflow: hidden;
}
/*
Navigation lists
========================================================================== */
/**
* Removes margins, padding, and bullet points from navigation lists
*
* Example usage:
* <nav>
* <ul>
* <li><a href="#link-1">Link 1</a></li>
* <li><a href="#link-2">Link 2</a></li>
* <li><a href="#link-3">Link 3</a></li>
* </ul>
* </nav>
*/
nav {
ul {
margin: 0;
padding: 0;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
li {
list-style: none;
}
2016-03-21 21:36:24 +01:00
2016-03-10 17:13:54 +01:00
a {
text-decoration: none;
}
}
/*
Global animation transition
========================================================================== */
b, i, strong, em, blockquote, p, q, span, figure, img, h1, h2, header, input, a, tr, td, form button, input[type="submit"], .btn, .highlight, .archive__item-teaser {
2016-03-10 17:13:54 +01:00
transition: all 0.2s ease-in-out;
}