You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set width and height attributes on the SVG Can also be set using height and/or width attributes, which take precedence over size Supplied as "{Width} * {Height}" or "{Number}", so "30px*45px" becomes width="30px" and height="45px", and "50%" becomes width="50%" and height="50%"
title
add a <title> node inside the top level of the SVG document
desc
add a <desc> node inside the top level of the SVG document
nocomment
remove comment tags from the SVG document
preserve_aspect_ratio
adds a preserveAspectRatio attribute to the SVG
aria
adds common accessibility attributes to the SVG (see PR #34 for details)
aria_hidden
adds the aria-hidden=true attribute to the SVG
fallback
set fallback SVG document
I think a great many of these would benefit from a change in API that allowed for arbitrary HTML attrs.
Thanks for the suggestion. Definitely not against this idea in principle but would only be possible if somebody from the community were prepared to work on this.
Obviously this kind of API change would require a major version bump. Version 2.0 is around the corner, so if anybody wants this to happen soon, and can spare the time to work on it, please let me know.
To aid with tooling like AlpineJS the following would be nice:
Ideally any HTML attribute ought to be supported.
Let's look at the options table:
id
class
style
data
size
Can also be set using
height
and/orwidth
attributes, which take precedence oversize
Supplied as "{Width} * {Height}" or "{Number}", so "30px*45px" becomes
width="30px"
andheight="45px"
, and "50%" becomeswidth="50%"
andheight="50%"
title
desc
nocomment
preserve_aspect_ratio
preserveAspectRatio
attribute to the SVGaria
aria_hidden
aria-hidden=true
attribute to the SVGfallback
I think a great many of these would benefit from a change in API that allowed for arbitrary HTML attrs.
Hypothetical future API:
The text was updated successfully, but these errors were encountered: