Skip to content

Commit af5276a

Browse files
committed
Update offcanvas references to drawer after rebase
Carry over frontmatter additions to drawer.mdx, fix DocsLayout ToC to use drawer classes and dialog element, update navbar.mdx dep title, and fix _toc.scss class name. Made-with: Cursor
1 parent 7d98e86 commit af5276a

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: Drawer
33
description: Build hidden sidebars or drawers into your project for navigation, shopping carts, and more with a few classes and our JavaScript plugin. Replaces the old Offcanvas component.
44
toc: true
5+
css_layer: components
6+
js: required
57
---
68

79
## How it works

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ toc: true
55
css_layer: components
66
js: required
77
deps:
8-
- title: Offcanvas
8+
- title: Drawer
99
- title: Collapse
1010
- title: Menu
1111
---

site/src/layouts/DocsLayout.astro

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ if (currentPageIndex < allPages.length - 1) {
116116
<button
117117
class="btn-solid theme-secondary rounded-pill px-5"
118118
type="button"
119-
data-bs-toggle="offcanvas"
119+
data-bs-toggle="drawer"
120120
data-bs-target="#bdTocSidebar"
121121
aria-controls="bdTocSidebar"
122122
>
@@ -126,13 +126,13 @@ if (currentPageIndex < allPages.length - 1) {
126126
</div>
127127

128128
<div class="bd-toc mt-3 mb-5 lg:my-0 lg:mb-5 sm:px-1">
129-
<div class="lg:offcanvas offcanvas-bottom" tabindex="-1" id="bdTocSidebar" aria-labelledby="bdTocOffcanvasLabel">
130-
<div class="offcanvas-header border-bottom">
131-
<h5 class="offcanvas-title" id="bdTocOffcanvasLabel">On this page</h5>
132-
<CloseButton dismiss="offcanvas" target="#bdTocSidebar" />
129+
<dialog class="lg:drawer drawer-bottom" tabindex="-1" id="bdTocSidebar" aria-labelledby="bdTocDrawerLabel">
130+
<div class="drawer-header border-bottom">
131+
<h5 class="drawer-title" id="bdTocDrawerLabel">On this page</h5>
132+
<CloseButton dismiss="drawer" target="#bdTocSidebar" />
133133
</div>
134134

135-
<div class="offcanvas-body">
135+
<div class="drawer-body">
136136
{
137137
frontmatter.toc && headings && (
138138
<nav id="TableOfContents" aria-label="Table of contents">
@@ -141,7 +141,7 @@ if (currentPageIndex < allPages.length - 1) {
141141
)
142142
}
143143
</div>
144-
</div>
144+
</dialog>
145145
<Ads />
146146
</div>
147147

site/src/scss/_toc.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
}
2020

2121
@include media-breakpoint-down(lg) {
22-
.lg\:offcanvas {
22+
.lg\:drawer {
2323
border-inline-start-color: var(--bs-border-color);
2424
box-shadow: var(--bs-box-shadow-lg);
2525
}

0 commit comments

Comments
 (0)