iprofitx's picture
include sample content articles so I can read what it looks like. Add features on there as talked
3d6e1be verified
Raw History Blame Contribute Delete
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);