Skip to content

Commit

Permalink
feat: add button color transition (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
VmMad authored Apr 16, 2024
1 parent 3c7c76b commit 99f972c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/atoms/buttons/button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<svelte:element
this={href ? 'a' : 'button'}
role={href ? 'link' : 'button'}
class="whitespace-pre-line {textClasses} {colorClasses} {iconClasses} {FONT_FAMILY_CLASS.primary}"
class="whitespace-pre-line transition-colors {textClasses} {colorClasses} {iconClasses} {FONT_FAMILY_CLASS.primary}"
{disabled}
href={href || null}
target={href && isExternal ? '_blank' : null}
Expand Down
21 changes: 2 additions & 19 deletions src/lib/components/organisms/menu/menu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
*/
export let isMobileMenuOpen: boolean = false
function getActiveIndexSetter(index: number): () => void {
return () => (activeIndex = index)
}
function toggleMobileMenu(): void {
isMobileMenuOpen = !isMobileMenuOpen
}
Expand All @@ -52,13 +48,7 @@
</a>
<desktop-menu-items class="hidden md:flex flex-row items-center space-x-4">
{#each menuItems as menuItem, index}
{@const handleOnClick = getActiveIndexSetter(index)}
<MenuItem
{...menuItem}
{darkmode}
isActive={activeIndex === index}
on:click={handleOnClick}
/>
<MenuItem {...menuItem} {darkmode} isActive={activeIndex === index} />
{/each}
</desktop-menu-items>
<button
Expand All @@ -76,14 +66,7 @@
>
<menu-items class="flex flex-col items-start justify-start space-y-8 py-[60px] px-6">
{#each menuItems as menuItem, index}
{@const handleOnClick = getActiveIndexSetter(index)}
<MenuItem
{...menuItem}
{darkmode}
isActive={activeIndex === index}
on:click={handleOnClick}
mobile
/>
<MenuItem {...menuItem} {darkmode} isActive={activeIndex === index} mobile />
{/each}
</menu-items>
</aside>
Expand Down

0 comments on commit 99f972c

Please sign in to comment.