Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions assets/quick-add.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand All @@ -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%;
}

Expand All @@ -88,7 +91,7 @@
}

.quick-add-modal__content {
bottom: 3.2rem;
bottom: var(--modal-height-offset);
}

.quick-add-modal__content-info > * {
Expand Down Expand Up @@ -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;
Copy link
Contributor Author

@kmeleta kmeleta Nov 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 3D and Video products don't "constrain" the same way as the Image product

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.

The viewport I was testing at was 1200px, going wider (1400px +) seems to make images, 3D, and videos behave similarly

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah perfect, thanks for explaining all of that 😄

}
}