File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 77 </script >
88
99<script lang =" ts" >
10+ import { classNames } from ' $lib/utils/classnames' ;
1011 import { createTabs } from ' @melt-ui/svelte' ;
1112 import { setContext } from ' svelte' ;
1213 import { writable } from ' svelte/store' ;
3334 <ul class ="tabs-list flex items-center gap-4" {...$list } use:list >
3435 {#each $ctx .triggers .entries () as [id, title]}
3536 <li
36- class =" tabs-item rounded-t-[0.625rem] hover:bg-white/4"
37+ class =" tabs-item rounded-t-[0.625rem] text-center hover:bg-white/4"
3738 class:text- [var (--color-primary )]={$value === id }
3839 >
3940 <button
40- class =" tabs-button cursor-pointer bg-clip-padding py-[0.625rem] px-1 font-light outline-none"
41+ class ={classNames (
42+ ' tabs-button relative cursor-pointer bg-clip-padding py-[0.625rem] px-1 font-light outline-none' ,
43+ ' after:relative after:top-1 after:bottom-0 after:block after:h-px after:transition-all' ,
44+ {
45+ ' after:bg-[var(--color-primary)]' : $value === id
46+ }
47+ )}
4148 {...$trigger (id )}
4249 use:trigger >{title }</button
4350 >
44- {#if $value === id }
45- <div
46- class =" absolute mt-0.5 h-px overflow-hidden bg-[var(--color-primary)] px-1"
47- >
48- {title }
49- </div >
50- {/if }
5151 </li >
5252 {/each }
5353 </ul >
You can’t perform that action at this time.
0 commit comments