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.

Unable to set color

See original GitHub issue

Hello,

I’m unable to set the color from a parent container in html.

<svg style="width:64px; height:64px; fill:red;" height="21" viewBox="0 0 21 21" width="21" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" stroke="#2a2e3b" stroke-linecap="round" stroke-linejoin="round" transform="translate(2 3)"><path d="m1.5 4.5h14v7.9976807c0 1.1045695-.8954305 2-2 2h-10c-1.1045695 0-2-.8954305-2-2zm0-3.9777832h14c.5522847 0 1 .44771525 1 1v1.9777832c0 .55228475-.4477153 1-1 1h-14c-.55228475 0-1-.44771525-1-1v-1.9777832c0-.55228475.44771525-1 1-1z"></path><path d="m6.5 7.5h4"></path></g></svg>

results in grafik

As I’m building a utility which inserts svg icons directly from markup (e.g. <x-systemuicon-archive style="width:64px; height:64px; fill:red;" /> results in the code above. Is there any possibility to make this work with classes without modifying the svg files?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
eden-lanecommented, Jan 17, 2021

@Wulfheart You can change stroke of a svg file to currentColor. After that you can change parent’s color to change svg color. Wouldn’t it be a good idea to use currentColor for every icon instead of constant for easier customisation? @CoreyGinnivan what do you think?

0reactions
CoreyGinnivancommented, Mar 31, 2021

Yep! All fixed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to set background color with Absolute and Fixed ...
I'm unable to set background color when i use position to my signin div and bottom div.I tried to remove position but it...
Read more >
Can't Change Taskbar Color in Windows 11/10
Go to settings and click on Ease to Access · From the list of options under 'Vision,' click on Color filters. · In...
Read more >
Can't Change Text Color (SOLVED!) | Photoshop - YouTube
Photoshop: Create a Powerful, Dramatic, Deep, Overlapping Text Effect with Reflection · Top 5 Excel Functions for Finance People (with end-to-end ...
Read more >
Change the default text color (font color) in Word
Select the arrow next to Font color, and then choose a color. Font color in font dialog. Select Set As Default and then...
Read more >
Possible bug: Can't change colors - Photoshop 2020
You are in grayscale color mode. Go to Image/Mode and change to RGB or CMYK.
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