79764674

Date: 2025-09-15 01:45:46
Score: 0.5
Natty:
Report link

If you want to easily tint SVG/PNG/JPG icons with Tailwind, I built a small plugin that leverages CSS filter to approximate colors: tailwind-tint-color.

Usage

<!-- Palette color -->
<img src="/icons/heart.svg" class="tint-red-500" alt="red icon" />

<!-- Arbitrary colors -->
<img src="/icons/heart.svg" class="tint-[#ff6b6b]" alt="custom tint" />
<img src="/icons/heart.png" class="tint-[rgb(34,197,94)]" alt="rgb tint" />

The plugin generates the proper invert/sepia/saturate/hue-rotate/brightness/contrast chain so the icon matches the target color. It works across SVG, PNG, and JPG.

enter image description here

👉 npm package: tailwind-tint-color

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: myquertykeyboard