How to Recolor SVG Icons for Dark Mode (currentColor)
Why dark mode breaks “normal” SVGs
Most UI icons arrive as:
- Solid
fill="#000"/fill="#333"from icon packs or exports - Multi-color brand marks with several hex stops
- Strokes that stay dark when the background flips
CSS themes usually change color on a button or nav item. Unless the SVG uses currentColor (or CSS variables you control), the glyph ignores the theme.
| Approach | Dark-mode fit | When to use |
|---|---|---|
| Hard-coded hex | Poor | One-off marketing art with fixed brand colors |
CSS fill overrides |
Medium | You own the markup and can target classes |
currentColor |
Excellent | Single-tone UI icons in buttons, tabs, menus |
| Per-color remap | Good | Keep multi-color art but swap light→dark palette |
What SVG Recolor does
Open svgforge.dev/svg-tools/recolor. You can:
- Map colors — detect paints and remap each hex to a new value
- Force solid fill / stroke — one color across fills, strokes, or both
- Export
currentColor— convert paints so the icon inherits CSScolor - Preview live — check the result before copy/download
url(#…) paints and none stay alone; solid fill / stroke / stop-color (including many style= values) can be remapped.
Step 1: Load an icon
- Open the SVG Recolor tool.
- Upload a
.svg, paste markup, or start from a sample. - Prefer icons with a clean
viewBox(library icons from SVGForge sets work well).
Tip: grab a Lucide / Heroicons glyph from the library, copy SVG, then recolor—faster than exporting from a design file when you only need a theme tweak.
Step 2: Choose the right mode for dark mode
A) UI icons → currentColor (recommended)
- Select the currentColor mode (or convert paints to
currentColor). - Preview on a dark surface if the tool offers background swatches—or paste into your app next to dark text.
- Copy the SVG into a component or inline sprite.
In CSS:
.icon-btn {
color: #e5e7eb; /* light glyph on dark chrome */
}
.icon-btn svg {
width: 1.25rem;
height: 1.25rem;
}
Because fills use currentColor, flipping .icon-btn { color: … } (or using a theme token) recolors the glyph with no second asset.
B) Keep multi-color, swap the palette
Brand marks sometimes need two tones in both themes.
- Use per-color mapping.
- Remap light-theme hexes to dark-theme counterparts (e.g.
#111→#F8FAFC, accent stays brand). - Export two files (
icon-light.svg/icon-dark.svg) or one file plus CSS filters only if you accept the tradeoffs.
C) Quick monochrome
Force a solid fill/stroke to a single light gray for dark UI prototypes, then refine to currentColor before ship.
Step 3: Preview, then ship
- Check edges on dark and light backgrounds.
- Copy or Download the recolored SVG.
- Optional: Optimize after recolor if the export still carries editor noise.
- Save keepers into a Collection so the team reuses the dark-ready set.
Practical recipes
Button icons disappear on dark nav
Recolor → currentColor → set color on the button from your theme tokens.
Figma export has five near-black fills
Per-color map every near-black to one light hex, or collapse to currentColor if the icon should be monochrome.
Marketing logo must stay brand-accurate
Don’t force currentColor. Remap only the background-adjacent strokes; keep brand fills fixed and swap assets per theme if needed.
You need React / Vue after recolor
Recolor → Component Converter → paste SFC/JSX. Theme via CSS color on the wrapper.
FAQ
Does currentColor work with strokes?
Yes when stroke paint is converted to currentColor the same way as fill. Mixed icons (fill currentColor + accent stroke) need a deliberate dual-paint strategy.
Will gradients fully recolor?
Solid stop-color values can be remapped. Complex url(#gradient) references stay linked—preview carefully.
Is this private?
Yes. Recoloring runs locally in the browser; SVGForge does not upload the file to process this tool.
Can I recolor icons from the SVGForge library?
Yes. Open a set icon, copy SVG (or edit first), paste into Recolor, export the themed result.
Quick checklist
- Open SVG Recolor
- Paste or upload the icon
- Prefer currentColor for single-tone UI; map hexes for multi-color
- Preview on dark chrome
- Copy / download; optionally optimize or convert to components
Try it now
Open the free SVG Recolor tool, convert a hard-coded icon to currentColor, and drop it into a dark theme button—without uploading anything. Browse open-source icon sets on SVGForge when you need the next glyph.
Recommended
How to Edit Icons with SVG Editor
Customize open-source and local SVG icons in SVGForge’s browser-based SVG Editor—change colors, layers, and size, then export SVG, JSX, PNG, and more.
Read ArticleHow to Keep Icon Bundles Small Without Barrel Imports
Wildcard icon imports can add megabytes to your client JS. Learn safe import patterns, bundler checks, and when a curated SVG collection beats an npm icon pack.
Read ArticleOptimize SVG Assets Before Production: A Practical Checklist
A ship-ready SVG checklist: clean markup, theming with currentColor, strip metadata, choose the right delivery mode, and verify visuals after compression.
Read Article