Skip to content

v0.5.0 SVG, MathML, and varDefine

Latest
Compare
Choose a tag to compare
@tonioloewald tonioloewald released this 02 Jul 17:49
· 81 commits to main since this release

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, like elements but for SVG name-spaced elements
  • mathML is the same thing for MathML name-spaced elements.
  • varDefault is a proxy like vars but instead of producing a reference string, e.g. "var(--foo-bar)" it produces a function, so varDefault.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.