mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 20:27:43 +01:00
36 lines
666 B
TypeScript
36 lines
666 B
TypeScript
|
|
import {
|
||
|
|
createContext,
|
||
|
|
useContext,
|
||
|
|
type JSXElement
|
||
|
|
} from "solid-js";
|
||
|
|
|
||
|
|
export const LucideContext = createContext<{
|
||
|
|
size?: number;
|
||
|
|
fill?: string;
|
||
|
|
color?: string;
|
||
|
|
strokeWidth?: number;
|
||
|
|
absoluteStrokeWidth?: boolean;
|
||
|
|
}>({
|
||
|
|
size: 24,
|
||
|
|
fill: 'none',
|
||
|
|
color: 'currentColor',
|
||
|
|
strokeWidth: 2,
|
||
|
|
});
|
||
|
|
|
||
|
|
interface LucideProviderProps {
|
||
|
|
children: JSXElement;
|
||
|
|
size?: number
|
||
|
|
fill?: string;
|
||
|
|
color?: string;
|
||
|
|
strokeWidth?: number;
|
||
|
|
absoluteStrokeWidth?: boolean;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function LucideProvider({ children, ...props }: LucideProviderProps) {
|
||
|
|
return (
|
||
|
|
<LucideContext.Provider value={props}>
|
||
|
|
{children}
|
||
|
|
</LucideContext.Provider>
|
||
|
|
);
|
||
|
|
}
|