Repository navigation
3.1.3
What changed
Changed
- Added the
CSSMatrix.versionstatic property, which exposes the library version (e.g."3.1.3"). The value is read frompackage.jsonat build time and inlined in the bundles, so it adds no runtime dependency and no file read. - The GitHub Actions workflows now run on the Vite+ toolchain.
ci.yml,publish.ymlandcodeql.ymluse thevoidzero-dev/setup-vpaction (pinned to the exact release that ships with the pinned Vite+ version) instead of the separate pnpm / Node.js setup steps, and run the project scripts throughvpr(vpr lint,vpr build,vpr test). The release workflow publishes to npm withvp pm publish(keeping the provenance attestation) and to JSR withdeno publish --allow-dirty.
Fixed
CSSMatrix.fromString()(and thenew CSSMatrix(string)constructor) no longer throwsCSSMatrix: invalid transform stringwhen a transform function argument is0. The parser checked the arguments for truthiness instead of testing them for being a number, so every valid zero value was rejected:translate(0px, 20px),translateX(0px),scaleX(0),rotate(0deg),rotateX(0deg),rotate3d(0, 0, 1, 0deg),skew(0deg),skewX(0deg),perspective(0px), ... All of them now produce the same matrix as the nativeDOMMatrix.- The CSS angle units are now parsed exactly:
gradwas matched by theradcheck ("grad".includes("rad")) and turned into radians, andturnwas not converted at all —rotate(100grad)was parsed as 100rad androtate(0.25turn)as 0.25deg. Both now convert to the correct degrees (1grad=0.9deg,1turn=360deg), sorotate(100grad)androtate(0.25turn)both yield the 90deg rotation. The units are case-insensitive, as in CSS (rotate(10RAD)). - The no-op transforms
scale(1, 1)andscale3d(1, 1, 1)were rejected as invalid strings; they now return the identity matrix, like the nativeDOMMatrix. - Transform arguments that are not numbers (
translate(10px, wombat),scale(2, wombat),skew(10deg, wombat)) are now rejected with the invalid transform string error instead of being silently parsed as0. perspective()now matches the nativeDOMMatrix: negative lengths are rejected and the perspective length is clamped to a minimum of1px(perspective(0px)givesm34of-1).
Dependencies
- Bump
vitestand@vitest/*from^4.1.11to^5.1.0,tsdownfrom^0.22.14to^0.23.7,playwrightfrom^1.62.1to^1.65.1and@types/nodefrom^26.4.1to^26.6.6(withpnpm-lock.yamlanddeno.lockrefreshed, andpnpm-workspace.yamlextended with theminimumReleaseAgeExcludeentries forplaywright@1.65.1/playwright-core@1.65.1).
Full Changelog: 3.1.2...3.1.3