Skip to content

Commit

Permalink
chore: pass option
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed May 6, 2024
1 parent 0a4afc2 commit dc52e9f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const iconsPlugin = (iconsPluginOptions?: IconsPluginOptions) => {
scale = 1,
prefix = "i",
extraProperties = {},
strokeWidth,
collectionNamesAlias = {},
} = iconsPluginOptions ?? {}

Expand All @@ -65,6 +66,7 @@ export const iconsPlugin = (iconsPluginOptions?: IconsPluginOptions) => {
components[`${collectionName}-${name}`] = generateIconComponent(data, {
scale,
extraProperties,
strokeWidth,
})
})
}
Expand Down Expand Up @@ -93,13 +95,14 @@ export const dynamicIconsPlugin = (
const {
prefix = "i",
scale = 1,
strokeWidth,
extraProperties = {},
} = iconsPluginOptions ?? {}

return plugin(({ matchComponents }) => {
matchComponents({
[prefix]: (value) =>
getDynamicCSSRules(value, { scale, extraProperties }),
getDynamicCSSRules(value, { scale, extraProperties, strokeWidth }),
})
})
}

0 comments on commit dc52e9f

Please sign in to comment.