Skip to content

Commit

Permalink
feat(tab-card): adjust collapsable
Browse files Browse the repository at this point in the history
Wrap content around cosmoz-collapse.
Use `.collapse-icon` class to style the collapse icon.
  • Loading branch information
megheaiulian committed Mar 7, 2024
1 parent 3dfd2f2 commit 353a82a
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/cosmoz-tab-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ const CosmozTabCard = (host) => {
${when(
collapsable,
() => html`
<div @click=${toggleCollapsed} part="collapse-icon">
<div
@click=${toggleCollapsed}
class="collapse-icon"
part="collapse-icon"
>
<slot name="collapse-icon">${collapseIcon}</slot>
</div>
`,
Expand All @@ -60,9 +64,11 @@ const CosmozTabCard = (host) => {
<slot name="card-actions"></slot>
</div>
<div id="content" part="content">
<cosmoz-collapse ?opened=${!collapsed}><slot></slot></cosmoz-collapse>
</div>`;
<cosmoz-collapse ?opened=${!collapsed}>
<div id="content" part="content">
<slot></slot>
</div>
</cosmoz-collapse> `;
};

const style = css`
Expand Down Expand Up @@ -102,17 +108,17 @@ const style = css`
flex: 1;
}
[part='collapse-icon'] {
.collapse-icon {
order: var(--cosmoz-tab-card-collapse-icon-order);
transition: transform 250ms linear;
transform: rotate(90deg);
}
:host([collapsed]) [part='collapse-icon'] {
:host([collapsed]) .collapse-icon {
transform: rotate(0deg);
}
:host([collapsable]) [part='collapse-icon'],
:host([collapsable]) .collapse-icon,
:host([collapsable]) .heading {
cursor: pointer;
user-select: none;
Expand Down

0 comments on commit 353a82a

Please sign in to comment.