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 CSS color
  • 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

  1. Open the SVG Recolor tool.
  2. Upload a .svg, paste markup, or start from a sample.
  3. 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)

  1. Select the currentColor mode (or convert paints to currentColor).
  2. Preview on a dark surface if the tool offers background swatches—or paste into your app next to dark text.
  3. Copy the SVG into a component or inline sprite.

In CSS:

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.

  1. Use per-color mapping.
  2. Remap light-theme hexes to dark-theme counterparts (e.g. #111 → #F8FAFC, accent stays brand).
  3. 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

  1. Check edges on dark and light backgrounds.
  2. Copy or Download the recolored SVG.
  3. Optional: Optimize after recolor if the export still carries editor noise.
  4. 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

  1. Open SVG Recolor
  2. Paste or upload the icon
  3. Prefer currentColor for single-tone UI; map hexes for multi-color
  4. Preview on dark chrome
  5. 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.

svg-editor 6 min read

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 Article