-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
case-sensitivity of SVG viewBox likely to cause silent errors #1062
Labels
Comments
Rich-Harris
added a commit
that referenced
this issue
Jan 11, 2018
Yep, exactly — have raised #1095 to that end |
Rich-Harris
added a commit
that referenced
this issue
Jan 11, 2018
be more relaxed about attribute casing
This is fixed in 1.52, thanks |
Conduitry
added a commit
that referenced
this issue
Jan 24, 2018
Rich-Harris
added a commit
that referenced
this issue
Jan 26, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In most 'try online' tools, the SVG
viewBox
attribute is handled the same whether properly camel-cased or not (viewbox
). Svelte only recognizesviewBox
. This can make it difficult for developers new to SVG - especially when they are starting with random sample code from blogs/tutorials - as improper use simply doesn't show up. Either an compile-time warning or acceptance of both variants would be helpful.Example:
When I try to render
<svg viewbox="-250 -250 500 500">
with the Svelte, my image is cutoff. Whereas on W3Schools or CodePen, it renders fine, indicating thatwidth
andheight
aren't inherently mandatory. I had the same results testing locally and with REPL.When I try
<svg width=500 height=500 viewbox="-250 -250 500 500">
it will adjust the size correctly, but doesn't respect the viewbox.Since I started with pasting a blog example, I mistakenly thought svelte couldn't handle viewbox.
The text was updated successfully, but these errors were encountered: