Skip to content

Commit bf3c1ff

Browse files
committed
remove .dialog-overflow hackery
1 parent b964424 commit bf3c1ff

3 files changed

Lines changed: 3 additions & 67 deletions

File tree

scss/_dialog.scss

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -188,37 +188,6 @@ $dialog-sizes: defaults(
188188
transform: translate(-50%, -50%);
189189
}
190190

191-
// Overflow dialog - scrollable viewport container with dialog box inside
192-
&.dialog-overflow {
193-
// Make dialog element the full-viewport scrollable container
194-
position: fixed;
195-
inset: 0;
196-
width: 100%;
197-
max-width: 100%;
198-
height: 100%;
199-
max-height: 100%;
200-
padding: var(--dialog-margin);
201-
margin: 0;
202-
overflow-y: auto;
203-
overscroll-behavior: contain;
204-
background: transparent;
205-
border: 0;
206-
box-shadow: none;
207-
208-
// The visual dialog box is a child wrapper
209-
> .dialog-box {
210-
max-width: var(--dialog-width);
211-
margin-block-end: var(--dialog-margin);
212-
margin-inline: auto;
213-
color: var(--dialog-color);
214-
background-color: var(--dialog-bg);
215-
background-clip: padding-box;
216-
border: var(--dialog-border-width) solid var(--dialog-border-color);
217-
@include border-radius(var(--dialog-border-radius));
218-
@include box-shadow(var(--dialog-box-shadow));
219-
}
220-
}
221-
222191
// Scrollable dialog body (header/footer stay fixed)
223192
&.dialog-scrollable[open] {
224193
max-height: calc(100% - var(--dialog-margin) * 2);

site/src/content/docs/components/dialog.mdx

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,9 @@ Add `.dialog-slide-up` to the `<dialog>` and it will slide **up** from the botto
214214
</div>
215215
</dialog>`} />
216216

217-
## Scrolling
217+
## Scrollable
218218

219-
### Inner scroll
220-
221-
You can also create a scrollable dialog that scrolls the dialog body while keeping the header and footer fixed. Add `.dialog-scrollable` to the `.dialog` element.
219+
Create a scrollable dialog that scrolls the dialog body while keeping the header and footer fixed. Add `.dialog-scrollable` to the `.dialog` element.
222220

223221
<Example code={`<button type="button" class="btn-solid theme-primary" data-bs-toggle="dialog" data-bs-target="#scrollableBodyDialog">
224222
Launch scrollable body dialog
@@ -245,37 +243,6 @@ You can also create a scrollable dialog that scrolls the dialog body while keepi
245243
</div>
246244
</dialog>`} />
247245

248-
### Overflow scroll
249-
250-
For a dialog that extends beyond the viewport and scrolls as a whole, add `.dialog-overflow` and wrap the content in a `.dialog-box` element. The `<dialog>` becomes a full-viewport scrollable container, and the `.dialog-box` is the visual dialog that scrolls up and down.
251-
252-
<Example code={`<button type="button" class="btn-solid theme-primary" data-bs-toggle="dialog" data-bs-target="#overflowDialog">
253-
Launch overflow dialog
254-
</button>
255-
256-
<dialog class="dialog dialog-overflow" id="overflowDialog"><!-- [!code highlight] -->
257-
<div class="dialog-box"><!-- [!code highlight] -->
258-
<div class="dialog-header">
259-
<h1 class="dialog-title">Overflow dialog</h1>
260-
<CloseButton dismiss="dialog" />
261-
</div>
262-
<div class="dialog-body">
263-
<p>This dialog extends beyond the viewport height. Scroll to see more content. Notice how the entire dialog—including header and footer—shifts up and down as you scroll.</p>
264-
<p>The <code>.dialog-overflow</code> modifier creates a full-viewport scrollable container. The <code>.dialog-box</code> wrapper contains the visual dialog that moves up and down as you scroll. This pattern is useful for very long content like terms of service or detailed forms.</p>
265-
<p>Unlike the default scrolling behavior where the dialog is constrained to the viewport, overflow dialogs can extend beyond it. This gives users a more document-like reading experience for lengthy content.</p>
266-
<p>The backdrop remains fixed while the dialog content scrolls. Clicking outside the dialog box still closes it (unless using a static backdrop). Keyboard navigation and focus trapping work the same as standard dialogs.</p>
267-
<p>Consider using <code>.dialog-scrollable</code> instead if you want the header and footer to remain visible while scrolling. The scrollable variant keeps navigation controls accessible at all times, which may be preferable for forms with submit buttons.</p>
268-
<p>Both approaches leverage the native <code>&lt;dialog&gt;</code> element's top layer rendering. This ensures the dialog appears above all other content, including elements with high z-index values, fixed positioning, or transforms.</p>
269-
<p>The choice between scrolling behaviors depends on your content and user experience goals. Document-like content often works well with overflow scrolling, while interactive content may benefit from fixed header and footer.</p>
270-
<p>You've reached the bottom of the overflow dialog!</p>
271-
</div>
272-
<div class="dialog-footer">
273-
<button type="button" class="btn-solid theme-secondary" data-bs-dismiss="dialog">Close</button>
274-
<button type="button" class="btn-solid theme-primary">Save changes</button>
275-
</div>
276-
</div>
277-
</dialog>`} />
278-
279246
## Swapping dialogs
280247

281248
When a toggle trigger is inside an open dialog, clicking it will **swap** dialogs—opening the new one before closing the current. This ensures the backdrop stays visible throughout the transition with no flash. The swap behavior is automatic when a `data-bs-toggle="dialog"` trigger is inside an already-open dialog.

site/src/content/docs/guides/migration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Bootstrap 6 is a major release with many breaking changes to modernize our codeb
177177
- CSS variables: `--modal-*` &rarr; `--dialog-*`.
178178
- Backdrop: The `.modal-backdrop` DOM element is gone — Dialog uses the native `::backdrop` pseudo-element with `backdrop-filter: blur()` support.
179179
- Body scroll prevention: `.modal-open` on `<body>` &rarr; `.dialog-open` on the `<html>` element.
180-
- New variant classes: `.dialog-slide-up`, `.dialog-slide-down` (slide animations), `.dialog-instant` (no animation), `.dialog-static` (static backdrop bounce), `.dialog-nonmodal` (non-modal positioning), `.dialog-scrollable`, `.dialog-overflow`.
180+
- New variant classes: `.dialog-slide-up`, `.dialog-slide-down` (slide animations), `.dialog-instant` (no animation), `.dialog-static` (static backdrop bounce), `.dialog-nonmodal` (non-modal positioning), `.dialog-scrollable`.
181181
- Non-modal support: Set `modal: false` or `data-bs-modal="false"` for non-modal dialogs.
182182
- Dialog swapping: Triggers inside an open dialog can open a new dialog and close the current one automatically.
183183
- See the [Dialog docs]([[docsref:/components/dialog]]) for full details.

0 commit comments

Comments
 (0)