import { InjectionToken, Provider } from '@angular/core'; /** * Lucide icon configuration options. */ export interface LucideConfig { /** * Stroke color. * @default currentColor */ color: string; /** * Width and height. * @default 24 */ size: string | number; /** * Stroke width * @default 2 */ strokeWidth: number; /** * Whether to use absolute stroke width. * @deprecated Use `nonScalingStroke` instead. */ absoluteStrokeWidth: boolean; /** * Whether stroke width should be scaled to appear uniform regardless of icon size. * @default false * * @remarks * Use CSS to set on SVG paths instead: * ```css * .lucide * { * vector-effect: non-scaling-stroke; * } * ``` */ nonScalingStroke: boolean; } /** * Default icon configuration options. */ export const lucideDefaultConfig: LucideConfig = { color: 'currentColor', size: 24, strokeWidth: 2, absoluteStrokeWidth: false, nonScalingStroke: false, }; /** * Injection token for providing default configuration options. * * @internal Use {@link provideLucideConfig} */ export const LUCIDE_CONFIG = new InjectionToken('Lucide icon config', { factory: () => lucideDefaultConfig, }); /** * Provider for default icon configuration options. */ export function provideLucideConfig(config: Partial): Provider { return { provide: LUCIDE_CONFIG, useValue: { ...lucideDefaultConfig, ...config, }, }; }