1
- $modal-added-to-cart-offset : 20px ;
2
- $modal-added-to-cart-max-width : 480px ;
3
- $modal-added-to-cart-padding : ($modal-popup__padding / 2 );
4
- $modal-added-to-cart-bg : $modal__background-color ;
5
- $modal-added-to-cart-color : inherit ;
6
- $modal-added-to-cart-box-shadow : $modal__box-shadow ;
1
+ $modal-add-to-cart-mobile-position : " bottom" !default ;
2
+ $modal-add-to-cart-mobile-offset : 1em !default ;
3
+ $modal-add-to-cart-desktop-position : " top" !default ;
4
+ $modal-add-to-cart-desktop-offset : 1.5em !default ;
5
+
6
+ $modal-add-to-cart-index : $modal__z-index !default ;
7
+ $modal-add-to-cart-max-width : 480px !default ;
8
+ $modal-add-to-cart-padding : 1rem !default ;
9
+ $modal-add-to-cart-radius : 0.2rem !default ;
10
+ $modal-add-to-cart-bg : $modal__background-color !default ;
11
+ $modal-add-to-cart-color : inherit !default ;
12
+ $modal-add-to-cart-box-shadow : $modal__box-shadow !default ;
13
+
14
+ @mixin modal-added-to-cart-position ($position , $offset ) {
15
+ @if ($position == " top" ) {
16
+ top : $offset ;
17
+ bottom : auto ;
18
+ }
19
+
20
+ @if ($position == " bottom" ) {
21
+ top : auto ;
22
+ bottom : $offset ;
23
+ }
24
+ }
25
+
26
+ @keyframes modal-added-to-cart-show {
27
+ from {
28
+ opacity : 0 ;
29
+ transition : translateY (var (--modal-offset-from , -100% ));
30
+ }
31
+ }
7
32
8
33
.modal-added-to-cart {
9
- z-index : 9 ;
34
+ @include modal-added-to-cart-position (
35
+ $position : $modal-add-to-cart-mobile-position ,
36
+ $offset : $modal-add-to-cart-mobile-offset
37
+ );
38
+ box-sizing : border-box ;
39
+ z-index : $modal-add-to-cart-index ;
10
40
position : fixed ;
11
- top : 0 ;
12
41
right : 0 ;
13
- bottom : auto ;
14
42
left : 0 ;
15
- max-width : $modal-added-to-cart-max-width ;
43
+ max-width : $modal-add-to-cart-max-width ;
44
+ width : calc (100% - #{($modal-add-to-cart-mobile-offset * 2 )} );
16
45
margin : 0 auto ;
17
- padding : $modal-added-to-cart-padding ;
18
- background-color : $modal-added-to-cart-bg ;
19
- color : $modal-added-to-cart-color ;
20
- box-shadow : $modal-added-to-cart-box-shadow ;
46
+ padding : $modal-add-to-cart-padding ;
47
+ border-radius : $modal-add-to-cart-radius ;
48
+ background-color : $modal-add-to-cart-bg ;
49
+ color : $modal-add-to-cart-color ;
50
+ box-shadow : $modal-add-to-cart-box-shadow ;
51
+ animation : modal- added- to- cart- show 500ms ;
21
52
22
53
.modal-content {
23
54
display : flex ;
@@ -29,6 +60,17 @@ $modal-added-to-cart-box-shadow: $modal__box-shadow;
29
60
flex : 0 0 auto ;
30
61
width : 50px ;
31
62
margin-right : 1em ;
63
+
64
+ > img {
65
+ vertical-align : middle ;
66
+ }
67
+ }
68
+
69
+ .nav-open & ,
70
+ .filter-active & {
71
+ opacity : 0 ;
72
+ visibility : hidden ;
73
+ transition : opacity 200ms , visibility 0s 200ms ;
32
74
}
33
75
}
34
76
@@ -42,7 +84,10 @@ $modal-added-to-cart-box-shadow: $modal__box-shadow;
42
84
43
85
@include min-screen ($screen__m ) {
44
86
.modal-added-to-cart {
45
- top : $modal-added-to-cart-offset ;
87
+ @include modal-added-to-cart-position (
88
+ $position : $modal-add-to-cart-desktop-position ,
89
+ $offset : $modal-add-to-cart-desktop-offset
90
+ );
91
+ width : calc (100% - #{($modal-add-to-cart-desktop-offset * 2 )} );
46
92
}
47
93
}
48
-
0 commit comments