Skip to content

Commit fcd9282

Browse files
committed
add: transition for <Tabs>
1 parent 56bfc88 commit fcd9282

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/common/Tabs.astro

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ body.querySelector(`[data-tab="${active}"]`)?.classList.add("active");
4242
style={`--accent-color: ${button.accent ?? "#ffffff"}`}
4343
>
4444
<span>
45-
{button.image && <Image src={button.image} alt={button.name}/>}
45+
{button.image && <Image src={button.image} alt={button.name} />}
4646
{button.icon && <Icon name={button.icon} group="solid" />}
4747
{button.name}
4848
</span>
@@ -89,6 +89,8 @@ body.querySelector(`[data-tab="${active}"]`)?.classList.add("active");
8989
</script>
9090

9191
<style lang="scss">
92+
$transition-length: 0.3s;
93+
9294
.tabs {
9395
position: relative;
9496
width: 100%;
@@ -136,11 +138,12 @@ body.querySelector(`[data-tab="${active}"]`)?.classList.add("active");
136138
bottom: 0px;
137139
left: 0px;
138140
z-index: 0;
139-
transition: height ease-in-out 0.3s;
141+
transition: height ease-in-out $transition-length;
140142
background-color: var(--accent-color);
141143
}
142144

143145
& > span {
146+
transition: filter $transition-length ease-in-out;
144147
filter: saturate(0);
145148
display: inline-flex;
146149
align-items: center;
@@ -161,6 +164,7 @@ body.querySelector(`[data-tab="${active}"]`)?.classList.add("active");
161164
}
162165
&::after {
163166
height: 0.1em;
167+
box-shadow: 0px -1px 6px 0px var(--accent-color);
164168
}
165169
}
166170

0 commit comments

Comments
 (0)