question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update color of SVG?

See original GitHub issue

Is it possible to change the color of an imported svg image based on state updates? This doesn’t work. The style is always primaryBlue even when the active value is true and the textSubdued should be applied.

<Home color={active ? primaryBlue : textSubdued} />;

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
kristerkaricommented, Mar 12, 2020

@Sakarisson this library is using SVGR, so unfortunately we are limited to the replacement API that it offers. That means that currently you can have a fill color and replace it with another color at runtime.

If you have ideas of how to improve it, then I suggest that you open a new issue at SVGR’s repository: https://github.com/gregberge/svgr

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change Color of SVG on Hover - CSS-Tricks
The way that I like to do it: 1. SVG: Make the SVG black #000000 where you want to control the color on...
Read more >
Edit and Change SVG Color Online Free Without any Login
Change SVG Color Online ... DeEditor allows you to make icons from SVG files in a really simple way. Just upload, edit colors...
Read more >
How to change colours of SVG graphics - Creatingo
Simply open SVG file in text/code editor, find cascading styles definition and change color code of required class. The example bellow shows how...
Read more >
How to change SVG color ? - GeeksforGeeks
Example 2: In this example, we will use SVG element to draw a rectangle and color it.
Read more >
How to Change SVG Colors with CSS - YourIllust
How to Change an SVG Color Directly from an SVG file · Then, press command + F for Mac, control + F for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found