Skip to content

Commit

Permalink
BREAKING CHANGE(web): Remove modal body padding feature class #DS-863
Browse files Browse the repository at this point in the history
 ## Migration guide

Remove feature class `.spirit-v1-modal-body-padding`, if used.
No other actions are required.

Please refer back to this guide or reach out to our team
if you encounter any issues during migration.
  • Loading branch information
pavelklibani authored and literat committed Jul 21, 2023
1 parent 0228281 commit 462a245
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 93 deletions.
13 changes: 0 additions & 13 deletions packages/web/src/scss/components/Modal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,6 @@ ModalBody holds the actual content of the Modal.
</div>
```

### Feature Flag to Enable Extra Padding

⚠️ This feature flag is only temporary and will be removed in version 1. The extra vertical padding will be made default.

To enable vertical padding on ModalBody, add the feature class `spirit-v1-modal-body-padding` to a parent element.
The preferred one is the `body` element because this way it will affect all Modal components everywhere.

```html
<body class="spirit-v1-modal-body-padding">
<!-- Modal -->
</body>
```

## ModalFooter

ModalFooter is the place for actions represented by the Button component.
Expand Down
6 changes: 1 addition & 5 deletions packages/web/src/scss/components/Modal/_ModalBody.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
flex: 1 1 auto;
min-height: map.get(theme.$typography, mobile, font-size) * map.get(theme.$typography, mobile, line-height); // 1.
padding-inline: theme.$common-padding-x;
padding-block: theme.$body-padding-y;
overflow-x: hidden;
overflow-y: auto;
overscroll-behavior: contain;
Expand All @@ -17,8 +18,3 @@
padding-inline: theme.$common-padding-x-tablet;
}
}

// @deprecated Will be removed in the next major version.
.spirit-v1-modal-body-padding .ModalBody {
padding-block: theme.$body-padding-y;
}
75 changes: 0 additions & 75 deletions packages/web/src/scss/components/Modal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -530,81 +530,6 @@ <h2 id="example_scroll_view_title" class="ModalHeader__title">

</section>

<section class="docs-Section spirit-v1-modal-body-padding">
<h2 class="docs-Heading">V1 Feature &mdash; Vertical Padding on Body</h2>

<button
type="button"
class="Button Button--primary Button--medium"
data-spirit-toggle="modal"
data-spirit-target="#example_body_padding"
aria-controls="example_body_padding"
aria-expanded="false"
>
Open Modal
</button>

<!-- Modal: start -->
<dialog id="example_body_padding" class="Modal" aria-labelledby="example_body_paddingtitle">

<!-- ModalDialog: start -->
<article class="ModalDialog">

<!-- ModalHeader: start -->
<header class="ModalHeader">
<h2 id="example_body_paddingtitle" class="ModalHeader__title">Modal Title</h2>
<button
type="button"
class="Button Button--tertiary Button--square Button--medium"
data-spirit-dismiss="modal"
data-spirit-target="#example_body_padding"
aria-controls="example_body_padding"
aria-expanded="false"
>
<svg class="Icon" width="24" height="24" aria-hidden="true">
<use xlink:href="/icons/svg/sprite.svg#close" />
</svg>
<span class="accessibility-hidden">Close</span>
</button>
</header>
<!-- ModalHeader: end -->

<!-- ModalBody: start -->
<div class="ModalBody">
<!-- Content: start -->
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam at excepturi laudantium magnam mollitia
perferendis reprehenderit, voluptate. Cum delectus dicta ducimus eligendi excepturi natus perferendis
provident unde. Eveniet, iste, molestiae?
</p>
<!-- Content: end -->
</div>
<!-- ModalBody: end -->

<!-- ModalFooter: start -->
<footer class="ModalFooter ModalFooter--right">
<div class="ModalFooter__actions">
<button
type="button"
class="Button Button--primary Button--medium"
data-spirit-toggle="modal"
data-spirit-target="#example_2_1"
aria-controls="example_2_1"
aria-expanded="false"
>
Open stacked dialog
</button>
</div>
</footer>
<!-- ModalFooter: end -->

</article>
<!-- ModalDialog: end -->

</dialog>
<!-- Modal: end -->

</section>
<section class="docs-Section">
<h2 class="docs-Heading">Stacking Modals</h2>

Expand Down

0 comments on commit 462a245

Please sign in to comment.