Skip to content

Commit

Permalink
Improved the pagination styling (rapidez#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roene-JustBetter authored Sep 5, 2024
1 parent a7dd2ec commit 3b25687
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
1 change: 1 addition & 0 deletions resources/css/app.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import 'components/vue-slider';
@import './theme-variables.css';
@import './components/pagination.css';

@tailwind base;
@tailwind components;
Expand Down
37 changes: 37 additions & 0 deletions resources/css/components/pagination.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.pagination .pagination-button:first-child:nth-last-child(3),
.pagination .pagination-button:first-child:nth-last-child(3) ~ .pagination-button {
@apply hidden;
}

.pagination {
@apply flex flex-wrap justify-center gap-x-2 !m-0 !my-6 max-md:gap-y-4;
}

.pagination-button {
@apply !font-semibold !font-sans !border !border-border !rounded !bg-white !text-neutral !shadow;
}

.pagination-button.active {
@apply !border !border-none !bg-primary !text-white !shadow-none;
}

.pagination-button:first-child {
@apply !mr-auto max-md:w-full max-md:order-last;
}

.pagination-button:last-child {
@apply !ml-auto max-md:w-full max-md:-order-1;
}

.pagination-button:not(:first-child):not(:last-child) {
@apply !m-0 !size-14 max-md:flex-1 max-md:w-auto;
}

.pagination-button:first-child,
.pagination-button:last-child {
@apply h-14 px-6 max-md:!m-0;
}

.pagination-button[disabled] {
@apply opacity-60;
}
6 changes: 4 additions & 2 deletions resources/views/listing/products.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
:react="{and: reactiveFilters}"
:sort-options="sortOptions"
:inner-class="{
button: '!bg-inactive disabled:!bg-opacity-60 !text-white [&.active]:!bg-neutral',
sortOptions: '{{ $dropdownClasses }}'
button: 'pagination-button',
current: 'current-button',
sortOptions: '{{ $dropdownClasses }}',
pagination: 'pagination'
}"
prev-label="@lang('Prev')"
next-label="@lang('Next')"
Expand Down

0 comments on commit 3b25687

Please sign in to comment.