xinjs 0.5.0 adds support for SVG, MathML, and syntax-sugar for css-variables with fallback values
After working with SVGs a lot to get the xinjs-timezone-picker
working, I decided to add full support for SVG and MathML to xinjs
svgElements
is a proxy, likeelements
but for SVG name-spaced elementsmathML
is the same thing for MathML name-spaced elements.varDefault
is a proxy likevars
but instead of producing a reference string, e.g. "var(--foo-bar)" it produces a function, sovarDefault.fooBar('30px')
produces "var(--foo-bar, 30px)"
I'd also mention that the polygons
module from yesterday is also out as xinjs-polygons
, here's the polygons demo—btw 583b—and yeah, if it looks a lot like the <timezone-picker>
demo, that's because I'm working on a nice template for all these libraries.
Aside—I also fixed/improved the code which generates the tagName for custom-elements if the class code has been mangled to the point of anonymity (thanks uglify) and the coder hasn't explicitly specified a tagName. This code got sufficiently smaller than xinjs is actually smaller now than before this last set of features was added.