Refactor components structure

This commit is contained in:
prototypa
2022-09-04 03:21:44 -04:00
parent e95d47b5d3
commit 00cd7fa1b1
25 changed files with 97 additions and 73 deletions

View File

@@ -0,0 +1,28 @@
---
import { Icon } from "astro-icon";
const {
label = "Toggle Menu",
class:
className = "ml-1.5 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center transition",
iconClass = "w-6 h-6",
iconName = "tabler:menu",
} = Astro.props;
---
<button type="button" class={className} aria-label={label} data-aw-toggle-menu>
<Icon name={iconName} class={iconClass} optimize={false} />
</button>
<style is:global>
[data-aw-toggle-menu] path {
@apply transition;
}
[data-aw-toggle-menu].expanded g > path:first-child {
@apply -rotate-45 translate-y-[15px] translate-x-[-3px];
}
[data-aw-toggle-menu].expanded g > path:last-child {
@apply rotate-45 translate-y-[-8px] translate-x-[14px];
}
</style>