-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
SVG viewBox broken #24
Comments
Hey @Spioune, can you just use the svg component as string? My pc broke and I cannot fix this issue for you in the next following days... import Html from '@kitajs/html'
function Svg({children}: PropsWithChildren) {
return `<svg class="w-10 h-10" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">${Array.isArray(children) ? Html.contentsToString(children) : children}</svg>`
} |
Hi, Since I have too many SVGs with different attributes (class, viewBox, fill...), creating a component for each of them would be too tedious. Thanks !
I don't know how react does it, maybe they have a hardcoded list of attributes that they don't escape.
|
Turns out the auto camel case feature was slow and only had two default uses, so I just removed this feature at all. It also prevent future problems btw. |
Also added a test for it bebe0e3 |
v2.2.1 |
Using
@kitajs/html
, most of my SVG display incorrectly because of theviewBox
attribute being transformed toview-box
.This route
Returns
view-box
is not recognized by Google chrome or Safari.You can reproduce the behavior by replacing
viewBox
withview-box
on play.tailwindcss.comThe text was updated successfully, but these errors were encountered: