diff options
| author | ruki <waruqi@gmail.com> | 2018-11-08 00:43:05 +0800 |
|---|---|---|
| committer | ruki <waruqi@gmail.com> | 2018-11-07 22:18:30 +0800 |
| commit | 89e95b3f143682ed9a006991bacf45c9dcba4818 (patch) | |
| tree | 4f44cf41b828577d583890bdd5a1c31e8491a6ba /node_modules/postcss-minify-params | |
| parent | aa7f0199255277949790b41c56e8ec97dd4f0da4 (diff) | |
| download | xmake-docs-vuepress.tar.gz xmake-docs-vuepress.zip | |
remove node_modulesvuepress
Diffstat (limited to 'node_modules/postcss-minify-params')
| -rw-r--r-- | node_modules/postcss-minify-params/CHANGELOG.md | 27 | ||||
| -rw-r--r-- | node_modules/postcss-minify-params/LICENSE | 20 | ||||
| -rw-r--r-- | node_modules/postcss-minify-params/README.md | 33 | ||||
| -rw-r--r-- | node_modules/postcss-minify-params/dist/index.js | 106 | ||||
| -rw-r--r-- | node_modules/postcss-minify-params/package.json | 55 |
5 files changed, 0 insertions, 241 deletions
diff --git a/node_modules/postcss-minify-params/CHANGELOG.md b/node_modules/postcss-minify-params/CHANGELOG.md deleted file mode 100644 index 7c312dfa..00000000 --- a/node_modules/postcss-minify-params/CHANGELOG.md +++ /dev/null @@ -1,27 +0,0 @@ -# 1.2.2 - -* Resolves an issue where `all and` would be removed from - `@media not all and (conditions) {}`, causing an invalid media query to - be output. - -# 1.2.1 - -* Resolves an issue where `1.2.0` would throw on empty function parentheses. - -# 1.2.0 - -* Adds support for simplifying `min-aspect-ratio` and `max-aspect-ratio`. For - example, `@media (min-aspect-ratio: 1280/720) {}` can be minified to - `@media (min-aspect-ratio:16/9){}`. - -# 1.1.0 - -* Adds support for removing the unnecessary `all and` from media queries. - -# 1.0.1 - -* Refactor to ES6. - -# 1.0.0 - -* Initial release. diff --git a/node_modules/postcss-minify-params/LICENSE b/node_modules/postcss-minify-params/LICENSE deleted file mode 100644 index 066ee676..00000000 --- a/node_modules/postcss-minify-params/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright 2015 Bogdan Chadkin <trysound@yandex.ru> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/postcss-minify-params/README.md b/node_modules/postcss-minify-params/README.md deleted file mode 100644 index 23c0968d..00000000 --- a/node_modules/postcss-minify-params/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# postcss-minify-params [![Build Status][ci-img]][ci] - -> Minify at-rule params with PostCSS. - -```css -@media only screen and ( min-width: 400px, min-height: 500px ) { - h2{ - color:blue - } -} -``` - -```css -@media only screen and (min-width:400px,min-height:500px) { - h2{ - color:blue - } -} -``` - -## Usage - -```js -postcss([ require('postcss-minify-params') ]) -``` - -See [PostCSS] docs for examples for your environment. - -MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru) - -[PostCSS]: https://github.com/postcss/postcss -[ci-img]: https://travis-ci.org/ben-eb/postcss-minify-params.svg -[ci]: https://travis-ci.org/ben-eb/postcss-minify-params diff --git a/node_modules/postcss-minify-params/dist/index.js b/node_modules/postcss-minify-params/dist/index.js deleted file mode 100644 index ce373e9f..00000000 --- a/node_modules/postcss-minify-params/dist/index.js +++ /dev/null @@ -1,106 +0,0 @@ -var postcss = require('postcss'); -var valueParser = require('postcss-value-parser'); -var stringify = valueParser.stringify; -var sort = require('alphanum-sort'); -var uniqs = require('uniqs'); - -/** - * Return the greatest common divisor - * of two numbers. - */ - -function gcd(a, b) { - return b ? gcd(b, a % b) : a; -} - -function aspectRatio(a, b) { - var divisor = gcd(a, b); - - return [a / divisor, b / divisor]; -} - -function split(nodes, div) { - var result = []; - var i, max, node; - var last = ''; - - for (i = 0, max = nodes.length; i < max; i += 1) { - node = nodes[i]; - if (node.type === 'div' && node.value === div) { - result.push(last); - last = ''; - } else { - last += stringify(node); - } - } - - result.push(last); - - return result; -} - -function removeNode(node) { - node.value = ''; - node.type = 'word'; -} - -module.exports = postcss.plugin('postcss-minify-params', function () { - return function (css) { - css.walkAtRules(function (rule) { - if (!rule.params) { - return; - } - - var params = valueParser(rule.params); - - params.walk(function (node, index) { - if (node.type === 'div' || node.type === 'function') { - node.before = node.after = ''; - if ( - node.type === 'function' && - node.nodes[4] && - node.nodes[0].value.indexOf('-aspect-ratio') === 3 - ) { - var ref = aspectRatio( - node.nodes[2].value, - node.nodes[4].value - ); - var a = ref[0]; - var b = ref[1]; - node.nodes[2].value = a; - node.nodes[4].value = b; - } - } else if (node.type === 'space') { - node.value = ' '; - } else if (node.type === 'word') { - var prevWord = params.nodes[index - 2]; - if ( - node.value === 'all' && - rule.name === 'media' && - !prevWord - ) { - var nextSpace = params.nodes[index + 1]; - var nextWord = params.nodes[index + 2]; - var secondSpace = params.nodes[index + 3]; - if (nextWord && nextWord.value === 'and') { - removeNode(nextWord); - removeNode(nextSpace); - if (secondSpace) { - removeNode(secondSpace); - } - } - removeNode(node); - } - } - }, true); - - rule.params = sort(uniqs(split(params.nodes, ',')), { - insensitive: true - }).join(); - - if (!rule.params.length) { - rule.raws.afterName = ''; - } - }); - }; -}); diff --git a/node_modules/postcss-minify-params/package.json b/node_modules/postcss-minify-params/package.json deleted file mode 100644 index 2635f1bb..00000000 --- a/node_modules/postcss-minify-params/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "postcss-minify-params", - "version": "1.2.2", - "description": "Minify at-rule params with PostCSS", - "keywords": [ - "postcss", - "css", - "postcss-plugin", - "minify", - "optimise", - "params" - ], - "main": "dist/index.js", - "files": [ - "dist" - ], - "author": "Bogdan Chadkin <trysound@yandex.ru>", - "license": "MIT", - "repository": "ben-eb/postcss-minify-params", - "bugs": { - "url": "https://github.com/ben-eb/postcss-minify-params/issues" - }, - "homepage": "https://github.com/ben-eb/postcss-minify-params", - "dependencies": { - "alphanum-sort": "^1.0.1", - "postcss": "^5.0.2", - "postcss-value-parser": "^3.0.2", - "uniqs": "^2.0.0" - }, - "scripts": { - "prepublish": "del-cli dist && cross-env BABEL_ENV=publish buble src -o dist", - "pretest": "eslint src", - "report": "nyc report --reporter=html", - "test": "cross-env BABEL_ENV=test nyc mocha test --compilers js:buble/register" - }, - "devDependencies": { - "buble": "^0.12.5", - "cross-env": "^2.0.0", - "del-cli": "^0.2.0", - "eslint": "^2.13.1", - "eslint-config-postcss": "^2.0.2", - "mocha": "^2.5.3", - "nyc": "^7.0.0" - }, - "eslintConfig": { - "extends": "postcss", - "env": { - "mocha": true - } - }, - "nyc": { - "sourceMap": true, - "instrument": true - } -} |
