Skip to content

Commit f8d998b

Browse files
authored
fix(modal): Update breakpoint for full variant to small (#5222)
* fix(modal): update breakpoint for full variant to small * chore(modal): update docs * chore(modal): update docs * fix(modal): update layout handling
1 parent 5ed0745 commit f8d998b

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

ui/components/modals/RELEASENOTES.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,33 @@
55
<!-- ## [Unreleased] -->
66

77
## 2.22.0
8+
89
### Changed
10+
911
- Optimized full size option and refactored to use CSS grid.
12+
- Updated full size variant to trigger at the `$mq-small` breakpoint to prevent larger devices from receiving the variant.
1013

1114
## 2.21.0
12-
### Fixed
15+
16+
### Fixed
17+
1318
- Fixed `aria-labelledby` to meet accessibility requirements specifically for screen readers.
1419

1520
## 2.21.0
21+
1622
### Changed
17-
- Added full size option for modal. This will allow the modal to reach full screen for mobile screen size and devices. When screen is bigger than mobile screen width (from 768px), full size modal will take on large size modal behaviour.
23+
24+
- Added full size option for modal. This will allow the modal to reach full screen for mobile screen size and devices. When screen is bigger than mobile screen width (from 768px), full size modal will take on large size modal behaviour.
1825
- Changed close button to meet accessibility requirement when in full size and in mobile width.
1926

2027
## 2.19.0
28+
2129
### Changed
30+
2231
- Added tabindex to Footless example for programmatic focus use case.
2332

2433
## 2.18.0
34+
2535
### Changed
2636

2737
- Added `slds-modal__content_footless` class to example for clarity.

ui/components/modals/base/_index.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,16 @@
296296

297297
// Behaves like large size when not in a small viewport
298298
.slds-modal__container {
299-
width: 90%;
300-
max-width: none;
301-
min-width: 40rem;
299+
@include mq-medium-min {
300+
width: 90%;
301+
max-width: none;
302+
min-width: 40rem;
303+
}
302304
}
303305

304-
// We use mq-medium-max since modal was originally designed as desktop first;
306+
// We use mq-small-max since modal was originally designed as desktop first;
305307
// This saves us from having to duplicate code for the full modifier.
306-
@include mq-medium-max {
308+
@include mq-small-max {
307309
// Account for iOS safe areas so our modal doesn't load underneath iOS elements.
308310
top: env(safe-area-inset-top, 0);
309311
// Override slds-modal's bottom: 0 so we can make the height dynamic.
@@ -337,6 +339,7 @@
337339
"header"
338340
"content"
339341
"footer";
342+
grid-template-columns: 1fr;
340343
}
341344

342345
/**

ui/components/modals/docs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Modals, by definition, trap focus. This means that if a user presses Tab or Shif
126126

127127
### Full
128128

129-
Use the `slds-modal_full` class to give the modal a full screen appearance in mobile device screens, or small form factors. The modal will take on the same appearance as the large size modal when on a medium form factor or larger (from 768px and larger).
129+
Use the `slds-modal_full` class to give a full screen appearance in small form factors that fall within the `$mq-small` token value. Form factors outside of `$mq-small` will take on the appearance of the large modal.
130130

131131
<CodeView frameOnly frameStyles={{ height: '640px' }} frameTitle="Example mobile styles for full example">
132132
{getDisplayElementById(Base.examples, 'full')}

0 commit comments

Comments
 (0)