1
+ @import '../../design-tokens/mixins.css' ;
2
+
3
+ /*------------------------------------*\
4
+ # MODAL
5
+ \*------------------------------------*/
6
+
7
+ /**
8
+ * The modal wrapper and overlay which takes up the entire screen.
9
+ */
10
+ .modal ,
11
+ .modal__overlay {
12
+ position : fixed;
13
+ top : 0 ;
14
+ left : 0 ;
15
+ height : 100vh ; /* TODO-AH: make sure this doesn't spill out of the container */
16
+ width : 100% ;
17
+ }
18
+
19
+ /**
20
+ * The inverted background of the modal to provide contrast with the actual modal.
21
+ */
22
+ .modal__overlay {
23
+ /* TODO-AH: opacity of color based on 50% */
24
+ background-color : var (--eds-theme-color-background-utility-overlay-low-emphasis );
25
+ opacity : 0.5 ;
26
+ }
27
+
28
+ /**
29
+ * The modal container which positions the modal in the center of the screen.
30
+ */
31
+ .modal {
32
+ display : flex;
33
+ align-items : center;
34
+ justify-content : center;
35
+ padding : 1rem ;
36
+
37
+ /**
38
+ * Ensures modal is above other components. This is not a design token for now since we need to align on
39
+ * z-indeces across the system
40
+ */
41
+ z-index : 1050 ;
42
+ }
43
+
44
+ /**
45
+ * Modal transition animations.
46
+ */
47
+ .modal__transition--enter {
48
+ transition : opacity var (--eds-anim-fade-long ) var (--eds-anim-ease );
49
+ @media (prefers-reduced-motion) {
50
+ transition : none;
51
+ }
52
+ }
53
+
54
+ .modal__transition--enterFrom {
55
+ opacity : 0 ;
56
+ }
57
+
58
+ .modal__transition--enterTo {
59
+ opacity : 1 ;
60
+ }
61
+
62
+ .modal__transition--leave {
63
+ transition : opacity var (--eds-anim-fade-long ) var (--eds-anim-ease );
64
+ @media (prefers-reduced-motion) {
65
+ transition : none;
66
+ }
67
+ }
68
+
69
+ .modal__transition--leaveFrom {
70
+ opacity : 1 ;
71
+ }
72
+
73
+ .modal__transition--leaveTo {
74
+ opacity : 0 ;
75
+ }
76
+
77
+ /**
78
+ * The content of the modal, which can wrap header, body, and footer.
79
+ */
80
+ .modal__content {
81
+ position : relative;
82
+ height : 43.125rem ;
83
+ max-height : 90vh ;
84
+ overflow : hidden;
85
+
86
+ /**
87
+ * This transparent border is for Window High Contrast Mode, which removes all
88
+ * background colors but makes borders 100% opacity black. Without this, the
89
+ * modal would have no clear boundary.
90
+ */
91
+ border : var (--eds-theme-form-border-width ) transparent var (--eds-theme-color-background-utility-container );
92
+
93
+ display : flex;
94
+ flex-direction : column;
95
+
96
+ width : 22.5rem ;
97
+
98
+ background-color : var (--eds-theme-color-background-utility-container );
99
+ }
100
+
101
+ /**
102
+ * The medium modal size used for the md modal.
103
+ * Also used for the lg modal size for when the screen size is smaller than 75rem.
104
+ */
105
+ .modal__content--md {
106
+ @media all and (min-width: $eds- bp- md) {
107
+ width : 42rem ;
108
+ }
109
+ }
110
+
111
+ /**
112
+ * The large modal size used for the lg/default modal.
113
+ */
114
+ .modal__content--lg {
115
+ @media all and (min-width: $eds- bp- xl) {
116
+ width : 64rem ;
117
+ --modal-horizontal-padding : 4rem ;
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Allows scrolling of the modal content except for sticky footer.
123
+ * This functionality is our intended scroll behavior but consuming teams can
124
+ * style the body content as they wish to handle overflow in various ways.
125
+ */
126
+ .modal__content--scrollable {
127
+ overflow : auto;
128
+ }
129
+
130
+ /**
131
+ * The modal close button.
132
+ * TODO-AH: this should be a `Button`
133
+ */
134
+ .modal__close-button {
135
+ border : 0 ;
136
+ background-color : transparent;
137
+
138
+ position : absolute;
139
+ top : 0 ;
140
+ right : 0 ;
141
+
142
+ width : 3rem ;
143
+ height : 3rem ;
144
+
145
+ cursor : pointer;
146
+
147
+ z-index : 1 ;
148
+
149
+ color : var (--eds-theme-color-text-utility-default-secondary );
150
+ }
151
+
152
+ /**
153
+ * The modal close icon that resides in the close button.
154
+ */
155
+ .modal__close-icon {
156
+ position : absolute;
157
+ top : 0.5rem ;
158
+ right : 0.5rem ;
159
+ }
160
+
161
+ /*------------------------------------*\
162
+ # MODAL BODY
163
+ \*------------------------------------*/
164
+
165
+ /**
166
+ * The body of the modal
167
+ */
168
+ .modal-body {
169
+ flex : 1 ;
170
+ padding : 0 2rem ;
171
+ }
172
+
173
+ /*------------------------------------*\
174
+ # MODAL FOOTER
175
+ \*------------------------------------*/
176
+
177
+ /**
178
+ * Footer for the modal.
179
+ */
180
+ .modal-footer {
181
+ width : 100% ;
182
+ z-index : 1000 ;
183
+
184
+ padding : 1.5rem 2rem ;
185
+
186
+ background-color : var (--eds-theme-color-background-utility-container );
187
+ }
188
+
189
+ .modal-footer--sticky {
190
+ position : sticky;
191
+ bottom : 0 ;
192
+
193
+ /* TODO-AH: bring in scrollwrapper to handle show/hide of visible elevation (and which box shadow to apply) */
194
+ box-shadow : var (--eds-box-shadow-xl );
195
+ }
196
+
197
+ /*------------------------------------*\
198
+ # MODAL HEADER
199
+ \*------------------------------------*/
200
+
201
+ /**
202
+ * Header for the modal.
203
+ */
204
+ .modal-header {
205
+ width : 100% ;
206
+
207
+ padding : 1.5rem 2rem ;
208
+ }
209
+
210
+ .modal-sub-title {
211
+ color : var (--eds-theme-color-text-utility-default-secondary );
212
+ }
0 commit comments