-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Product card spacing and price polish #407
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,7 @@ | |
<dt> | ||
<span class="visually-hidden">{{ 'products.product.price.regular_price' | t }}</span> | ||
</dt> | ||
<dd> | ||
<dd class="regular-price"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remember wanting to stir away from using classes in the customer templates. Those classes should be generic enough so it's ok to have them I take it ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I think so. We do use a few other simple classes in this template as well as the account table for convenience and clarity. At a certain point a selector becomes too flaky and indiscernible to justify. This PR actually resolves a styling bug that presumably happened due to unintended selector scope. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sweet! And makes sense some selectors you removed were not pretty 😅 |
||
<s>{{ line_item.original_price | money }}</s> | ||
</dd> | ||
<dt> | ||
|
@@ -150,7 +150,7 @@ | |
<dt> | ||
<span class="visually-hidden">{{ 'products.product.price.unit_price' | t }}</span> | ||
</dt> | ||
<dd> | ||
<dd class="unit-price"> | ||
<span> | ||
{%- capture unit_price_separator -%} | ||
<span aria-hidden="true">/</span><span class="visually-hidden">{{ 'accessibility.unit_price_separator' | t }} </span> | ||
|
@@ -187,7 +187,7 @@ | |
<dt> | ||
<span class="visually-hidden">{{ 'products.product.price.regular_price' | t }}</span> | ||
</dt> | ||
<dd> | ||
<dd class="regular-price"> | ||
<s>{{ line_item.original_line_price | money }}</s> | ||
</dd> | ||
<dt> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Darn, you're right @KaichenWang. I forgot the support for
gap
outside a grid layout isn't as good. It won't be too long before this is viable, but I don't feel good about it as is.Unfortunately the next simplest option I see (that doesn't change existing spacing under any other circumstances/conditions) involves including this new
price--unit-price
class so we can add margin only when the sale badge and unit price are displayed. Thoughts on this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If unit price is not displayed, wouldn't the sale badge still require margin around it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be receiving the 1rem right margin it was previously. When using the gap solution, I had prevented the margin-right of 1rem on the last price item, since gap was covering both the vertical and horizontal spacing. But that should be reverted now and that margin should always be there unless there's some configuration I'm not aware of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's a shame
gap
isn't well-supported enough at least for now. Regarding vertical spacing, I feel there should be margin above the badge when it wrapsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks good right now no ? 🤔 Or do you think there should be more spacing than there is on your second screenshot @KaichenWang ?
Also I wonder how accurate is that gap support chart on
caniuse
. When I test on Safari which seem to be version14.1
on my laptop, it works 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most likely yeah 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I'm fine with merging as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be late at the party! We can add a
0.5rem
margin to help space out the items, it works well!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paired with Meli and we found a compromise that will allow us to simplify this code and include the additional spacing Kai wants. Will create a follow up PR to address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow up to this convo here #430