Skip to content

fix: resolve Phosphor icons with comma-separated IcoMoon aliases#2

Open
NicolasDrapier wants to merge 1 commit intoFerrisMind:mainfrom
NicolasDrapier:fix/phosphor-icomoon-alias-names
Open

fix: resolve Phosphor icons with comma-separated IcoMoon aliases#2
NicolasDrapier wants to merge 1 commit intoFerrisMind:mainfrom
NicolasDrapier:fix/phosphor-icomoon-alias-names

Conversation

@NicolasDrapier
Copy link
Copy Markdown

Summary

  • ~104 Phosphor icon names are mangled due to IcoMoon alias concatenation in load_icomoon_selection()
  • Icons like folder-open are registered as folder-open-folder-notch-open and cannot be resolved by their canonical name

Root cause

The Phosphor icon pack uses IcoMoon selection.json files where icons with aliases store multiple names comma-separated:

"name": "folder-open, folder-notch-open"

load_icomoon_selection() passes this raw value to normalize_kebab(), which replaces the , with -, producing folder-open-folder-notch-open.

Fix

Split on comma and take the primary name before normalizing (scripts/map_gen.py):

name = name.split(",")[0].strip()

Affected icons (18 base icons × 6 style variants)

Expected Was registered as
folder-open folder-open-folder-notch-open
folder-plus folder-plus-folder-notch-plus
folder-minus folder-minus-folder-notch-minus
file-dashed file-dashed-file-dotted
file-magnifying-glass file-magnifying-glass-file-search
pulse pulse-activity
infinity infinity-lemniscate
seal-check seal-check-circle-wavy-check
... and 10 more

The IcoMoon selection.json files used by Phosphor store aliases as
comma-separated names (e.g., "folder-open, folder-notch-open").
load_icomoon_selection() passed the raw name to normalize_kebab(),
which replaced the comma+space with a hyphen, producing mangled names
like "folder-open-folder-notch-open" instead of "folder-open".

Split on comma and take only the primary name before normalizing.
Fixes 18 base icons across 6 style variants (~104 entries).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant