@@ -13,22 +13,20 @@ governing permissions and limitations under the License.
13
13
@import "../overlay/index.css" ;
14
14
15
15
.spectrum-Modal {
16
- --spectrum-dialog-confirm-vertical-offset : -2vh ;
17
-
18
16
/* Bug: this must be 0ms, not 0 */
19
- --spectrum-dialog -confirm-exit-animation-delay : 0 ms ;
20
-
21
- /* Distance between top and bottom of dialog and edge of window for fullscreen dialog */
22
- --spectrum-dialog -fullscreen-margin : 32px ;
23
- --spectrum-dialog -max-height : 90vh ;
24
- --spectrum-dialog -max-width : 90% ;
25
-
26
- --spectrum-dialog -background-color : var (--spectrum-gray-100 );
27
- --spectrum-dialog -confirm-border-radius : var (--spectrum-corner-radius-100 );
28
- --spectrum-dialog -confirm-exit-animation-duration : 130 ms ;
29
- --spectrum-dialog -confirm-entry-animation-duration : 250 ms ;
30
- --spectrum-dialog -confirm-entry-animation-delay : 160 ms ;
31
- --spectrum-dialog -transition-animation-duration : 130 ms ;
17
+ --spectrum-modal -confirm-exit-animation-delay : var ( --spectrum-animation-duration-0 ) ;
18
+
19
+ /* Distance between top and bottom of modal and edge of window for fullscreen modal */
20
+ --spectrum-modal -fullscreen-margin : 32px ;
21
+ --spectrum-modal -max-height : 90vh ;
22
+ --spectrum-modal -max-width : 90% ;
23
+
24
+ --spectrum-modal -background-color : var (--spectrum-gray-100 );
25
+ --spectrum-modal -confirm-border-radius : var (--spectrum-corner-radius-100 );
26
+ --spectrum-modal -confirm-exit-animation-duration : var ( --spectrum-animation-duration-100 ) ;
27
+ --spectrum-modal -confirm-entry-animation-duration : var ( --spectrum-animation-duration-500 ) ;
28
+ --spectrum-modal -confirm-entry-animation-delay : var ( --spectrum-animation-duration-200 ) ;
29
+ --spectrum-modal -transition-animation-duration : var ( --spectrum-animation-duration-100 ) ;
32
30
}
33
31
34
32
/* Used to position the modal */
@@ -62,8 +60,7 @@ governing permissions and limitations under the License.
62
60
z-index : 2 ;
63
61
64
62
/* Be invisible by default */
65
- transition : visibility 0ms linear
66
- var (--spectrum-dialog-transition-animation-duration );
63
+ transition : visibility 0ms linear var (--mod-modal-transition-animation-duration , var (--spectrum-modal-transition-animation-duration ));
67
64
68
65
& .is-open {
69
66
visibility : visible;
@@ -74,61 +71,52 @@ governing permissions and limitations under the License.
74
71
@inherit : %spectrum- overlay;
75
72
76
73
/* Start offset by the animation distance */
77
- transform : translateY (
78
- var (--spectrum-dialog-confirm-entry-animation-distance )
79
- );
74
+ transform : translateY (var (--mod-modal-confirm-entry-animation-distance , var (--spectrum-modal-confirm-entry-animation-distance )));
80
75
81
76
/* Appear above underlay */
82
77
z-index : 2 ;
83
78
84
79
/* Don't be bigger than the screen */
85
- max-block-size : var (--spectrum-dialog -max-height );
86
- max-inline-size : var (--spectrum-dialog -max-width );
80
+ max-block-size : var (--mod-modal-max-height , var ( -- spectrum-modal -max-height) );
81
+ max-inline-size : var (--mod-modal-max-width , var ( -- spectrum-modal -max-width) );
87
82
88
- background : var (--spectrum-dialog -background-color );
83
+ background : var (--mod-modal-background-color , var ( -- spectrum-modal -background-color) );
89
84
90
85
/* border-radius includes legacy token fallback, which can be deprecated once component is migrated */
91
- border-radius : var (
92
- --spectrum-dialog-confirm-border-radius
93
- );
86
+ border-radius : var (--mod-modal-confirm-border-radius , var (--spectrum-modal-confirm-border-radius ));
94
87
overflow : hidden;
95
88
outline : none; /* Firefox shows outline */
96
89
pointer-events : auto;
97
90
98
91
/* Exit animations */
99
- transition : opacity var (--spectrum-dialog-confirm-exit-animation-duration )
100
- cubic-bezier (0.5 , 0 , 1 , 1 )
101
- var (--spectrum-dialog-confirm-exit-animation-delay ),
92
+ transition : opacity var (--mod-modal-confirm-exit-animation-duration , var (--spectrum-modal-confirm-exit-animation-duration )) var (--spectrum-animation-ease-in )
93
+ var (--mod-modal-confirm-exit-animation-delay , var (--spectrum-modal-confirm-exit-animation-delay )),
102
94
visibility 0ms linear
103
95
calc (
104
- var (--spectrum-dialog -confirm-exit-animation-delay ) +
105
- var (--spectrum-dialog -confirm-exit-animation-duration )
96
+ var (--mod-modal-confirm-exit-animation-delay , var ( -- spectrum-modal -confirm-exit-animation-delay) ) +
97
+ var (--mod-modal-confirm-exit-animation-duration , var ( -- spectrum-modal -confirm-exit-animation-duration) )
106
98
),
107
99
transform 0ms linear
108
100
calc (
109
- var (--spectrum-dialog -confirm-exit-animation-delay ) +
110
- var (--spectrum-dialog -confirm-exit-animation-duration )
101
+ var (--mod-modal-confirm-exit-animation-delay , var ( -- spectrum-modal -confirm-exit-animation-delay) ) +
102
+ var (--mod-modal-confirm-exit-animation-duration , var ( -- spectrum-modal -confirm-exit-animation-duration) )
111
103
);
112
104
113
105
& .is-open {
114
106
@inherit : %spectrum- overlay- - open;
115
107
116
108
/* Entry animations */
117
- transition : transform
118
- var (--spectrum-dialog-confirm-entry-animation-duration )
119
- cubic-bezier (0 , 0 , 0.4 , 1 )
120
- var (--spectrum-dialog-confirm-entry-animation-delay ),
121
- opacity var (--spectrum-dialog-confirm-entry-animation-duration )
122
- cubic-bezier (0 , 0 , 0.4 , 1 )
123
- var (--spectrum-dialog-confirm-entry-animation-delay );
109
+ transition : transform var (--mod-modal-confirm-entry-animation-duration , var (--spectrum-modal-confirm-entry-animation-duration )) var (--spectrum-animation-ease-out )
110
+ var (--mod-modal-confirm-entry-animation-delay , var (--spectrum-modal-confirm-entry-animation-delay )),
111
+ opacity var (--mod-modal-confirm-entry-animation-duration , var (--spectrum-modal-confirm-entry-animation-duration )) var (--spectrum-animation-ease-out )
112
+ var (--mod-modal-confirm-entry-animation-delay , var (--spectrum-modal-confirm-entry-animation-delay ));
124
113
125
114
transform : translateY (0 );
126
115
}
127
116
}
128
117
129
118
/* Responsive modals will fill the screen on small viewports */
130
- @media only screen and (max-device-width : 400px ),
131
- only screen and (max-device-height : 350px ) {
119
+ @media only screen and (max-device-width : 400px ), only screen and (max-device-height : 350px ) {
132
120
.spectrum-Modal--responsive {
133
121
inline-size : 100% ;
134
122
height : 100% ;
@@ -146,10 +134,10 @@ governing permissions and limitations under the License.
146
134
/** @unofficial */
147
135
.spectrum-Modal--fullscreen {
148
136
position : fixed;
149
- left : var (--spectrum-dialog -fullscreen-margin );
150
- top : var (--spectrum-dialog -fullscreen-margin );
151
- right : var (--spectrum-dialog -fullscreen-margin );
152
- bottom : var (--spectrum-dialog -fullscreen-margin );
137
+ inset-inline-start : var (--mod-modal-fullscreen-margin , var ( -- spectrum-modal -fullscreen-margin) );
138
+ inset-block-start : var (--mod-modal-fullscreen-margin , var ( -- spectrum-modal -fullscreen-margin) );
139
+ inset-inline-end : var (--mod-modal-fullscreen-margin , var ( -- spectrum-modal -fullscreen-margin) );
140
+ inset-block-end : var (--mod-modal-fullscreen-margin , var ( -- spectrum-modal -fullscreen-margin) );
153
141
max-inline-size : none;
154
142
max-height : none;
155
143
}
0 commit comments