Skip to content

Commit e029891

Browse files
ASchoe311mdojulien-deramond
authored
Docs: mention data-bs-target for offcanvas close buttons (#41325)
Co-authored-by: Mark Otto <[email protected]> Co-authored-by: Julien Déramond <[email protected]>
1 parent 690fbfd commit e029891

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Diff for: site/content/docs/5.3/components/offcanvas.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,16 @@ Change the appearance of offcanvases with utilities to better match them to diff
163163

164164
{{< added-in "5.2.0" >}}
165165

166-
Responsive offcanvas classes hide content outside the viewport from a specified breakpoint and down. Above that breakpoint, the contents within will behave as usual. For example, `.offcanvas-lg` hides content in an offcanvas below the `lg` breakpoint, but shows the content above the `lg` breakpoint.
166+
Responsive offcanvas classes hide content outside the viewport from a specified breakpoint and down. Above that breakpoint, the contents within will behave as usual. For example, `.offcanvas-lg` hides content in an offcanvas below the `lg` breakpoint, but shows the content above the `lg` breakpoint. Responsive offcanvas classes are available for each breakpoint.
167+
168+
- `.offcanvas`
169+
- `.offcanvas-sm`
170+
- `.offcanvas-md`
171+
- `.offcanvas-lg`
172+
- `.offcanvas-xl`
173+
- `.offcanvas-xxl`
174+
175+
To make a responsive offcanvas, replace the `.offcanvas` base class with a responsive variant and ensure your close button has an explicit `data-bs-target`.
167176

168177
{{< example >}}
169178
<button class="btn btn-primary d-lg-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasResponsive" aria-controls="offcanvasResponsive">Toggle offcanvas</button>
@@ -181,15 +190,6 @@ Responsive offcanvas classes hide content outside the viewport from a specified
181190
</div>
182191
{{< /example >}}
183192

184-
Responsive offcanvas classes are available across for each breakpoint.
185-
186-
- `.offcanvas`
187-
- `.offcanvas-sm`
188-
- `.offcanvas-md`
189-
- `.offcanvas-lg`
190-
- `.offcanvas-xl`
191-
- `.offcanvas-xxl`
192-
193193
## Placement
194194

195195
There's no default placement for offcanvas components, so you must add one of the modifier classes below.

0 commit comments

Comments
 (0)