File tree Expand file tree Collapse file tree
routes/docs/components/Tooltip Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " layerchart " : patch
3+ ---
4+
5+ [ Tooltip] Change variant ` light ` /` dark ` (default: ` dark ` ) to ` default ` / ` invert ` and base on theme colors
Original file line number Diff line number Diff line change 3232
3333 export let contained: ' container' | false = ' container' ; // TODO: Support 'window' using getBoundingClientRect()
3434 export let animate = true ;
35- export let variant: ' dark ' | ' light ' | ' none' = ' dark ' ;
35+ export let variant: ' default ' | ' invert ' | ' none' = ' default ' ;
3636
3737 export let header: ((data : any ) => any ) | undefined = undefined ;
3838
159159 [' [&_.value]:text-sm [&_.value]:tabular-nums' ],
160160 ],
161161 {
162- dark : [
163- ' bg-gray-900 /90 backdrop-filter backdrop-blur-[2px] text-white ' ,
164- ' [&_.label]:text-white /75' ,
162+ default : [
163+ ' bg-surface-100 /90 dark:bg-surface-300/90 backdrop-filter backdrop-blur-[2px] text-surface-content ' ,
164+ ' [&_.label]:text-surface-content /75' ,
165165 ],
166- light : [
167- ' bg-white text-gray-800 border border-gray-500 ' ,
168- ' [&_.label]:text-surface-content /50' ,
166+ invert : [
167+ ' bg-surface-content/90 backdrop-filter backdrop-blur-[2px] text-surface-100 border border-surface-content ' ,
168+ ' [&_.label]:text-surface-100 /50' ,
169169 ],
170170 none: ' ' ,
171171 }[variant ],
Original file line number Diff line number Diff line change 178178 </div >
179179</Preview >
180180
181- <h2 >Light variant</h2 >
181+ <h2 >invert variant</h2 >
182182
183183<Preview data ={dateSeries }>
184184 <div class =" h-[300px] p-4 border rounded" >
202202 <Area class ="fill-primary/30" line ={{ class : ' stroke-primary stroke-2' }} />
203203 <Highlight points lines />
204204 </Svg >
205- <Tooltip variant =" light " let:data >
205+ <Tooltip variant =" invert " let:data >
206206 <div slot =" header" class =" font-semibold text-center" let:data >
207207 {format (data .date , ' eee, MMMM do' )}
208208 </div >
You can’t perform that action at this time.
0 commit comments