Skip to content
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

Make the sidebar collapsible. #291

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/components/Icons/Icons.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
import { Icons } from "./Icons"
interface Props {
name: keyof typeof Icons
label?: string
color?: string
size?: string
class?: string
}
const { name, label, size = "1em", color } = Astro.props
const a11yAttrs = label ? ({ "aria-label": label } as const) : ({ "aria-hidden": "true" } as const)
---

<svg
{...a11yAttrs}
class={Astro.props.class}
width="16"
height="16"
viewBox="0 0 24 24"
fill="currentColor"
set:html={Icons[name]}
/>

<style define:vars={{ "sl-icon-color": color, "sl-icon-size": size }}>
svg {
color: var(--sl-icon-color);
font-size: var(--sl-icon-size, 1em);
width: 1em;
height: 1em;
}
</style>
Loading