Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
blob: e7f5c5509cb9922f5cfd059ab0660fac90ed98e2 (plain)
1
2
3
4
5
6
7
8
const digits = /-?\d+\.?\d*/g;

export default function getComputedTransformMatrix(el) {
  const matrixSequence = getComputedStyle(el).transform.match(digits),
    identityMatrix = '';

  return new DOMMatrix(matrixSequence || identityMatrix);
}