build(icons): generate toolbar/add-on PNGs from SVG with transparent background; configurable colors; stop tracking PNGs and ignore outputs

This commit is contained in:
Jordan Wages 2025-08-23 23:51:22 -05:00
commit 73544334c9
11 changed files with 111 additions and 17 deletions

View file

@ -1,7 +1,8 @@
Icon assets
===========
Place the final PNGs for the add-on icon here. The manifest is wired to use:
PNG icons are generated from `file-search.svg` during the build.
Run `npm run build` (or `npm run build:icons`) to regenerate. The manifest is wired to use:
- Toolbar (browser_action → default_icon):
- icons/icon-16.png
@ -13,17 +14,10 @@ Place the final PNGs for the add-on icon here. The manifest is wired to use:
Notes
-----
- Use the same artwork at each size; keep transparent backgrounds.
- Source: a 128×128 PNG is perfect; export downscaled versions for 96/48/32/16.
- Source: `icons/file-search.svg` uses `stroke="currentColor"`.
- The build script replaces `currentColor` with configured colors and rasterizes with a transparent background.
- Customize colors via env vars:
- `ICON_COLOR_ADDON` (48/96/128); default `#111827`.
- `ICON_COLOR_TOOLBAR` (16/32); default `#111827`.
- Firefox does not require .ico; PNG is recommended.
- If you later want theme-specific toolbar icons, you can add `browser_action.theme_icons` with light/dark variants.
Quick export (ImageMagick)
-------------------------
```bash
magick file-search.svg -resize 128x128 icon-128.png
magick file-search.svg -resize 96x96 icon-96.png
magick file-search.svg -resize 48x48 icon-48.png
magick file-search.svg -resize 32x32 icon-32.png
magick file-search.svg -resize 16x16 icon-16.png
```
- Theme variants can be added later via `browser_action.theme_icons`.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B