-
Notifications
You must be signed in to change notification settings - Fork 0
/
svgo.config.mjs
49 lines (45 loc) · 1.13 KB
/
svgo.config.mjs
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
38
39
40
41
42
43
44
45
46
47
48
49
let prefixCounter = 0
// https://github.com/svg/svgo
export default {
multipass: false, // boolean
// datauri: 'base64', // 'base64'|'enc'|'unenc'
js2svg: {
indent: 4, // number
pretty: false // boolean
},
plugins: [
'preset-default', // built-in plugins enabled by default
'removeTitle',
// 'removeViewBox',
'removeDimensions',
// {
// name: 'convertTransform',
// params: {
// degPrecision: 0,
// floatPrecision: 0,
// transformPrecision: 0
// }
// },
{
name: 'prefixIds',
params: {
delim: '-',
prefix: () => prefixCounter++
}
},
// https://svgo.dev/docs/plugins/convertColors/
{
name: 'convertColors',
params: {
names2hex: true,
rgb2hex: true,
shorthex: true,
shortname: true,
// Convert this color code in fills/strokes to currentColor (used to generate mono-capable assets)
// NOTE: must be exact, case-sensitive match before any other conversions
// Assets must be authored with this in mind
currentColor: '#F0F'
}
}
]
}