mirror of
https://github.com/iconify/iconify.git
synced 2024-12-13 14:13:06 +00:00
chore: handle scale
option when merging svg icon props
This commit is contained in:
parent
a1592498bb
commit
f5665ede70
@ -41,6 +41,7 @@ export async function getCustomIcon(
|
|||||||
collection,
|
collection,
|
||||||
icon,
|
icon,
|
||||||
additionalProps,
|
additionalProps,
|
||||||
|
options?.scale ?? 1.2,
|
||||||
undefined,
|
undefined,
|
||||||
iconCustomizer,
|
iconCustomizer,
|
||||||
);
|
);
|
||||||
|
@ -37,6 +37,7 @@ export async function searchForIcon(
|
|||||||
collection,
|
collection,
|
||||||
id,
|
id,
|
||||||
additionalProps,
|
additionalProps,
|
||||||
|
options?.scale ?? 1.2,
|
||||||
() => attributes,
|
() => attributes,
|
||||||
iconCustomizer
|
iconCustomizer
|
||||||
);
|
);
|
||||||
|
@ -8,10 +8,14 @@ export async function mergeIconProps(
|
|||||||
collection: string,
|
collection: string,
|
||||||
icon: string,
|
icon: string,
|
||||||
additionalProps: Record<string, string | undefined>,
|
additionalProps: Record<string, string | undefined>,
|
||||||
|
scale: number,
|
||||||
propsProvider?: () => Awaitable<Record<string, string>>,
|
propsProvider?: () => Awaitable<Record<string, string>>,
|
||||||
iconCustomizer?: IconCustomizer
|
iconCustomizer?: IconCustomizer,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const props: Record<string, string> = (await propsProvider?.()) ?? {};
|
const props: Record<string, string> = (await propsProvider?.()) ?? {
|
||||||
|
height: `${scale ?? 1}em`,
|
||||||
|
width: `${scale ?? 1}em`,
|
||||||
|
};
|
||||||
await iconCustomizer?.(collection, icon, props);
|
await iconCustomizer?.(collection, icon, props);
|
||||||
Object.keys(additionalProps).forEach((p) => {
|
Object.keys(additionalProps).forEach((p) => {
|
||||||
const v = additionalProps[p];
|
const v = additionalProps[p];
|
||||||
|
Loading…
Reference in New Issue
Block a user