Svg linearGradient

Hello there,

I am beginner with Elm (and also with functional languages in general). I am trying to make template for streaming platform Twitch. I want to do it in the purest Elm way, I am using elm/svg for that also with help of developer.mozilla because I never used svg before. I am trying to make linear gradient between 2 colors in circle, so I find the way to do it in normal svg here, but in elm/svg I can’t find any mention about id of svg element and I really can’t find the way how to do it in elm. I tried to make that example in elm/svg here, but with no result because it can’t be linked with each other throught id.
Does someone encounter similar problem or have some elegant solution?

Thank you for your answers :slight_smile: .

1 Like

Your code is actually super close to working, you just need to change one character!

Take a look at the id attribute in your code:

id "#myGradient"

When you write an ID, you shouldn’t include the #. The # is only needed when you reference it somewhere else.

So it should be:

id "myGradient"

Here’s a working Ellie:


Thank you very much. This really didn’t came to my mind. :sweat_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.