Support multi-icon symbols
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
Motivation
I want to show a complex set of icons: ~100 basetypes with ~30 modifiers. There is no way to predefine ~3000 icons in the PNG sprite and then just pick the right one. I want to define ~130 and combine them freely. That already works by using two independent layers, but then "basetypes" and "modifiers" are on different z-indices so they interfere with each other.
Design Alternatives
Design 1: make "icon-image" accept an array (has to be implemented on other "icon-" options like "icon-offset" as well)
...
"icon-image": ["{basetype}", "{modifier}"]
...
Design 1a : don´t use an array on every single property but shift it up the to the "paint" and "layout" property.
Design 2: allow the definition of combined icons in the sprite JSON
...
"basetype":{"x":0,"y":0,"width":20,"height":40,"pixelRatio":1},
"modifier":{"x":20,"y":0,"width":20,"height":20,"pixelRatio":1},
"combined":{"icons":["basetype","modifier"], "offset":[[0,0],[0,20]]}
...
Design
Advantages Design 1: dynamic styling
Drawbacks Design 1: complex due to multiplication of icon-properties by number of icons
Advantages Design 2: combined icons would show up like normal icons in the stylesheet
Drawbacks Design 2: need for hard coded combined icons
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
The issue names no source files, tests, or entry points, so there is no direct code starting point. First resolve whether Design 1 or Design 2 is intended and define the behavior of combined icon properties; completion criteria are not specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100