diff --git a/packages/preset-icons/index.js b/packages/preset-icons/index.js index afed894a..dc0c9d7e 100644 --- a/packages/preset-icons/index.js +++ b/packages/preset-icons/index.js @@ -1,9 +1,22 @@ import iconsList from "./icons.js"; -import {generateIconCssFromPath, getIconsBaseStyles} from "./utils.js"; +import {generateIconCssFromPath} from "./utils.js"; export default { styles: { - ...getIconsBaseStyles(), + '[class^="icon-"],[class*=" icon-"]': { + alignSelf: "center", + display: "inline-flex", + lineHeight: "1", + textRendering: "auto", + verticalAlign: "-0.125em", + }, + '[class^="icon-"]:before,[class*=" icon-"]:before': { + content: "''", + display: "inline-block", + width: "1em", + height: "1em", + backgroundColor: "currentColor", + }, ...Object.fromEntries(iconsList.map(icon => ([ `.icon-${icon.name}:before`, generateIconCssFromPath(icon.path), diff --git a/packages/preset-icons/utils.js b/packages/preset-icons/utils.js index a355db57..890916e1 100644 --- a/packages/preset-icons/utils.js +++ b/packages/preset-icons/utils.js @@ -31,21 +31,3 @@ export const generateIconCssFromPath = (path, size, fill) => ({ "-webkit-mask": "var(--sii-icon) no-repeat", "-webkit-mask-size": "100% 100%", }); - -// Get icons base styles -export const getIconsBaseStyles = () => ({ - '[class^="icon-"],[class*=" icon-"]': { - alignSelf: "center", - display: "inline-flex", - lineHeight: "1", - textRendering: "auto", - verticalAlign: "-0.125em", - }, - '[class^="icon-"]:before,[class*=" icon-"]:before': { - content: "''", - display: "inline-block", - width: "1em", - height: "1em", - backgroundColor: "currentColor", - }, -});