Introduce media queries and small screen adjustments

This commit is contained in:
Basti 2020-11-18 15:13:45 +01:00
parent 92d959ffbb
commit 0b125cf323
Signed by untrusted user: basti
GPG Key ID: 9F88009D31D99C72
2 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,33 @@
$breakpoints-max: (
small: 600px,
medium: 960px,
large: 1280px
);
$breakpoints-min: (
small: 601px,
medium: 961px,
large: 1281px
);
@mixin media-max($screen-size) {
@if map-has-key($breakpoints-max, $screen-size) {
@media (max-width: map-get($breakpoints-max, $screen-size)) {
@content;
}
} @else {
// Debugging
@warn "'#{$screen-size}' has not been declared as a breakpoint."
}
}
@mixin media-min($screen-size) {
@if map-has-key($breakpoints-min, $screen-size) {
@media (min-width: map-get($breakpoints-min, $screen-size)) {
@content;
}
} @else {
// Debugging
@warn "'#{$screen-size}' has not been declared as a breakpoint."
}
}

View File

@ -1,3 +1,5 @@
@import "mediaqueries";
$content-width: 800px; $content-width: 800px;
$content-max-width: 100%; $content-max-width: 100%;
@ -15,6 +17,10 @@ body {
background: #0d4f99; background: #0d4f99;
background: linear-gradient(35deg, #8955a0 0, #0d4f99 100%); background: linear-gradient(35deg, #8955a0 0, #0d4f99 100%);
@include media-max(small) {
padding: 3rem 0;
}
h1 { h1 {
font-size: 1.8rem; font-size: 1.8rem;
color: #fff; color: #fff;
@ -42,6 +48,10 @@ body {
margin-top: 2rem; margin-top: 2rem;
color: rgba(255,255,255,0.6); color: rgba(255,255,255,0.6);
@include media-max(small) {
font-size: 0.85rem;
}
strong { strong {
font-weight: 400; font-weight: 400;
color: #fff; color: #fff;
@ -81,6 +91,14 @@ main {
margin: 4rem auto; margin: 4rem auto;
text-align: left; text-align: left;
@include media-max(medium) {
max-width: 90%;
}
@include media-max(small) {
margin: 3rem auto;
}
h2, h3 { h2, h3 {
margin-bottom: 1.5em; margin-bottom: 1.5em;
} }
@ -119,6 +137,11 @@ main {
border-bottom: 1px dotted #ccc; border-bottom: 1px dotted #ccc;
padding-bottom: 4rem; padding-bottom: 4rem;
margin-bottom: 4rem; margin-bottom: 4rem;
@include media-max(small) {
padding-bottom: 3rem;
margin-bottom: 3rem;
}
} }
} }
@ -130,6 +153,10 @@ main {
grid-row-gap: 1rem; grid-row-gap: 1rem;
grid-column-gap: 2rem; grid-column-gap: 2rem;
@include media-max(small) {
grid-template-columns: 1fr;
}
margin-top: 3rem; margin-top: 3rem;
h3 { h3 {