Skip to content

Commit

Permalink
Fit more content on small and medium screens
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkudrna committed Nov 16, 2020
1 parent c36daa9 commit f3a36ea
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 38 deletions.
1 change: 1 addition & 0 deletions assets/scss/02-settings/_container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// growing (like it would with `vw` for example).

$container-width: 78em; // 1.
$container-padding-dense: 0.625rem; // 2.
$container-padding: 1.25rem; // 2.
$container-padding-sm: 2.25em; // 2.

Expand Down
2 changes: 0 additions & 2 deletions assets/scss/02-settings/_header.scss

This file was deleted.

10 changes: 10 additions & 0 deletions assets/scss/03-tools/_container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
}
}

@mixin container-dense() {
padding-right: $container-padding-dense;
padding-left: $container-padding-dense;

@include breakpoint-up(sm) {
padding-right: $container-padding-sm;
padding-left: $container-padding-sm;
}
}

@mixin container-fluid() {
max-width: none;
}
Expand Down
4 changes: 4 additions & 0 deletions assets/scss/06-objects/_container.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@
.container--article {
@include container-article();
}

.container--dense {
@include container-dense();
}
26 changes: 22 additions & 4 deletions assets/scss/06-objects/_section.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
.section {
padding-top: spacing(2);
padding-bottom: spacing(2);
padding-top: spacing(1);
padding-bottom: spacing(1);

@include breakpoint-up(lg) {
padding-top: spacing(1.5);
padding-bottom: spacing(1.5);
}

@include breakpoint-up(xl) {
padding-top: spacing(2);
padding-bottom: spacing(2);
}
}

.section--dense {
padding-top: spacing(1);
padding-bottom: spacing(2);

@include breakpoint-up(sm) {
@include breakpoint-up(lg) {
padding-top: spacing(1.5);
}

@include breakpoint-up(xl) {
padding-top: spacing(2);
}
}
Expand All @@ -16,7 +30,11 @@
padding-top: spacing(1);
padding-bottom: 0;

@include breakpoint-up(sm) {
@include breakpoint-up(lg) {
padding-top: spacing(1.5);
}

@include breakpoint-up(xl) {
padding-top: spacing(2);
}
}
56 changes: 27 additions & 29 deletions assets/scss/07-components/_header.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// 1. Optically align logo with other content.

.header {
padding-top: spacing(1);
padding-bottom: spacing(1);
padding-top: spacing(0.5);
padding-bottom: spacing(0.5);

@include breakpoint-up(lg) {
padding-top: spacing(1);
padding-bottom: spacing(1);
}
}

.header__layout {
@include breakpoint-up($header-linear-breakpoint-with-navigation) {
display: flex;
align-items: center;
}
display: flex;
align-items: center;
}

.header__logotype {
Expand All @@ -19,45 +22,40 @@
left: -0.15em; // 1.
display: inline-flex;
align-items: flex-start;
margin-right: 1em;
}

.header__logo {
width: 2em;
height: 2em;
margin-right: 1em;

@include breakpoint-up(lg) {
margin-right: 1em;
}
}

.header__title {
@include typography(header-title);
}

.header__navigation {
&:not(:empty) {
padding-top: 1rem;
}
display: none;

@include breakpoint-up($header-linear-breakpoint-with-navigation) {
margin-left: auto;

&:not(:empty) {
padding-top: 0;
}
@include breakpoint-up(lg) {
display: block;
}
}

.header--without-navigation .header__layout {
@include breakpoint-up($header-linear-breakpoint-without-navigation) {
display: flex;
align-items: center;
}
.header__navigation {
margin-left: auto;
}

.header--without-navigation .header__navigation {
@include breakpoint-up($header-linear-breakpoint-without-navigation) {
margin-left: auto;
.header--without-navigation .header__logo {
@include breakpoint-up(sm) {
margin-right: 1em;
}
}

&:not(:empty) {
padding-top: 0;
}
.header--without-navigation .header__title {
@include breakpoint-up(sm) {
display: block;
}
}
6 changes: 5 additions & 1 deletion assets/scss/07-components/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $_navigation-icon-padding: 0.5em;
justify-content: space-between;
margin: -1 * $_navigation-item-padding;

@include breakpoint-up($header-linear-breakpoint-with-navigation) {
@include breakpoint-up(lg) {
margin:
-1 * $_navigation-item-padding-big
-1 * $_navigation-icon-padding
Expand Down Expand Up @@ -108,6 +108,10 @@ $_navigation-icon-padding: 0.5em;

.navigation__list + .navigation__list {
@include breakpoint-up(sm) {
margin-left: spacing(0.5);
}

@include breakpoint-up(xl) {
margin-left: spacing(1);
}
}
1 change: 0 additions & 1 deletion assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
@import "02-settings/colors";
@import "02-settings/container";
@import "02-settings/grid";
@import "02-settings/header";
@import "02-settings/modularscale";
@import "02-settings/tables";
@import "02-settings/typography";
Expand Down
4 changes: 4 additions & 0 deletions author.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
<div class="container">

<h2>Články</h2>

</div>
<div class="container container--dense">

<div class="post-feed">
{{#foreach ../posts}}
<div class="post-feed__item">
Expand Down
2 changes: 1 addition & 1 deletion index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<main class="site__content background-alternate">
<section class="section">
<div class="container">
<div class="container container--dense">

<div class="post-feed post-feed--articles">
{{#foreach posts visibility="public"}}
Expand Down
3 changes: 3 additions & 0 deletions partials/related-posts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
{{^headline}}Poslední články{{/headline}}
</h2>

</div>
<div class="container container--dense">

<div class="post-row">
{{#foreach posts visibility="public"}}
<div class="post-row__item">
Expand Down

0 comments on commit f3a36ea

Please sign in to comment.