-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Card image border radius #1764
base: main
Are you sure you want to change the base?
Card image border radius #1764
Conversation
Have card images inherit styles from media.
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.
This is great thanks for taking this initiative for fixing it! This would solve this following issue #1525, if you can add it to the PR description! 🙏
I think we should still apply shadow for the Circle
image ratio because otherwise it won't be predictable for merchants. We've been avoiding this kind of magic where merchants don't have control and want to rely on other ways to invest these kind of exceptions to the rule.
While testing I uncover:
- Shadow gets cut off I'll investigate further Monday!
@melissaperreault I know what's causing that. I might have to rethink the approach to avoid it. |
@melissaperreault I've pushed a fix for this now. If you could take another look that'd be great! |
Took another quick look! I am not sure what this is due to but the ratio don't behave the same with the application of the border and shadow to those images now. (Video reference) |
Thanks @melissaperreault. That's fixed, and I've also updated a couple of other spots that media show up to better represent borders and shadows. |
assets/base.css
Outdated
@@ -2832,8 +2834,6 @@ details-disclosure > details { | |||
.global-media-settings--full-width, | |||
.global-media-settings--full-width img { | |||
border-radius: 0; | |||
border-left: none; | |||
border-right: none; |
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.
Is this meant to be removed ? It means that we're going from: current look vs after this borders declarations are removed
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.
Yea, it was intentional, and I think it's nice for imagery to have the borders, but your screenshots highlight that it's not as desirable for text areas. I'll put it back.
assets/component-deferred-media.css
Outdated
height: 100%; | ||
width: 100%; |
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.
Removing those create issues in places where that class is also used like the collage section: video
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.
ok cool. thanks for picking this up.
.multicolumn-card > .multicolumn-card__image-wrapper--full-width:not(.multicolumn-card-spacing) { | ||
border-top-left-radius: calc(var(--text-boxes-radius) - var(--text-boxes-border-width)); | ||
border-top-right-radius: calc(var(--text-boxes-radius) - var(--text-boxes-border-width)); | ||
overflow: hidden; |
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 wonder what situation it was needed for before 🤔
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.
Yea, I was wondering the same. I couldn't find anything. cc/ @tyleralsbury @martinamarien
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.
assets/video-section.css
Outdated
@@ -1,6 +1,6 @@ | |||
.video-section__media { | |||
position: relative; | |||
padding-bottom: 56.25%; | |||
padding-bottom: calc(56.25% - var(--media-border-width) * 2); |
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.
Is this change needed ? It seems to be related to the video section only 🤔
sections/main-article.liquid
Outdated
@@ -10,7 +10,7 @@ | |||
{%- when 'featured_image'-%} | |||
{%- if article.image -%} | |||
<div class="article-template__hero-container" {{ block.shopify_attributes }}> | |||
<div class="article-template__hero-{{ block.settings.image_height }} media" | |||
<div class="article-template__hero-{{ block.settings.image_height }} media global-media-settings" |
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.
Here I can see how it can be useful to add to articles 👍
Could you add something in the PR description for it as it doesn't currently mentions that there are edits for this section/template.
snippets/article-card.liquid
Outdated
@@ -35,7 +35,7 @@ | |||
> | |||
<div class="card__inner {% if settings.card_style == 'standard' %} color-{{ settings.card_color_scheme }} gradient{% endif %}{% if article.image and show_image or settings.card_style == 'standard' %} ratio{% endif %}" style="--ratio-percent: {{ 1 | divided_by: ratio | times: 100 }}%;"> | |||
{%- if show_image == true and article.image -%} | |||
<div class="article-card__image-wrapper card__media"> | |||
<div class="article-card__image-wrapper card__media global-media-settings"> |
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.
Same thing here, if you could add this to your description so that folks reviewing know which part to test.
Here there is more tweaks needed I think depending on the card setup (standard or card).
Also this element would need a border radius applied on it as well otherwise it's not reflecting what the settings are: video
Maybe it we can only tackle multicolumn in the PR to keep it simple and explore the other situation touched here ?
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.
Yea, I may have tackled 1 too many things with this PR
Co-authored-by: Ludo <ludo.segura@shopify.com>
…/dawn into Card-image-border-radius
@ludoboludo would you mind taking another pass through this with the updates I've made? |
} | ||
|
||
.media--circle { | ||
left: calc(-1 * var(--button-size)); |
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.
Curious to know what this was added for ? 🤔
I don't think we have a --button-size
variable declared anywhere else so I don't think this declaration is changing anything.
But let me know if I'm missing something.
@@ -1196,7 +1196,6 @@ summary::-webkit-details-marker { | |||
display: block; | |||
background-color: rgba(var(--color-foreground), 0.1); | |||
position: relative; | |||
overflow: hidden; |
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 tend to get a little worried when removing properties that have impact on many elements. I see that we need to remove this in order for the shadow to come up for multicolumn but maybe instead of removing the property here we could overwrite it in the section-multicolumn.css
file with something like:
.multicolumn-card .media {
overflow: inherit;
}
I feel like it's more "backward compatible".
.multicolumn-card > .multicolumn-card__image-wrapper--full-width:not(.multicolumn-card-spacing) { | ||
border-top-left-radius: calc(var(--text-boxes-radius) - var(--text-boxes-border-width)); | ||
border-top-right-radius: calc(var(--text-boxes-radius) - var(--text-boxes-border-width)); | ||
overflow: hidden; |
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.
Hey team, The probot-CLA was recently deprecated and replaced with the shopify-cla action. To successfully use the new shopify-cla status check, this PR will be closed and reopened. Thanks and sorry for the minor inconvenience. Message me if you have any questions 😄 Please refer to the following for more information: |
Editor
Fixes this issue
Apply media settings to images in Multicolumn.
There's currently no way of applying borders, border radius, or shadows to images in multicolumn layouts. This PR introduces them through media settings.
What approach did you take?
I applied the variables for media settings to
.multicolumn-card__image
, and I overrode border radius for.multicolumn-card__image
if image ratio was set to circleOther considerations
Multicolumn is sometimes used for Logos. If the theme has media borders, the logos will get those borders which may be less desirable for that specific scenario.
Testing steps/scenarios