Skip to content

Commit 9875aea

Browse files
authored
Adjust constrain media values for quick add modal (#2113)
* Adjust constrain media values for quickadd * Adjust offset logic * Minor formatting fix
1 parent 2eb8bf6 commit 9875aea

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

assets/quick-add.css

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@
3030
}
3131

3232
.quick-add-modal__content {
33+
--modal-height-offset: 3.2rem;
3334
position: absolute;
3435
top: 0;
3536
left: 50%;
3637
transform: translateX(-50%);
37-
margin: 3.2rem auto 0;
38+
margin: var(--modal-height-offset) auto 0;
3839
width: 100%;
3940
background-color: rgb(var(--color-background));
4041
overflow: hidden;
@@ -44,9 +45,10 @@
4445

4546
@media screen and (min-width: 750px) {
4647
.quick-add-modal__content {
47-
margin-top: 10rem;
48+
--modal-height-offset: 10rem;
49+
margin-top: var(--modal-height-offset);
4850
width: 80%;
49-
max-height: calc(100% - 20rem);
51+
max-height: calc(100% - var(--modal-height-offset) * 2);
5052
overflow-y: auto;
5153
}
5254

@@ -67,10 +69,11 @@
6769
}
6870

6971
.quick-add-modal__content-info {
72+
--modal-padding: 2.5rem;
7073
padding-right: 4.4rem;
7174
display: flex;
7275
overflow-y: auto;
73-
padding: 2.5rem;
76+
padding: var(--modal-padding);
7477
height: 100%;
7578
}
7679

@@ -88,7 +91,7 @@
8891
}
8992

9093
.quick-add-modal__content {
91-
bottom: 3.2rem;
94+
bottom: var(--modal-height-offset);
9295
}
9396

9497
.quick-add-modal__content-info > * {
@@ -210,7 +213,12 @@ quick-add-modal .product-form__buttons {
210213
box-sizing: border-box;
211214
}
212215

213-
quick-add-modal .product-media-container.constrain-height .media {
214-
/* constrain behavior tbd, negate constrain effects on quick add modal for now */
215-
padding-top: var(--ratio-percent);
216+
quick-add-modal .product-media-container.constrain-height {
217+
--viewport-offset: calc((var(--modal-height-offset) + var(--modal-padding) + var(--popup-border-width)) * 2);
218+
}
219+
220+
@media screen and (min-width: 750px) {
221+
quick-add-modal .product-media-container.constrain-height {
222+
--constrained-min-height: 400px;
223+
}
216224
}

0 commit comments

Comments
 (0)