File tree Expand file tree Collapse file tree 8 files changed +168
-35
lines changed
Expand file tree Collapse file tree 8 files changed +168
-35
lines changed Original file line number Diff line number Diff line change 1111 export let color: KIconProps [' color' ] = ' ' ;
1212 export let cls: KIconProps [' cls' ] = ' ' ;
1313 export let attrs: KIconProps [' attrs' ] = {};
14+ export let theme: KIconProps [' theme' ] = undefined ;
1415
1516 $ : tag = btn ? ' button' : ' ' ;
1617
3031 $ : cnames = clsx (
3132 ` ${prefixCls }--base ` ,
3233 {
33- [` ${prefixCls }--base__dark ` ]: ! color ,
34+ [` ${prefixCls }--base__dark ` ]: ! color && (( theme && theme === ' dark ' ) || theme === undefined ) ,
3435 [` ${prefixCls }--role-button ` ]: !! btn
3536 },
3637 ` ${prefixCls }-transition ` ,
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ export type KIconProps = {
77 width : string ;
88 height : string ;
99 color : string ;
10+ /**
11+ * @internal
12+ */
13+ theme ?: 'dark' | 'light' ;
1014 cls : ClassValue ;
1115 attrs : Record < string , string > ;
1216} ;
Original file line number Diff line number Diff line change 1919 export let selectable: KMenuProps [' selectable' ] = true ;
2020 export let inlineCollapsed: KMenuProps [' inlineCollapsed' ] = false ;
2121 export let ctxKey: KMenuProps [' ctxKey' ] = ' ' ;
22+ export let theme: KMenuProps [' theme' ] = undefined ;
2223 const dispatch = createEventDispatcher ();
2324 function onOpenChange(openUids : string []) {
2425 dispatch (' openChange' , openUids );
6768 openUids ,
6869 selectedUids ,
6970 multiple ,
71+ theme ,
7072 selectable ,
7173 attrs ,
7274 ctxKey
9597 mode: resolveMode ,
9698 inlineIndent ,
9799 openUids ,
100+ theme ,
98101 multiple ,
99102 selectedUids ,
100103 selectable ,
110113 const prefixCls = getPrefixCls (' menu' );
111114 $ : cnames = clsx (
112115 prefixCls ,
113- ` ${prefixCls }__dark ` ,
114116 ` ${prefixCls }-${mode } ` ,
115- ` ${prefixCls }-${mode }__dark ` ,
117+ {
118+ [` ${prefixCls }__dark ` ]: theme === ' dark' || theme === undefined ,
119+ [` ${prefixCls }-${mode }__dark ` ]: theme === ' dark' || theme === undefined
120+ },
116121 cls
117122 );
123+ $ : darkCls = clsx (' overflow-hidden' , { dark: theme === ' dark' });
118124 </script >
119125
120126{#if show }
121- <div class ="overflow-hidden" bind:this ={menuRef }>
127+ <div class ={ darkCls } bind:this ={menuRef }>
122128 <ul
123129 class ={cnames }
124130 style:border-color ={bdBg }
You can’t perform that action at this time.
0 commit comments