Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

done #3637

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

done #3637

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions assets/component-pagination.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,32 @@
.pagination-wrapper {
margin-top: 5rem;
}

.pagination__spacer--psudo {
display: none;
}
}




@media screen and (max-width: 990px) {
.pagintaion__link {
display: none;
}

li:nth-child(1 of .pagintaion__link),
li:nth-last-child(1 of .pagintaion__link) {
display: block;
}

.pagination__spacer + .pagination__spacer {
display: none;
}
}



.pagination__list {
display: flex;
flex-wrap: wrap;
Expand Down
3 changes: 2 additions & 1 deletion sections/main-collection-product-grid.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
{%- endstyle -%}

<div class="section-{{ section.id }}-padding gradient color-{{ section.settings.color_scheme }}">
{%- paginate collection.products by section.settings.products_per_page -%}
{% comment %} {%- paginate collection.products by section.settings.products_per_page -%} {% endcomment %}
{%- paginate collection.products by 1 -%}
{% comment %} Sort is the first tabbable element when filter type is vertical {% endcomment %}
{%- if section.settings.enable_sorting and section.settings.filter_type == 'vertical' -%}
<facet-filters-form class="facets facets-vertical-sort page-width small-hide">
Expand Down
17 changes: 16 additions & 1 deletion snippets/pagination.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

{{ 'component-pagination.css' | asset_url | stylesheet_tag }}

{% capture psudo_spacer %}
<li class="pagination__spacer pagination__spacer--psudo">
<span class="pagination__item">&hellip;</span>
</li>
{% endcapture %}

{%- if paginate.parts.size > 0 -%}
<div class="pagination-wrapper">
<nav class="pagination" role="navigation" aria-label="{{ 'general.pagination.label' | t }}">
Expand All @@ -32,7 +38,11 @@
{%- endif -%}

{%- for part in paginate.parts -%}
<li>
{% assign next_part = paginate.parts[forloop.index] %}
{% if forloop.last and part.title != paginate.current_page and prev_part.title != paginate.current_page %}
{{ psudo_spacer }}
{% endif %}
<li class="{% if part.is_link %}pagintaion__link{% elsif part.title != paginate.current_page %}pagination__spacer{% endif %}">
{%- if part.is_link -%}
<a
href="{{ part.url }}{{ anchor }}"
Expand All @@ -57,6 +67,11 @@
{%- endif -%}
{%- endif -%}
</li>

{% if forloop.first and part.title != paginate.current_page and next_part.title != paginate.current_page %}
{{ psudo_spacer }}
{% endif %}
{% assign prev_part = part %}
{%- endfor -%}

{%- if paginate.next -%}
Expand Down
Loading