SVG elements and attributes
costructuralist opened this issue · 3 comments
Being able to work with SVG elements would be great; would adding support amount to adding the relevant SVG elements and attributes to src/Hedwig/Element.purs
and src/Hedwig/Property.purs
respectively? (Having the SVG entities in separate modules would probably make more sense though.)
If that's the case, I can create a pull request to that effect.
Hey, adding SVG specific stuff to a new Hedwig.Svg
module sounds good. Those files are generated by a Ruby script so you'll need to copy some blocks of code and modify the element and attribute names. If you don't know Ruby, if you could just compile 4 lists and paste them here, I'd be happy to do the rest:
- Element names
- Boolean attributes.
- Int attributes
- String attributes
Cool! The lists are on pastebin, since they are actually quite long:
Elements:
https://pastebin.com/3je1G0xf
Boolean attributes:
https://pastebin.com/JeS2h746
Int attributes:
https://pastebin.com/cNfUmbYH
Number attributes:
https://pastebin.com/gpEFxnYJ
String attributes:
https://pastebin.com/2UxrUcdA
The datatypes don't always fit exactly, e.g. some attributes mix strings and numbers. In those cases the type defaults to String.
Thanks! Some of the attributes in the Number list actually accept more units than plain numbers (some accept percentage, some any length (px, em, %, etc)). I checked them all on MDN moved some of them to the String list. I've pushed a commit with all these added. Thanks again!