Skip to content

Commit

Permalink
fix: appbar behavior and styling
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantanrk committed Mar 30, 2022
1 parent 25fd1e6 commit 16a1e8a
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions components/app-bar/src/AppBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@
<slot name="menu-item" item={leadingItems[index]} {index} {selected}>
<input type="checkbox" id="check_{key}" />
<label for="check_{key}">
<a style="height: 100%; display: flex;" {href} {...otherProps}>
<span style="width: 100%;" class="item-label">
{label}
</span>
{#if (otherProps.subItems || []).length > 0}
{#if (otherProps.subItems || []).length > 0}
<div class="resp-app-bar__menu-item__dropdown">
<span style="width: 100%;" class="item-label">
{label}
</span>
<svg style="width: 20px; height: 20px;" viewBox="-14 -25 70 70">
<defs />
<g>
Expand All @@ -202,8 +202,14 @@
/>
</g>
</svg>
{/if}
</a>
</div>
{:else}
<a style="height: 100%; display: flex;" {href} {...otherProps}>
<span style="width: 100%;" class="item-label">
{label}
</span>
</a>
{/if}
</label>
</slot>
{#if (otherProps.subItems || []).length > 0}
Expand All @@ -223,7 +229,7 @@
item={leadingItems[index].subMenus[subIndex]}
index={subIndex}
>
<a href={sub.href}><span>{sub.label}</span></a>
<a href={sub.href} {...otherProps}><span>{sub.label}</span></a>
</slot>
</li>
{/each}
Expand Down Expand Up @@ -466,7 +472,13 @@
}
}
label > a > svg {
&__dropdown {
height: 100%;
display: flex;
padding: 0.5rem 1rem;
}
label > span > svg {
transform: rotateZ(180deg);
transition: transform 0.5s ease;
}
Expand All @@ -479,7 +491,7 @@
height: auto;
}
input[type="checkbox"]:checked ~ label > a > svg {
input[type="checkbox"]:checked ~ label > span > svg {
transform: unset;
}
}
Expand Down

0 comments on commit 16a1e8a

Please sign in to comment.