How to list all available custom icons
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 96
- Avg merge
- 8h 12m
- Merged PRs (30d)
- 2
Description
Usually I fetched the different icons with something like.
var icons = import.meta.glob(`.././assets/*.svg`, { as: "raw", eager: true })
for (const item in icons) {
body.innerHTML = icons[item]
let name = item.formatx(`../assets/$V.svg`)
let color = body.querySelector("#color")?.getAttributeNS(null, "fill") || "black"
let size = undefined // TODO
result.push(await icon(`${name} c-${color}`, body.querySelector("svg") || undefined))
}
But this returns
Is there a better way?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the import.meta.glob custom-SVG example in the issue and inspect the repository's current custom-icon documentation or API entry points; no specific file or test is named. Determine whether the supported way to enumerate available custom icons is documented, then make the expected listing behavior and example explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100