Skip to content

Commit

Permalink
Fix facet price filter label spacing (Shopify#300)
Browse files Browse the repository at this point in the history
* Fix facet price filter label spacing

* Move currency label out of the wrapperto fix the absolute position

* add strip_html to the message when filtering price

* apply strip_html before | escape filter
  • Loading branch information
tauthomas01 authored Aug 3, 2021
1 parent 53168d1 commit 7c130e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions assets/template-collection.css
Original file line number Diff line number Diff line change
Expand Up @@ -280,20 +280,21 @@
padding: 2rem;
}

.facets__price > * + * {
.facets__price .field + .field-currency {
margin-left: 2rem;
}

.facets__price .field {
align-items: center;
}

.facets__price .field .field__currency {
.facets__price .field-currency {
align-self: center;
margin-right: 0.6rem;
}

.facets__price .field__label {
left: 2.1rem;
left: 1.5rem;
}

button.facets__button {
Expand Down
12 changes: 7 additions & 5 deletions sections/main-collection-product-grid.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
</summary>
<div class="facets__display">
<div class="facets__header">
{%- assign max_price_amount = filter.range_max | money | escape -%}
{%- assign max_price_amount = filter.range_max | money | strip_html | escape -%}
<span class="facets__selected">{{ "sections.collection_template.max_price" | t: price: max_price_amount }}</span>
<facet-remove>
<a href="{{ filter.url_to_remove }}" class="facets__reset link underlined-link" >
Expand All @@ -112,8 +112,8 @@
</facet-remove>
</div>
<price-range class="facets__price">
<span class="field-currency">{{ cart.currency.symbol }}</span>
<div class="field">
<span class="field__currency">{{ cart.currency.symbol }}</span>
<input class="field__input"
name="{{ filter.min_value.param_name }}"
id="Filter-{{ filter.label | escape }}-GTE"
Expand All @@ -128,8 +128,9 @@
</input>
<label class="field__label" for="Filter-{{ filter.label | escape }}-GTE">{{ 'sections.collection_template.from' | t }}</label>
</div>

<span class="field-currency">{{ cart.currency.symbol }}</span>
<div class="field">
<span class="field__currency">{{ cart.currency.symbol }}</span>
<input class="field__input"
name="{{ filter.max_value.param_name }}"
id="Filter-{{ filter.label | escape }}-LTE"
Expand Down Expand Up @@ -311,8 +312,8 @@
<p class="mobile-facets__info">{{ "sections.collection_template.max_price" | t: price: max_price_amount }}</p>

<price-range class="facets__price">
<span class="field-currency">{{ cart.currency.symbol }}</span>
<div class="field">
<span class="field__currency">{{ cart.currency.symbol }}</span>
<input class="field__input"
name="{{ filter.min_value.param_name }}"
id="Mobile-Filter-{{ filter.label | escape }}-GTE"
Expand All @@ -327,8 +328,9 @@
</input>
<label class="field__label" for="Mobile-Filter-{{ filter.label | escape }}-GTE">{{ 'sections.collection_template.from' | t }}</label>
</div>

<span class="field-currency">{{ cart.currency.symbol }}</span>
<div class="field">
<span class="field__currency">{{ cart.currency.symbol }}</span>
<input class="field__input"
name="{{ filter.max_value.param_name }}"
id="Mobile-Filter-{{ filter.label | escape }}-LTE"
Expand Down

0 comments on commit 7c130e8

Please sign in to comment.