postcss-reduce-transforms
Advanced tools
Comparing version 5.0.4 to 5.1.0
{ | ||
"name": "postcss-reduce-transforms", | ||
"version": "5.0.4", | ||
"version": "5.1.0", | ||
"description": "Reduce transform functions with PostCSS.", | ||
"main": "src/index.js", | ||
"types": "types/index.d.ts", | ||
"files": [ | ||
"LICENSE-MIT", | ||
"src" | ||
"src", | ||
"types" | ||
], | ||
@@ -33,3 +35,3 @@ "license": "MIT", | ||
}, | ||
"readme": "# [postcss][postcss]-reduce-transforms\n\n> Reduce transform functions with PostCSS.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-reduce-transforms) do:\n\n```\nnpm install postcss-reduce-transforms --save\n```\n\n## Example\n\nThis module will reduce transform functions where possible. For more examples,\nsee the [tests](src/__tests__/index.js).\n\n### Input\n\n```css\nh1 {\n transform: rotate3d(0, 0, 1, 20deg);\n}\n```\n\n### Output\n\n```css\nh1 {\n transform: rotate(20deg);\n}\n```\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n[postcss]: https://github.com/postcss/postcss\n" | ||
"readme": "# [postcss][postcss]-reduce-transforms\n\n> Reduce transform functions with PostCSS.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-reduce-transforms) do:\n\n```\nnpm install postcss-reduce-transforms --save\n```\n\n## Example\n\nThis module will reduce transform functions where possible. For more examples,\nsee the [tests](src/__tests__/index.js).\n\n### Input\n\n```css\nh1 {\n transform: rotate3d(0, 0, 1, 20deg);\n}\n```\n\n### Output\n\n```css\nh1 {\n transform: rotate(20deg);\n}\n```\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n[postcss]: https://github.com/postcss/postcss\n" | ||
} |
@@ -22,3 +22,3 @@ # [postcss][postcss]-reduce-transforms | ||
h1 { | ||
transform: rotate3d(0, 0, 1, 20deg); | ||
transform: rotate3d(0, 0, 1, 20deg); | ||
} | ||
@@ -31,3 +31,3 @@ ``` | ||
h1 { | ||
transform: rotate(20deg); | ||
transform: rotate(20deg); | ||
} | ||
@@ -34,0 +34,0 @@ ``` |
'use strict'; | ||
const valueParser = require('postcss-value-parser'); | ||
/** | ||
* @param {(number|string)[]} list | ||
* @param {valueParser.Node} node | ||
* @param {number} index | ||
* @return {(number|string)[]} | ||
*/ | ||
function getValues(list, node, index) { | ||
if (index % 2 === 0) { | ||
/** @type {number|string} */ | ||
let value = NaN; | ||
@@ -24,2 +31,7 @@ | ||
/** | ||
* @param {valueParser.FunctionNode} node | ||
* @param {(number|string)[]} values | ||
* @return {void} | ||
*/ | ||
function matrix3d(node, values) { | ||
@@ -69,2 +81,7 @@ if (values.length !== 16) { | ||
/** | ||
* @param {valueParser.FunctionNode} node | ||
* @param {(number|string)[]} values | ||
* @return {void} | ||
*/ | ||
function rotate3d(node, values) { | ||
@@ -84,2 +101,7 @@ if (values.length !== 4) { | ||
/** | ||
* @param {valueParser.FunctionNode} node | ||
* @param {(number|string)[]} values | ||
* @return {void} | ||
*/ | ||
function rotateZ(node, values) { | ||
@@ -94,2 +116,7 @@ if (values.length !== 1) { | ||
/** | ||
* @param {valueParser.FunctionNode} node | ||
* @param {(number|string)[]} values | ||
* @return {void} | ||
*/ | ||
function scale(node, values) { | ||
@@ -127,2 +154,7 @@ if (values.length !== 2) { | ||
/** | ||
* @param {valueParser.FunctionNode} node | ||
* @param {(number|string)[]} values | ||
* @return {void} | ||
*/ | ||
function scale3d(node, values) { | ||
@@ -161,2 +193,7 @@ if (values.length !== 3) { | ||
/** | ||
* @param {valueParser.FunctionNode} node | ||
* @param {(number|string)[]} values | ||
* @return {void} | ||
*/ | ||
function translate(node, values) { | ||
@@ -185,2 +222,7 @@ if (values.length !== 2) { | ||
/** | ||
* @param {valueParser.FunctionNode} node | ||
* @param {(number|string)[]} values | ||
* @return {void} | ||
*/ | ||
function translate3d(node, values) { | ||
@@ -209,3 +251,6 @@ if (values.length !== 3) { | ||
]); | ||
/** | ||
* @param {string} name | ||
* @return {string} | ||
*/ | ||
function normalizeReducerName(name) { | ||
@@ -221,2 +266,6 @@ const lowerCasedName = name.toLowerCase(); | ||
/** | ||
* @param {valueParser.Node} node | ||
* @return {false} | ||
*/ | ||
function reduce(node) { | ||
@@ -233,2 +282,6 @@ if (node.type === 'function') { | ||
/** | ||
* @type {import('postcss').PluginCreator<void>} | ||
* @return {import('postcss').Plugin} | ||
*/ | ||
function pluginCreator() { | ||
@@ -235,0 +288,0 @@ return { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9868
5
269
0