From: Mark Otto Date: Fri, 3 Jul 2026 04:46:25 +0000 (-0700) Subject: v6 Responsive drawer fix (#42619) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=35b7b080a63991ea09f2cc8cfc3e8e1319222c31;p=thirdparty%2Fbootstrap.git v6 Responsive drawer fix (#42619) * Fix responsive drawer close example * Copy tweak, fix placeholder to generate CloseButton props properly --------- Co-authored-by: Ishaan Kapur <64529428+ishaanlabs-gg@users.noreply.github.com> --- diff --git a/site/src/content/docs/components/drawer.mdx b/site/src/content/docs/components/drawer.mdx index 078cd47550..2d00d26679 100644 --- a/site/src/content/docs/components/drawer.mdx +++ b/site/src/content/docs/components/drawer.mdx @@ -196,23 +196,16 @@ Add `.drawer-sheet` to render the panel flush against the viewport edge. The she Responsive drawer classes hide content outside the viewport from a specified breakpoint and down. Above that breakpoint, the contents within will behave as usual. For example, `.lg:drawer` hides content in a drawer below the `lg` breakpoint, but shows the content above the `lg` breakpoint. Responsive drawer classes are available for each breakpoint. -- `.drawer` -- `.sm:drawer` -- `.md:drawer` -- `.lg:drawer` -- `.xl:drawer` -- `.2xl:drawer` - To make a responsive drawer, replace the `.drawer` base class with a responsive variant and ensure your close button has an explicit `data-bs-target`. Toggle drawer -

Resize your browser to show the responsive drawer toggle.

+

Resize your browser to show the responsive drawer toggle.

Responsive drawer
- +

This is content within an .lg:drawer.

diff --git a/site/src/libs/placeholder.ts b/site/src/libs/placeholder.ts index 3cf786ae33..675b7bad81 100644 --- a/site/src/libs/placeholder.ts +++ b/site/src/libs/placeholder.ts @@ -58,15 +58,17 @@ export function getPlaceholder(userOptions: Partial): Placeh /** * Renders a CloseButton component to its HTML string representation. - * Supports optional `dismiss` and `class` attributes. + * Supports optional `dismiss`, `target`, and `class` attributes. */ function renderCloseButtonToString(attributes: Record): string { const dismiss = attributes.dismiss + const target = attributes.target const extraClass = attributes.class const dismissAttr = dismiss ? ` data-bs-dismiss="${dismiss}"` : '' + const targetAttr = target ? ` data-bs-target="${target}"` : '' const classValue = extraClass ? `btn-close ${extraClass}` : 'btn-close' - return `` + return `` } /**