Skip to content

feat(mail): Generate email icons dynamically from any Lucide icon - #35

Merged
AlexDeveloperUwU merged 3 commits into
v2from
claude/dynamic-email-icons-7nihuh
Nov 2, 2026
Merged

AlexDeveloperUwU merged 3 commits into
v2from
claude/dynamic-email-icons-7nihuh

Conversation

@AlexDeveloperUwU

Copy link
Copy Markdown
Owner

Summary

  • ensureIcon(name, color) resolves the icon straight from lucide-static by name, so new templates can use any Lucide titleIcon/infoIcon with no registration step; the hardcoded ICONS map is removed.
  • Color comes from the template's accent (default #2159a3), so existing emails keep their colors. It's part of the cached filename (<icon>-<hex>.png), so the same icon in different colors doesn't collide.
  • Unknown icon names throw a descriptive error (Unknown Lucide icon "x"...) instead of a destructuring crash. Names and colors are validated (kebab-case / hex), which also blocks path traversal and SVG injection.
  • npm run email:icons now clears the icon cache and rebuilds the brand icon (icons regenerate lazily).
  • Version bumped to 2.12.1 with changelog entry.

Test plan

  • circle-check in two colors produces two distinct PNGs; an unregistered icon (rocket) generates fine
  • Unknown name, ../x, and non-hex color each throw a clear error
  • node emails/generate-icons.mjs runs cleanly

Generated by Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016GiW7iaZejGqmwEXmq9wvF
@AlexDeveloperUwU
AlexDeveloperUwU marked this pull request as ready for review November 2, 2026 11:47
@AlexDeveloperUwU
AlexDeveloperUwU merged commit e47293e into v2 Nov 2, 2026
2 checks passed
@AlexDeveloperUwU
AlexDeveloperUwU deleted the claude/dynamic-email-icons-7nihuh branch November 2, 2026 11:49
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.

2 participants