1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-29 00:58:00 +02:00
blog/src/styles/base.scss

364 lines
5.6 KiB
SCSS
Raw Normal View History

2018-07-18 00:24:11 +02:00
@import 'variables';
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
2018-07-18 02:19:32 +02:00
background: $body-background-color;
2018-07-18 00:24:11 +02:00
}
html {
font-size: $font-size-root;
}
body {
font-family: $font-family-base;
font-weight: $font-weight-base;
font-size: $font-size-base;
line-height: $line-height;
color: $font-color-base;
text-rendering: optimizeLegibility;
2018-07-18 02:19:32 +02:00
letter-spacing: -.01em;
2018-07-18 00:24:11 +02:00
font-feature-settings: 'liga', 'kern';
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
min-height: 100vh;
transition: background .6s $easing;
2018-07-18 02:19:32 +02:00
// handling long text, like URLs
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word;
2018-07-18 00:24:11 +02:00
&.dark {
background-color: $body-background-color--dark;
color: $text-color--dark;
}
}
p,
ul,
ol {
margin: 0 0 $spacer;
}
2018-07-18 02:19:32 +02:00
// Reset fonts for relevant elements
/////////////////////////////////////
input,
button,
select,
textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
2018-07-18 00:24:11 +02:00
// Headings
/////////////////////////////////////
2018-07-18 02:19:32 +02:00
h1,
h2 {
margin-top: $spacer * 2;
margin-bottom: $spacer * 2;
}
h3,
h4,
h5,
h6 {
margin-top: $spacer;
margin-bottom: $spacer;
}
2018-07-18 00:24:11 +02:00
h1 {
2018-07-18 02:19:32 +02:00
font-size: $font-size-h2;
@media (min-width: $screen-xs) {
font-size: $font-size-h1;
}
2018-07-18 00:24:11 +02:00
}
h2 {
2018-07-18 02:19:32 +02:00
font-size: $font-size-h3;
@media (min-width: $screen-xs) {
font-size: $font-size-h2;
}
2018-07-18 00:24:11 +02:00
}
h3 {
2018-07-18 02:19:32 +02:00
font-size: $font-size-h4;
@media (min-width: $screen-xs) {
font-size: $font-size-h3;
}
2018-07-18 00:24:11 +02:00
}
h4 {
2018-07-18 02:19:32 +02:00
font-size: $font-size-h5;
@media (min-width: $screen-xs) {
font-size: $font-size-h4;
}
2018-07-18 00:24:11 +02:00
}
h5 {
2018-07-18 02:19:32 +02:00
font-size: $font-size-h6;
@media (min-width: $screen-xs) {
font-size: $font-size-h5;
}
2018-07-18 00:24:11 +02:00
}
h6 {
font-size: $font-size-h6;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: $font-family-headings;
line-height: $line-height-headings;
color: $color-headings;
font-weight: $font-weight-headings;
margin: 0 0 $spacer;
letter-spacing: -.02em;
.dark & {
color: $color-headings--dark;
}
}
// Links
/////////////////////////////////////
a {
color: $brand-cyan;
text-decoration: none;
transition: .2s ease-out;
2018-07-18 02:19:32 +02:00
h1 &,
h2 &,
h3 & {
color: $color-headings;
}
2018-07-18 00:24:11 +02:00
&:hover,
&:focus {
2018-07-18 02:19:32 +02:00
outline: 0;
2018-07-18 00:24:11 +02:00
color: lighten($brand-cyan, 10%);
transform: translate3d(0, -.1rem, 0);
}
2018-07-18 02:19:32 +02:00
&:active {
transition: none;
color: darken($brand-cyan, 30%);
box-shadow: inset 0 -1px 0 darken($brand-cyan, 30%);
}
2018-07-18 00:24:11 +02:00
}
2018-07-19 00:22:06 +02:00
// Responsive Media
2018-07-18 00:24:11 +02:00
/////////////////////////////////////
2018-07-19 00:22:06 +02:00
figure,
2018-07-18 00:24:11 +02:00
img,
2018-07-18 23:04:31 +02:00
svg,
2018-07-19 00:22:06 +02:00
video,
audio,
embed,
canvas,
picture {
2018-07-18 00:24:11 +02:00
max-width: 100%;
height: auto;
2018-07-19 00:22:06 +02:00
margin: 0 auto;
display: block;
border-radius: $border-radius;
}
img {
vertical-align: middle;
2018-07-18 00:24:11 +02:00
}
2018-07-18 02:19:32 +02:00
// Lists
/////////////////////////////////////
ul {
li {
&::before {
content: ' \2015'; // horizontal bar: ― ―
}
}
}
ol {
counter-reset: ol-counter;
li {
&::before {
content: counter(ol-counter) '.';
counter-increment: ol-counter;
}
}
ul li::before {
display: none;
}
}
ul,
ol {
margin-top: 0;
margin-bottom: $spacer;
padding-left: ($spacer * 1.5);
list-style: none;
li {
position: relative;
// stylelint-disable no-descending-specificity
&::before {
position: absolute;
left: -($spacer * 1.5);
top: -1px;
color: $text-color-light;
user-select: none;
}
// stylelint-enable no-descending-specificity
}
ul,
ol {
margin-bottom: 0;
}
}
// Inline typography
/////////////////////////////////////
b,
strong,
.bold {
font-weight: 700;
font-style: normal;
}
em,
.italic {
font-style: italic;
}
abbr[title],
dfn {
text-transform: none;
font-style: normal;
font-size: inherit;
border-bottom: 1px dashed $brand-grey-dimmed;
cursor: help;
font-feature-settings: inherit;
}
mark {
background: #fffaab;
color: $text-color;
}
hr {
border: 0;
border-bottom: 1px dashed #afc3cb;
padding-bottom: $spacer;
margin-bottom: $spacer * 2;
&::before {
bottom: -2px;
width: 100%;
border-bottom: 1px dashed #fff;
}
}
// Quotes
/////////////////////////////////////
q {
font-style: italic;
}
cite {
font-style: normal;
text-transform: uppercase;
}
blockquote,
blockquote > p {
font-style: italic;
}
blockquote {
margin: 0 0 $spacer;
position: relative;
padding-left: 20px;
@media (min-width: $screen-xs) {
padding-left: 40px;
}
@media (min-width: $screen-lg) {
padding-left: 60px;
}
// quotation marks
&::before {
content: '';
font-size: 300%;
color: lighten($text-color, 40%);
position: absolute;
left: -10px;
top: -20px;
@media (min-width: $screen-xs) {
left: 0;
}
@media (min-width: $screen-lg) {
top: -30px;
}
}
p:last-child {
margin-bottom: 0;
}
}
// Selection
/////////////////////////////////////
::-moz-selection {
background: #2e4f5c;
color: #fff;
}
::selection {
background: #2e4f5c;
color: #fff;
}
2018-07-18 23:04:31 +02:00
// More basic elements
/////////////////////////////////////
2018-07-18 00:24:11 +02:00
#___gatsby {
display: flex;
min-height: 100vh;
flex-direction: column;
}
2018-07-18 02:19:32 +02:00
@import 'code';