mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
docs: add initial recipes
This commit is contained in:
parent
964a0c9f75
commit
249f158f8a
9 changed files with 271 additions and 4 deletions
|
@ -26,6 +26,7 @@
|
|||
$: components = $layout.children.filter(
|
||||
(child) => child.title === "components"
|
||||
)[0];
|
||||
$: recipes = $layout.children.filter((child) => child.title === "recipes")[0];
|
||||
|
||||
$beforeUrlChange(() => {
|
||||
if (isMobile) isSideNavOpen = false;
|
||||
|
@ -215,7 +216,10 @@
|
|||
|
||||
<SideNav bind:isOpen="{isSideNavOpen}">
|
||||
<SideNavItems>
|
||||
<SideNavMenu expanded text="Components">
|
||||
<SideNavMenu
|
||||
expanded="{$isActive($url('/components'))}"
|
||||
text="Components"
|
||||
>
|
||||
{#each components.children as child, i (child.path)}
|
||||
<SideNavMenuItem
|
||||
text="{child.title}"
|
||||
|
@ -224,6 +228,15 @@
|
|||
/>
|
||||
{/each}
|
||||
</SideNavMenu>
|
||||
<SideNavMenu expanded="{$isActive($url('/recipes'))}" text="Recipes">
|
||||
{#each recipes.children as child, i (child.path)}
|
||||
<SideNavMenuItem
|
||||
text="{child.title}"
|
||||
href="{$url(child.path)}"
|
||||
isSelected="{$isActive($url(child.path))}"
|
||||
/>
|
||||
{/each}
|
||||
</SideNavMenu>
|
||||
</SideNavItems>
|
||||
</SideNav>
|
||||
<slot />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue