-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Adjust constrain media values for quick add modal #2113
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
Changes from 2 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 |
|---|---|---|
|
|
@@ -30,11 +30,12 @@ | |
| } | ||
|
|
||
| .quick-add-modal__content { | ||
| --modal-height-offset: 3.2rem; | ||
| position: absolute; | ||
| top: 0; | ||
| left: 50%; | ||
| transform: translateX(-50%); | ||
| margin: 3.2rem auto 0; | ||
| margin: var(--modal-height-offset) auto 0; | ||
| width: 100%; | ||
| background-color: rgb(var(--color-background)); | ||
| overflow: hidden; | ||
|
|
@@ -44,9 +45,10 @@ | |
|
|
||
| @media screen and (min-width: 750px) { | ||
| .quick-add-modal__content { | ||
| margin-top: 10rem; | ||
| --modal-height-offset: 10rem; | ||
| margin-top: var(--modal-height-offset); | ||
| width: 80%; | ||
| max-height: calc(100% - 20rem); | ||
| max-height: calc(100% - var(--modal-height-offset) * 2); | ||
| overflow-y: auto; | ||
| } | ||
|
|
||
|
|
@@ -67,10 +69,11 @@ | |
| } | ||
|
|
||
| .quick-add-modal__content-info { | ||
| --modal-padding: 2.5rem; | ||
| padding-right: 4.4rem; | ||
| display: flex; | ||
| overflow-y: auto; | ||
| padding: 2.5rem; | ||
| padding: var(--modal-padding); | ||
| height: 100%; | ||
| } | ||
|
|
||
|
|
@@ -88,7 +91,7 @@ | |
| } | ||
|
|
||
| .quick-add-modal__content { | ||
| bottom: 3.2rem; | ||
| bottom: var(--modal-height-offset); | ||
| } | ||
|
|
||
| .quick-add-modal__content-info > * { | ||
|
|
@@ -210,7 +213,12 @@ quick-add-modal .product-form__buttons { | |
| box-sizing: border-box; | ||
| } | ||
|
|
||
| quick-add-modal .product-media-container.constrain-height .media { | ||
| /* constrain behavior tbd, negate constrain effects on quick add modal for now */ | ||
| padding-top: var(--ratio-percent); | ||
| quick-add-modal .product-media-container.constrain-height { | ||
| --viewport-offset: calc(calc(var(--modal-height-offset) + var(--modal-padding) + var(--popup-border-width)) * 2); | ||
| } | ||
|
|
||
| @media screen and (min-width: 750px) { | ||
| quick-add-modal .product-media-container.constrain-height { | ||
| --constrained-min-height: 400px; | ||
|
Contributor
Author
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.
This may just be harder to see because those model are square. A square image should behave similarly in that in many cases especially smaller page widths (~1200px) square images aren't tall enough to exceed the minimum constrain height that prevents media from scaling too small.
This is exactly correct. The more horizontal space a product media has to expand, the taller they will render as well, so you are more likely to see media qualifying for constraining. The desktop media width setting on the product page also effects this in the same way. If using a media width small or medium, it's becomes even less likely that media will need to constrain even at wider page widths.
Contributor
Author
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.
Contributor
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 perfect, thanks for explaining all of that 😄 |
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.