jlmakes/rematrix

Rematrix.toString(matrix)

jlmakes opened this issue · 2 comments

import * as Rematrix from 'rematrix';

const r1 = Rematrix.rotate(50);
const r2 = Rematrix.rotate(40);
    
const product = Rematrix.multiply(r1, r2);

Now:

const css = 'transform: matrix3d(' + product.join(', ') + ')';

Proposed:

A:

const css = 'transform: ' + Rematrix.toString(product);

B:

const css = Rematrix.toString(product);

Note: Also here I think toString() should prefix output (e.g. with -webkit-) when necessary.

Re: #1

Considering that global support for unprefixed transform is at 90%, it didn’t seem valuable to bake-in the behavior proposed by solution B. Aside from that, I still think it would've made sense to defer that responsibility to the developer.

Thanks again @davidkpiano @luckydonald

You are awesome!