|
66 | 66 | transition: transform $duration--moderate-02 motion(entrance, expressive); |
67 | 67 | } |
68 | 68 |
|
| 69 | + // ----------------------------- |
| 70 | + // Modal container |
| 71 | + // ----------------------------- |
69 | 72 | .#{$prefix}--modal-container { |
70 | 73 | position: fixed; |
71 | 74 | top: 0; |
|
89 | 92 | width: 84%; |
90 | 93 | height: auto; |
91 | 94 | max-height: 90%; |
92 | | - |
93 | | - .#{$prefix}--modal-header, |
94 | | - .#{$prefix}--modal-content, |
95 | | - .#{$prefix}--modal-content__regular-content { |
96 | | - padding-right: 20%; |
97 | | - } |
98 | | - |
99 | | - .#{$prefix}--modal-content--with-form { |
100 | | - // Override for `.#{$prefix}--modal-content` |
101 | | - padding-right: $spacing-05; |
102 | | - } |
103 | 95 | } |
104 | 96 |
|
105 | 97 | @include carbon--breakpoint(lg) { |
|
112 | 104 | } |
113 | 105 | } |
114 | 106 |
|
115 | | - .#{$prefix}--modal-header, |
| 107 | + // ----------------------------- |
| 108 | + // Modal content |
| 109 | + // ----------------------------- |
116 | 110 | .#{$prefix}--modal-content { |
| 111 | + @include type-style('body-long-01'); |
| 112 | + |
| 113 | + position: relative; |
| 114 | + // Required to accommodate focus outline's negative offset: |
| 115 | + padding-top: $spacing-03; |
| 116 | + // anything besides text/p spans full width, with just 16px padding |
| 117 | + padding-right: $spacing-05; |
117 | 118 | padding-left: $spacing-05; |
| 119 | + margin-bottom: $spacing-09; |
| 120 | + color: $text-01; |
| 121 | + |
| 122 | + font-weight: 400; |
| 123 | + grid-column: 1/-1; |
| 124 | + grid-row: 2/-2; |
| 125 | + overflow-y: auto; |
| 126 | + |
| 127 | + &:focus { |
| 128 | + @include focus-outline('outline'); |
| 129 | + } |
118 | 130 | } |
119 | 131 |
|
120 | | - .#{$prefix}--modal-header, |
121 | | - .#{$prefix}--modal-content, |
| 132 | + //TO-DO: remove .#{$prefix}--modal-content__regular-content in v11 since hasForm has been deprecated |
| 133 | + // text/p gets 20% right padding |
| 134 | + .#{$prefix}--modal-content p, |
122 | 135 | .#{$prefix}--modal-content__regular-content { |
123 | | - padding-right: $spacing-05; |
| 136 | + padding-right: 20%; |
| 137 | + @include type-style('body-long-01'); |
124 | 138 | } |
125 | 139 |
|
| 140 | + //TO-DO: remove .#{$prefix}--modal-content--with-form in v11 since hasForm has been deprecated\ |
| 141 | + // anything besides text/p spans full width, with just 16px padding |
126 | 142 | .#{$prefix}--modal-content--with-form { |
127 | 143 | padding-right: $spacing-05; |
128 | 144 | } |
129 | 145 |
|
| 146 | + // ----------------------------- |
| 147 | + // Modal header |
| 148 | + // ----------------------------- |
| 149 | + .#{$prefix}--modal-header { |
| 150 | + padding-top: $spacing-05; |
| 151 | + padding-right: $spacing-09; |
| 152 | + padding-left: $spacing-05; |
| 153 | + margin-bottom: $spacing-03; |
| 154 | + grid-column: 1/-1; |
| 155 | + grid-row: 1/1; |
| 156 | + } |
| 157 | + |
| 158 | + .#{$prefix}--modal-header__label { |
| 159 | + @include type-style('label-01'); |
| 160 | + |
| 161 | + margin-bottom: $spacing-02; |
| 162 | + color: $text-02; |
| 163 | + } |
| 164 | + |
| 165 | + .#{$prefix}--modal-header__heading { |
| 166 | + @include type-style('productive-heading-03'); |
| 167 | + |
| 168 | + color: $text-01; |
| 169 | + } |
| 170 | + |
| 171 | + // ----------------------------- |
| 172 | + // XS Modal |
| 173 | + // ----------------------------- |
130 | 174 | .#{$prefix}--modal-container--xs { |
131 | | - .#{$prefix}--modal-header { |
132 | | - padding-right: $carbon--spacing-09; |
| 175 | + //text always spans full width in xs modals |
| 176 | + .#{$prefix}--modal-content__regular-content { |
| 177 | + padding-right: $spacing-05; |
133 | 178 | } |
134 | 179 |
|
135 | | - .#{$prefix}--modal-content, |
136 | | - .#{$prefix}--modal-content__regular-content, |
137 | | - .#{$prefix}--modal-content--with-form { |
138 | | - padding-right: $spacing-05; |
| 180 | + .#{$prefix}--modal-content p { |
| 181 | + //.#{$prefix}--modal-content already has 16px padding so this doesn't need any |
| 182 | + padding-right: 0; |
139 | 183 | } |
140 | 184 |
|
141 | 185 | @include carbon--breakpoint(md) { |
|
152 | 196 | } |
153 | 197 | } |
154 | 198 |
|
| 199 | + // ----------------------------- |
| 200 | + // SM Modal |
| 201 | + // ----------------------------- |
155 | 202 | .#{$prefix}--modal-container--sm { |
156 | | - .#{$prefix}--modal-header { |
157 | | - padding-right: $carbon--spacing-09; |
| 203 | + //text spans full width in sm modals below 1056 |
| 204 | + .#{$prefix}--modal-content__regular-content { |
| 205 | + padding-right: $spacing-05; |
158 | 206 | } |
159 | 207 |
|
160 | | - .#{$prefix}--modal-content, |
161 | | - .#{$prefix}--modal-content__regular-content, |
162 | | - .#{$prefix}--modal-content--with-form { |
163 | | - padding-right: $spacing-05; |
| 208 | + .#{$prefix}--modal-content p { |
| 209 | + //.#{$prefix}--modal-content already has 16px padding so this doesn't need any |
| 210 | + padding-right: 0; |
164 | 211 | } |
165 | 212 |
|
166 | 213 | @include carbon--breakpoint(md) { |
|
170 | 217 | @include carbon--breakpoint(lg) { |
171 | 218 | width: 42%; |
172 | 219 | max-height: 72%; |
173 | | - } |
174 | 220 |
|
175 | | - @include carbon--breakpoint(xlg) { |
176 | | - width: 36%; |
177 | | - |
178 | | - .#{$prefix}--modal-header, |
179 | | - .#{$prefix}--modal-content, |
| 221 | + .#{$prefix}--modal-content p, |
180 | 222 | .#{$prefix}--modal-content__regular-content { |
181 | 223 | padding-right: 20%; |
182 | 224 | } |
| 225 | + } |
183 | 226 |
|
184 | | - .#{$prefix}--modal-content--with-form { |
185 | | - // Override for `.#{$prefix}--modal-content` |
186 | | - padding-right: $spacing-05; |
187 | | - } |
| 227 | + @include carbon--breakpoint(xlg) { |
| 228 | + width: 36%; |
188 | 229 | } |
189 | 230 | } |
190 | 231 |
|
| 232 | + // ----------------------------- |
| 233 | + // LG Modal |
| 234 | + // ----------------------------- |
191 | 235 | .#{$prefix}--modal-container--lg { |
192 | | - .#{$prefix}--modal-header { |
193 | | - padding-right: $carbon--spacing-09; |
194 | | - } |
195 | | - |
196 | | - .#{$prefix}--modal-content, |
197 | | - .#{$prefix}--modal-content__regular-content, |
198 | | - .#{$prefix}--modal-content--with-form { |
199 | | - padding-right: $spacing-05; |
200 | | - } |
201 | | - |
202 | 236 | @include carbon--breakpoint(md) { |
203 | 237 | width: 96%; |
204 | | - |
205 | | - .#{$prefix}--modal-header, |
206 | | - .#{$prefix}--modal-content, |
207 | | - .#{$prefix}--modal-content__regular-content { |
208 | | - padding-right: 20%; |
209 | | - } |
210 | | - |
211 | | - .#{$prefix}--modal-content--with-form { |
212 | | - // Override for `.#{$prefix}--modal-content` |
213 | | - padding-right: $spacing-05; |
214 | | - } |
215 | 238 | } |
216 | 239 |
|
217 | 240 | @include carbon--breakpoint(lg) { |
|
224 | 247 | } |
225 | 248 | } |
226 | 249 |
|
227 | | - .#{$prefix}--modal-header { |
228 | | - padding-top: $spacing-05; |
229 | | - padding-right: $spacing-09; |
230 | | - margin-bottom: $spacing-03; |
231 | | - grid-column: 1/-1; |
232 | | - grid-row: 1/1; |
233 | | - } |
234 | | - |
235 | | - .#{$prefix}--modal-header__label { |
236 | | - @include type-style('label-01'); |
237 | | - |
238 | | - margin-bottom: $spacing-02; |
239 | | - color: $text-02; |
240 | | - } |
241 | | - |
242 | | - .#{$prefix}--modal-header__heading { |
243 | | - @include type-style('productive-heading-03'); |
244 | | - |
245 | | - color: $text-01; |
246 | | - } |
247 | | - |
248 | | - .#{$prefix}--modal-content { |
249 | | - @include type-style('body-long-01'); |
250 | | - |
251 | | - position: relative; |
252 | | - // Required to accommodate focus outline's negative offset: |
253 | | - padding-top: $spacing-03; |
254 | | - margin-bottom: $spacing-09; |
255 | | - color: $text-01; |
256 | | - |
257 | | - font-weight: 400; |
258 | | - grid-column: 1/-1; |
259 | | - grid-row: 2/-2; |
260 | | - overflow-y: auto; |
261 | | - |
262 | | - &:focus { |
263 | | - @include focus-outline('outline'); |
264 | | - } |
265 | | - } |
266 | | - |
267 | | - .#{$prefix}--modal-content > p { |
268 | | - @include type-style('body-long-01'); |
269 | | - } |
270 | | - |
| 250 | + // ----------------------------- |
| 251 | + // Modal overflow |
| 252 | + // ----------------------------- |
271 | 253 | // Required so overflow-indicator disappears at end of content |
272 | 254 | .#{$prefix}--modal-scroll-content > *:last-child { |
273 | 255 | padding-bottom: $spacing-07; |
|
314 | 296 | } |
315 | 297 | } |
316 | 298 |
|
| 299 | + // ----------------------------- |
| 300 | + // Modal footer |
| 301 | + // ----------------------------- |
317 | 302 | .#{$prefix}--modal-footer { |
318 | 303 | display: flex; |
319 | 304 | height: rem(64px); |
|
337 | 322 | align-items: flex-start; |
338 | 323 | } |
339 | 324 |
|
| 325 | + // ----------------------------- |
| 326 | + // Modal close btn |
| 327 | + // ----------------------------- |
340 | 328 | .#{$prefix}--modal-close { |
341 | 329 | position: absolute; |
342 | 330 | z-index: 2; |
|
0 commit comments