Skip to content

Commit

Permalink
fix: undo moving common icons styles to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes authored Jun 17, 2022
1 parent d6b7f94 commit 1cbd517
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
17 changes: 15 additions & 2 deletions packages/preset-icons/index.js
Original file line number Diff line number Diff line change
@@ -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),
Expand Down
18 changes: 0 additions & 18 deletions packages/preset-icons/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
});

0 comments on commit 1cbd517

Please sign in to comment.