Adding and using media-query mixin
This commit is contained in:
parent
7d865269fd
commit
e4029426de
|
@ -84,7 +84,7 @@ li {
|
||||||
padding-left: $spacing-unit;
|
padding-left: $spacing-unit;
|
||||||
@extend %clearfix;
|
@extend %clearfix;
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
@include media-query($on-laptop) {
|
||||||
padding-right: $spacing-unit / 2;
|
padding-right: $spacing-unit / 2;
|
||||||
padding-left: $spacing-unit / 2;
|
padding-left: $spacing-unit / 2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
letter-spacing: -1px;
|
letter-spacing: -1px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
@include media-query($on-laptop) {
|
||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
@include media-query($on-laptop) {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
@include media-query($on-laptop) {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
h4 {
|
h4 {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
@include media-query($on-laptop) {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
width: 45%;
|
width: 45%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 800px) {
|
@include media-query($on-laptop) {
|
||||||
.footer-col-1,
|
.footer-col-1,
|
||||||
.footer-col-2 {
|
.footer-col-2 {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 600px) {
|
@include media-query($on-palm) {
|
||||||
.footer-col {
|
.footer-col {
|
||||||
float: none;
|
float: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 600px) {
|
@include media-query($on-palm) {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 9px;
|
top: 9px;
|
||||||
right: 30px;
|
right: 30px;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
# The main Sass file needs front matter (the dashes are enough)
|
# Only the main Sass file needs front matter (the dashes are enough)
|
||||||
---
|
---
|
||||||
@charset "utf-8";
|
@charset "utf-8";
|
||||||
|
|
||||||
|
@ -21,6 +21,24 @@ $grey-color: #828282;
|
||||||
$grey-color-light: lighten($grey-color, 40%);
|
$grey-color-light: lighten($grey-color, 40%);
|
||||||
$grey-color-dark: darken($grey-color, 25%);
|
$grey-color-dark: darken($grey-color, 25%);
|
||||||
|
|
||||||
|
$on-palm: 600px;
|
||||||
|
$on-laptop: 800px;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Using media queries with like this:
|
||||||
|
// @include media-query($palm) {
|
||||||
|
// .wrapper {
|
||||||
|
// padding-right: $spacing-unit / 2;
|
||||||
|
// padding-left: $spacing-unit / 2;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
@mixin media-query($device) {
|
||||||
|
@media screen and (max-width: $device) {
|
||||||
|
@content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Import partials from `sass_dir` (defaults to `_sass`)
|
// Import partials from `sass_dir` (defaults to `_sass`)
|
||||||
|
|
Loading…
Reference in New Issue