-
-
Notifications
You must be signed in to change notification settings - Fork 79k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example of dark navbar and offcanvas to docs #36510
Changes from all commits
84af137
a42c5b5
53f2eaf
cfb72ec
0489638
48b0066
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,22 @@ You can use a link with the `href` attribute, or a button with the `data-bs-targ | |
</div> | ||
{{< /example >}} | ||
|
||
### Dark offcanvas | ||
|
||
Change the appearance of offcanvases with utilities to better match them to different contexts like dark navbars. Here we add `.text-bg-dark` to the `.offcanvas` and `.btn-close-white` to `.btn-close` for proper styling with a dark offcanvas. If you have dropdowns within, consider also adding `.dropdown-menu-dark` to `.dropdown-menu`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd have removed the last sentence. More generally in a dark component content, we should use dark variants of components. |
||
|
||
{{< example class="bd-example-offcanvas p-0 bg-light overflow-hidden" >}} | ||
<div class="offcanvas offcanvas-start show text-bg-dark" tabindex="-1" id="offcanvasDark" aria-labelledby="offcanvasDarkLabel"> | ||
<div class="offcanvas-header"> | ||
<h5 class="offcanvas-title" id="offcanvasDarkLabel">Offcanvas</h5> | ||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="offcanvasDark" aria-label="Close"></button> | ||
</div> | ||
<div class="offcanvas-body"> | ||
<p>Place offcanvas content here.</p> | ||
</div> | ||
</div> | ||
{{< /example >}} | ||
|
||
### Body scrolling | ||
|
||
Scrolling the `<body>` element is disabled when an offcanvas and its backdrop are visible. Use the `data-bs-scroll` attribute to enable `<body>` scrolling. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposition of enhancement. I would have used a direct link to the Dark variant of the offcanvas rather than explaining how it is built.