matrixToCss
Writes a matrix as a CSS transform or SVG transform value.
Entries are written as JavaScript prints them, without rounding; non-finite entries give a value CSS rejects.
Available since v3.1.5
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
m | Matrix | The matrix |
Returns
Section titled “Returns”string — matrix(a, b, c, d, e, f)
Examples
Section titled “Examples”Write a CSS transform
Section titled “Write a CSS transform”The six entries in CSS and SVG order.
Fit a frame into a viewport
Section titled “Fit a frame into a viewport”Combine with fitContain to scale an element with CSS.
Related Types
Section titled “Related Types”Matrix
Section titled “Matrix”A 2D affine transformation, in the layout of CSS and SVG matrix(a, b, c, d, e, f):
