mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-16 14:18:29 +00:00
feat(metadata): apply tag groups to variant icons (#5038)
* feat(metadata): reusable tag groups with `$group:` A `$group:<group-name>` marker in `tags` is replaced in place with the tags of `groups/<group-name>.json`: a small set of tags for what a variant suffix means, such as `-minus` → remove, delete. - Read groups in `readGroups` and resolve markers next to `$extends:`, failing on unknown groups and on `$group:` outside `tags` - Add `group.schema.json` and lint, spell-check and format `groups/*.json` - `pnpm checkIcons` also fails on literals a group already provides, and warns about icons that list a group's tags by hand and unused groups - Add the `minus`, `plus` and `x` groups and use them in `alarm-clock-minus`, `file-minus`, `file-plus` and `file-x` Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(icons): apply tag groups to variant icons Add 23 groups for common variant suffixes and use them in 89 icons, removing the literal tags a group now provides. No icon loses a resolved tag; 65 icons gain tags from their group. Groups: alert, check, clock, code, cog, currency, dot, heart, key, lock, off, pause, pen, percent, play, question-mark, search, slash, sparkles, star, stop, sync, user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Add favorite * feat(icons): extend base icon metadata in variant icons Use `$extends:<base>` in 703 variant icons whose tags or categories already include every value of their base icon, and remove the 1952 tags and 1058 categories the base now provides. The base is the longest prefix of the icon name that is an icon, e.g. `clipboard-pen-line` extends `clipboard-pen`. - `tags` extend their base in 417 icons, `categories` in 675 - Only applied where the base adds nothing new, so the resolved tags and categories of every icon are unchanged - `contributors` are left as they are Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBLsKpZMoKKKVeibcuRXnC * Apply batched suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Karsa <contact@karsa.org> * Apply feedback * Updated groups * Apply updates * Apply more extends and groups * Stricter checks * Remove more duplicates * Update tags * Apply batched suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix tags * feat(metadata): reusable tag groups with `$group:` A `$group:<group-name>` marker in `tags` is replaced in place with the tags of `groups/<group-name>.json`: a small set of tags for what a variant suffix means, such as `-minus` → remove, delete. - Read groups in `readGroups` and resolve markers next to `$extends:`, failing on unknown groups and on `$group:` outside `tags` - Add `group.schema.json` and lint, spell-check and format `groups/*.json` - `pnpm checkIcons` also fails on literals a group already provides, and warns about icons that list a group's tags by hand and unused groups - Add the `minus`, `plus` and `x` groups and use them in `alarm-clock-minus`, `file-minus`, `file-plus` and `file-x` Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(icons): apply tag groups to variant icons Add 23 groups for common variant suffixes and use them in 89 icons, removing the literal tags a group now provides. No icon loses a resolved tag; 65 icons gain tags from their group. Groups: alert, check, clock, code, cog, currency, dot, heart, key, lock, off, pause, pen, percent, play, question-mark, search, slash, sparkles, star, stop, sync, user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Add favorite * feat(icons): extend base icon metadata in variant icons Use `$extends:<base>` in 703 variant icons whose tags or categories already include every value of their base icon, and remove the 1952 tags and 1058 categories the base now provides. The base is the longest prefix of the icon name that is an icon, e.g. `clipboard-pen-line` extends `clipboard-pen`. - `tags` extend their base in 417 icons, `categories` in 675 - Only applied where the base adds nothing new, so the resolved tags and categories of every icon are unchanged - `contributors` are left as they are Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBLsKpZMoKKKVeibcuRXnC * Apply batched suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Karsa <contact@karsa.org> * Apply feedback * Updated groups * Apply updates * Apply more extends and groups * Stricter checks * Remove more duplicates * Update tags * Apply batched suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fix tags --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Karsa <contact@karsa.org> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
Copilot Autofix powered by AI
Karsa
github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
parent
831740411f
commit
d9d05635ca
@@ -18,11 +18,12 @@ The file name without `.json` is the group name: the variant suffix it belongs t
|
||||
## Rules
|
||||
|
||||
- **One group per variant.** Name the group after the variant suffix (`plus`, `minus`, `check`, `cog`), so `file-plus` uses `$group:plus` and `alarm-clock-minus` uses `$group:minus`.
|
||||
- **Different suffixes with the same meaning share one group.** Do not create a second group for a synonym: `-warning` and `-exclamation-point` use `$group:alert`. When a meaning is spread over many suffixes, name the group after the meaning instead: every currency suffix (`-euro`, `-dollar-sign`, `-japanese-yen`…) uses `$group:currency`.
|
||||
- **Different suffixes with the same meaning share one group.** Do not create a second group for a synonym: `-warning` and `-exclamation-point` use `$group:exclamation-mark`. When a meaning is spread over many suffixes, name the group after the meaning instead: every currency suffix (`-euro`, `-dollar-sign`, `-japanese-yen`…) uses `$group:currency`.
|
||||
- **Tags describe what the variant means, not its glyph.** `plus` holds `add`, `new`, `create`; `cog` holds `settings`, `gear`. Do not put the suffix itself (`plus`, `cog`, `lock`) in a group: tags must not repeat the icon name.
|
||||
- **Keep groups small and generic.** Only tags that hold for *every* icon that uses the group. If a tag is true for just some of them, it belongs on those icons as a literal.
|
||||
- **Not every icon with the suffix uses the group.** `-off` means "disabled" on `wifi-off` but "allergy free" on `wheat-off`, and `-x` means "delete" on `file-x` but "mute" on `volume-x`. Only icons where the variant carries the group's meaning use the marker; the others keep literal tags.
|
||||
- **Do not add a group before it is used.** `pnpm checkIcons` warns about groups no icon references.
|
||||
- **Register the group in the icon schema.** Add `"$group:<group-name>"` to `$defs.groupMarker` in `icon.schema.json`, so editors can autocomplete it; `pnpm checkIcons` fails when the list and `groups/` differ.
|
||||
- **Groups do not nest.** A group's `tags` are literal tags only — no `$extends:` or `$group:` markers.
|
||||
- Tags are lowercase, and follow the same conventions as icon tags.
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ When checking or adding a `$group:` marker:
|
||||
|
||||
- A marker must be exactly `"$group:"` followed by the name of an existing file in `groups/`, without the `.json` extension, in lowercase kebab-case.
|
||||
- `$group:` is allowed **only** inside `tags`. It is not valid in `categories` or `contributors`.
|
||||
- Groups are named after the variant suffix: `file-plus` uses `$group:plus`, `file-question-mark` uses `$group:question-mark`. Suffixes with the same meaning share a group: `mail-warning` uses `$group:alert`, and every currency suffix uses `$group:currency`.
|
||||
- Groups are named after the variant suffix: `file-plus` uses `$group:plus`, `file-question-mark` uses `$group:question-mark`. Suffixes with the same meaning share a group: `mail-warning` uses `$group:exclamation-mark`, and every currency suffix uses `$group:currency`.
|
||||
- The same suffix can mean different things in different contexts — `-off` means "disabled" on `wifi-off` but "allergy free" on `wheat-off` — so only use the group when the icon carries the group's meaning, and keep context-specific tags as literals.
|
||||
- Do not repeat a tag a group already provides, and do not use the same group twice in one array.
|
||||
- Conventional order: the `$extends:` base icon first, then `$group:` markers, then the icon's own literal tags.
|
||||
|
||||
Reference in New Issue
Block a user