css-transform-builder
class base
import CSSTransformBuilder from "css-transform-builder";
const transform = new CSSTransformBuilder().scale(1, 2);
console.log(transform.toString());
const transform2 = transform.translate(10, 10);
console.log(transform2.toString());
const transform3 = new CSSTransformBuilder().rotate(20).translateY(10, "%");
console.log(transform3.toString());
functional
import { buildTransform } from "css-transform-builder";
console.log(buildTransform(t => t.scale(1, 2)));
console.log(buildTransform(t => t.scale(1, 2).translate(10, 10)));
const transform3 = new CSSTransformBuilder();
console.log(buildTransform(t => t.rotate(20).translateY(10, "%")));