diff --git a/icons-styled-components/scripts/pre-build.js b/icons-styled-components/scripts/pre-build.js index ecc6404..300b05e 100644 --- a/icons-styled-components/scripts/pre-build.js +++ b/icons-styled-components/scripts/pre-build.js @@ -13,6 +13,7 @@ Object.keys(icons).forEach(k => { const result = mustache.render(iconsTpl.toString(), { styledname: `Styled${name}`, name, + originalname: k, css, }) fs.outputFileSync(path.resolve(__dirname, `../src/icons/${name}.tsx`), result) diff --git a/icons-styled-components/template/icon.tsx.tpl b/icons-styled-components/template/icon.tsx.tpl index 13de5b6..d64d8b3 100644 --- a/icons-styled-components/template/icon.tsx.tpl +++ b/icons-styled-components/template/icon.tsx.tpl @@ -8,7 +8,7 @@ const {{ styledname }} = styled.i` export const {{ name }} = React.forwardRef>((props, ref) => { return ( <> - <{{ styledname }} {...props} ref={ref} /> + <{{ styledname }} {...props} ref={ref} icon-role="{{originalname}}" /> ) })