Skip to content

Commit 3c876e9

Browse files
committed
Optimize SVG settings for accessibility and animations
1 parent 3af8f15 commit 3c876e9

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

index.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,34 @@ let { abort } = require("faucet-pipeline-core/lib/util");
88
// we can optimize the settings here, but some would require libvips
99
// to be compiled with additional stuff
1010
let settings = {
11-
svg: {},
11+
svg: {
12+
plugins: svgo.extendDefaultPlugins([
13+
// do not remove title and desc for accessibility reasons
14+
{
15+
name: "removeTitle",
16+
active: false
17+
},
18+
{
19+
name: "removeDesc",
20+
active: false
21+
},
22+
23+
// configurations recommended by Cassie Evans to reduce problems
24+
// when you want to style or animate your SVGs
25+
{
26+
name: "cleanupIDs",
27+
active: false
28+
},
29+
{
30+
name: "mergePaths",
31+
active: false
32+
},
33+
{
34+
name: "collapseGroups",
35+
active: false
36+
}
37+
])
38+
},
1239
png: { adaptiveFiltering: true },
1340
jpeg: { progressive: true },
1441
webp: {},

0 commit comments

Comments
 (0)