
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
css-transform-builder
Advanced tools
import CSSTransformBuilder from "css-transform-builder";
const transform = new CSSTransformBuilder().scale(1, 2);
console.log(transform.toString());
// => "scale(1,2)"
const transform2 = transform.translate(10, 10);
console.log(transform2.toString());
// => "scale(1,2) translate(10px,10px)"
const transform3 = new CSSTransformBuilder().rotate(20).translateY(10, "%");
console.log(transform3.toString());
// => "rotate(20deg) translateY(10%)"
const customFunc: CustomUnit<"vw"> = (n) => `${n * 2}vw`;
const transform4 = new CSSTransformBuilder().translate(10, 10, customFunc);
console.log(transform4.toString());
// => "translate(20vw,20vw)"
const transform5 = new CSSTransformBuilder().translateY("10%");
console.log(transform5.toString());
// => "translateY(10%)"
const transform6 = new CSSTransformBuilder().translateX([["20px", "+", "10px"], "+", ["20px", "+", "10px"]]);
console.log(transform6.toString());
// => "translateX(calc((20px + 10px) + (20px + 10px)))"
import { buildTransform } from "css-transform-builder";
console.log(buildTransform(t => t.scale(1, 2)));
// => "scale(1,2)"
console.log(buildTransform(t => t.scale(1, 2).translate(10, 10)));
// => "scale(1,2) translate(10px,10px)"
console.log(buildTransform(t => t.rotate(20).translateY(10, "%")));
// => "rotate(20deg) translateY(10%)"
const customFunc: CustomUnit<"px"> = (n) => `${n * 2}px`;
console.log(buildTransform(t => t.translate(10, 10, customFunc)));
// => "translate(20px,20px)"
console.log(buildTransform(t => t.translateY("10%")));
// => "translateY(10%)"
console.log(buildTransform(t => t.translateX([["20px", "+", "10px"], "+", ["20px", "+", "10px"]])));
// => "translateX(calc((20px + 10px) + (20px + 10px)))"
FAQs
make css transform format string.
The npm package css-transform-builder receives a total of 48 weekly downloads. As such, css-transform-builder popularity was classified as not popular.
We found that css-transform-builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.