Skip to content

Commit b5bd858

Browse files
author
Eduardo García Maleta
committed
Add aria-label attr
1 parent 3cbe140 commit b5bd858

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/generate-icons.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
const fs = require('fs');
22
const feather = require('feather-icons');
33

4+
const capitalize = (name) => {
5+
const first = name.at(0);
6+
return first != undefined ? name.replace(first, first.toUpperCase()) : name;
7+
};
8+
49
const iconTemplate = icon =>
510
`// THIS FILE WAS GENERATED
611
import { component$, useContext } from "@builder.io/qwik";
@@ -22,6 +27,7 @@ export default component$((props: IconProps) => {
2227
stroke-linecap={props.strokeLineCap ?? fallbackProps.strokeLineCap}
2328
stroke-linejoin={props.strokeLineJoin ?? fallbackProps.strokeLineJoin}
2429
class={\`${icon.attrs.class} \${props.class ?? fallbackProps.class}\`}
30+
aria-label="${[...icon.name.split("-").map(s => capitalize(s))].join(" ")} Icon"
2531
>${icon.contents}</svg>
2632
);
2733
});

0 commit comments

Comments
 (0)