Skip to content

Commit

Permalink
Shorten reputation tab names on lower resolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Oct 16, 2024
1 parent 042a580 commit 8b51fa0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
31 changes: 31 additions & 0 deletions resources/sass/pages/_homepage.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
@charset "UTF-8";

@import "bootstrap/scss/mixins/breakpoints";

@mixin size($size) {
@if ($size == 'intermediate') {
@include media-breakpoint-only(sm) {
@content;
}
@include media-breakpoint-up(xxl) {
@content;
}
} @else {
@include media-breakpoint-up($size) {
@content;
}
}
}

.card-reputation {
img, svg {
width: 40px;
Expand Down Expand Up @@ -30,6 +47,20 @@
border-bottom: none;
}
}

.long-name {
display: none;
@include size(intermediate) {
display: initial;
}
}

.short-name {
display: initial;
@include size(intermediate) {
display: none;
}
}
}

#box-forum {
Expand Down
9 changes: 6 additions & 3 deletions resources/views/home.twig
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,16 @@
<div class="pt-3 px-3">
<div id="reputation-tabs" class="nav nav-pills">
<a data-bs-toggle="tab" href="#week" class="nav-link {{ settings.reputationMode == 'week' ? 'active' }}">
<span>W tym tygodniu</span>
<span class="long-name">W tym tygodniu</span>
<span class="short-name">Tyg.</span>
</a>
<a data-bs-toggle="tab" href="#month" class="nav-link {{ settings.reputationMode == 'month' ? 'active' }}">
<span>W tym miesiącu</span>
<span class="long-name">W tym miesiącu</span>
<span class="short-name">Mies.</span>
</a>
<a data-bs-toggle="tab" href="#quarter" class="nav-link {{ settings.reputationMode == 'quarter' ? 'active' }}">
<span>W tym kwartale</span>
<span class="long-name">W tym kwartale</span>
<span class="short-name">Kwar.</span>
</a>
</div>
</div>
Expand Down

0 comments on commit 8b51fa0

Please sign in to comment.