-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve SVG support in Blazor #18271
Comments
SVG support has nicely been working for me until I started experimenting with foreignObject. A possible workaround until "full support" is to render your problematic content as raw html using MarkupString: <svg>
@((MarkupString)$"<foreignObject>Hello, <em>{@name}</em>!</foreignObject>")
</svg>
@code {
private string name = "World";
} Hope it helps prevent a few headaches! |
CultureInfo can interfere with SVG rendering, specifically which decimal separator is used. Probably quite tricky to handle, how to feed SVG properties (or CSS for that matter) with the expected number formatting while retaining Blazor ability to localize content? Important feature for full SVG support. |
Not sure if this has been covered or not, but within .Net 5, using something like |
@Ted-Lapkin it should be something like this I guess (note wrapping quotes):
|
I noticed that referencing a file with the |
Hi, is this supported at the moment? If not, any plans when it will?
|
Thanks for contacting us. |
Looks like LinearGradient isn't support:
Should be: Renders as: With |
I actually would like to pick up my drawing talbet and draw svg directly in visual studio, put that aside, it would be like if we can have a svg animation designer/work flow for stepping up the game of website appearances |
@guardrex - I noticed that you closed this item in ref to 22450. I wanted to make sure that gradient support didn't get lost in that. Do we have that captured somewhere else? |
The PU issue (here) tracks the framework work ... which is done, and the docs issue tracks the doc work, which is still open and hasn't been done. That issue will probably be worked in the RC1 timeframe ... due to churn ... we've been burned a few times trying to doc things too early before the feature settles for release. The docs issue cross-links this, so this won't get lost. |
... but btw if you're referring to this issue being closed before the framework has a gradient feature that you don't think the preview work covers, then you'd need to take that up with the PU here. The docs issue is only that ... for docs. It doesn't track feature work over here. |
The linearGradient svg above works for me in .NET 6 preview 4 when embedded directly in a .razor file. |
Can you see if it works when you ref with |
Treating this as the top-level issue for SVG support in Blazor to track
The text was updated successfully, but these errors were encountered: