const translate = new CSSTranslate(CSS.px(10), CSS.px(20));
const matrix = translate.toMatrix();
console.log(matrix.e, matrix.f); // 10 20CSSTransformComponent: toMatrix() method / notebook
CSSTransformComponent: toMatrix() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const translate = new CSSTranslate(CSS.percent(50), CSS.px(20));
try {
translate.toMatrix();
} catch (e) {
console.log(e); // TypeError
}