Download components/sidebar.js from iprofitx/helphub-knowledge-base-explorer: direct link, hf CLI and curl.
- Browser
- Download file 1.6 kB
-
https://huggingface.co/spaces/iprofitx/helphub-knowledge-base-explorer/resolve/main/components/sidebar.js
- Command line
-
hf download hf://spaces/iprofitx/helphub-knowledge-base-explorer/components/sidebar.js
-
curl -L -o sidebar.js https://huggingface.co/spaces/iprofitx/helphub-knowledge-base-explorer/resolve/main/components/sidebar.js
1.6 kB
| class CustomSidebar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| } | |
| aside { | |
| position: sticky; | |
| top: 2rem; | |
| } | |
| h3 { | |
| font-weight: 600; | |
| color: #1f2937; | |
| margin-bottom: 1rem; | |
| } | |
| ul { | |
| list-style: none; | |
| padding: 0; | |
| margin: 0; | |
| } | |
| li { | |
| margin-bottom: 0.75rem; | |
| } | |
| a { | |
| display: flex; | |
| align-items: center; | |
| justify-content: space-between; | |
| padding: 0.5rem 0; | |
| text-decoration: none; | |
| transition: color 0.2s; | |
| } | |
| .tag { | |
| display: inline-block; | |
| padding: 0.25rem 0.5rem; | |
| border-radius: 9999px; | |
| font-size: 0.75rem; | |
| line-height: 1rem; | |
| } | |
| .flex-wrap { | |
| display: flex; | |
| flex-wrap: wrap; | |
| gap: 0.5rem; | |
| } | |
| </style> | |
| <aside> | |
| <slot></slot> | |
| </aside> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-sidebar', CustomSidebar); |