-
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
Cleanup product media grid spacing #1444
Changes from 3 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 |
---|---|---|
|
@@ -500,10 +500,6 @@ a.product__text { | |
padding-right: var(--media-shadow-horizontal-offset); | ||
} | ||
|
||
.product__media-item:first-child { | ||
width: 100%; | ||
} | ||
|
||
.product--thumbnail .product__media-item:not(.is-active), | ||
.product--thumbnail_slider .product__media-item:not(.is-active) { | ||
display: none; | ||
|
@@ -542,7 +538,6 @@ a.product__text { | |
} | ||
|
||
.product__media-list .product__media-item { | ||
padding: 0 0 0.5rem; | ||
width: 100%; | ||
} | ||
} | ||
|
@@ -590,6 +585,16 @@ a.product__text { | |
} | ||
|
||
@media screen and (min-width: 990px) { | ||
.product__media-list .product__media-item { | ||
max-width: calc(50% - var(--grid-desktop-horizontal-spacing) / 2); | ||
} | ||
|
||
.product__media-list .product__media-item:first-child, | ||
.product__media-list .product__media-item--full { | ||
width: 100%; | ||
max-width: 100%; | ||
} | ||
|
||
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. 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. Ah thanks, good find. I guess I never checked the second item in the other layouts.. I've now scoped the 50% style to the stacked layout since that's the only one it's relevant to. dff2925 |
||
.product__modal-opener .product__media-icon { | ||
opacity: 0; | ||
} | ||
|
@@ -967,7 +972,6 @@ a.product__text { | |
|
||
.thumbnail-list { | ||
display: grid; | ||
margin-left: -1rem; | ||
grid-template-columns: repeat(4, 1fr); | ||
} | ||
} | ||
|
@@ -978,7 +982,6 @@ a.product__text { | |
|
||
@media screen and (min-width: 990px) { | ||
.thumbnail-list { | ||
margin-left: 0; | ||
grid-template-columns: repeat(4, 1fr); | ||
} | ||
|
||
|
@@ -1040,7 +1043,7 @@ a.product__text { | |
} | ||
|
||
.product--thumbnail_slider .slider-mobile-gutter .slider-button { | ||
display: block; | ||
display: flex; | ||
} | ||
} | ||
|
||
|
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.
There's an opportunity to merge some of the theme level settings css with this approach. Possibly a refactor/cleanup to simplify the css that's currently duplicated in some places.
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.
Question for you: Is the plan to use these variables lower down in the file on lines 2779 - 2797? I know you didn't add them in this PR, but I don't see them being used anywhere, so I just want to make sure I understand what the plan is moving forward.
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.
Yes exactly, I'd like to consolidate most of the
content-container:after
andglobal-media-settings:after
in base.css using the generic --border-width type styles. But I'm also going to heavily rely on them for all the grid collapse stuff. --border-radius will also probably be crucial when consolidating rounded pseudo element focus outlines around the theme. These were originally implement to access shadow offsets in sliders (and I preemptively added all the other ones for future use).The example below shows what the border collapsing code might look like with and without these kind of cached vars.