-
Notifications
You must be signed in to change notification settings - Fork 0
/
.svgrrc.cjs
37 lines (34 loc) · 924 Bytes
/
.svgrrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module.exports = {
typescript: true,
filenameCase: 'camel',
svgProps: {
fill: '{fill !== undefined ? colors[fill] : colors.white}',
stroke: '{stroke}',
'aria-hidden': true,
},
svgoConfig: {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
},
},
},
],
},
template: (variables, { tpl }) => {
/* eslint-disable @typescript-eslint/restrict-template-expressions */
return tpl`
import { colors } from '@/styles/themes.css';
import type { IconProps } from '@/components/base/Icons/props';
import type { FC } from 'react';
const ${`${variables.componentName}: FC<IconProps>`} = ({ fill, stroke, ...props }) => (
${variables.jsx}
);
${variables.exports};
`;
/* eslint-enable @typescript-eslint/restrict-template-expressions */
},
};