UNPKG

@tbela99/css-parser

Version:

CSS parser, minifier and validator for node and the browser

24 lines (21 loc) 566 B
import { multiply, identity } from './utils.js'; function skewX(x, from) { const matrix = identity(); matrix[4] = Math.tan(x); return multiply(from, matrix); } function skewY(y, from) { const matrix = identity(); matrix[1] = Math.tan(y); return multiply(from, matrix); } // convert angle to radian function skew(values, from) { const matrix = identity(); matrix[4] = Math.tan(values[0]); if (values.length > 1) { matrix[1] = Math.tan(values[1]); } return multiply(from, matrix); } export { skew, skewX, skewY };