Skip to content

Commit

Permalink
fixup! Introduce posts pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkudrna committed Apr 16, 2024
1 parent 7d8c67d commit f563191
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
// Single-purpose overrides.
@forward "styles/10-utilities/background";
@forward "styles/10-utilities/color";
@forward "styles/10-utilities/hidden";
@forward "styles/10-utilities/print";
@forward "styles/10-utilities/spacing";
@forward "styles/10-utilities/text";
2 changes: 2 additions & 0 deletions assets/scss/settings/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ $line-height: spacing.of(1);
$padding-block: spacing.of(0.5);
$padding-inline: 1.5em;
$height: calc(#{2 * $border-width} + #{$line-height} + 2 * #{$padding-block});
$column-gap: 1em;

$line-height-small: 1.25em;
$padding-block-small: 0.5em;
$padding-inline-small: 1em;
$height-small: calc(#{2 * $border-width} + #{$line-height-small} + 2 * #{$padding-block-small});
$column-gap-small: 0.5em;
1 change: 1 addition & 0 deletions assets/scss/styles/06-components/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
}

.button--small {
column-gap: button-settings.$column-gap-small;
height: button-settings.$height-small;
padding: button-settings.$padding-block-small button-settings.$padding-inline-small;
line-height: button-settings.$line-height-small;
Expand Down
11 changes: 11 additions & 0 deletions assets/scss/styles/10-utilities/_hidden.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@use "../../tools/breakpoint";

// stylelint-disable declaration-no-important -- Only allow `!important` for utility classes.

.hidden-sm {
display: none !important;

@include breakpoint.up(md) {
display: initial !important;
}
}
1 change: 1 addition & 0 deletions assets/scss/tools/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
position: relative;
appearance: none;
display: inline-flex;
column-gap: button.$column-gap;
align-items: center;
justify-content: center;
height: button.$height;
Expand Down
12 changes: 9 additions & 3 deletions partials/pagination.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

{{#if prev}}
<a href="{{page_url prev}}" class="button button--secondary button--small">
<span class="spacing-right-1" aria-hidden="true">&larr;</span>
Novější články
<span aria-hidden="true">&larr;</span>
<span>
Novější
<span class="hidden-sm">články</span>
</span>
</a>
{{/if}}

Expand All @@ -16,7 +19,10 @@

{{#if next}}
<a href="{{page_url next}}" class="button button--secondary button--small">
<span class="spacing-right-1">Starší články</span>
<span>
Starší
<span class="hidden-sm">články</span>
</span>
<span aria-hidden="true">&rarr;</span>
</a>
{{/if}}
Expand Down

0 comments on commit f563191

Please sign in to comment.