flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
20
BACK_BACK/node_modules/postcss-minify-params/LICENSE
generated
vendored
Executable file
20
BACK_BACK/node_modules/postcss-minify-params/LICENSE
generated
vendored
Executable file
|
|
@ -0,0 +1,20 @@
|
|||
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.
|
||||
39
BACK_BACK/node_modules/postcss-minify-params/README.md
generated
vendored
Executable file
39
BACK_BACK/node_modules/postcss-minify-params/README.md
generated
vendored
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
# 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.
|
||||
|
||||
## Contributors
|
||||
|
||||
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)
|
||||
|
||||
[PostCSS]: https://github.com/postcss/postcss
|
||||
[ci-img]: https://travis-ci.org/cssnano/postcss-minify-params.svg
|
||||
[ci]: https://travis-ci.org/cssnano/postcss-minify-params
|
||||
126
BACK_BACK/node_modules/postcss-minify-params/dist/index.js
generated
vendored
Executable file
126
BACK_BACK/node_modules/postcss-minify-params/dist/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,126 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _browserslist = require('browserslist');
|
||||
|
||||
var _browserslist2 = _interopRequireDefault(_browserslist);
|
||||
|
||||
var _postcss = require('postcss');
|
||||
|
||||
var _postcss2 = _interopRequireDefault(_postcss);
|
||||
|
||||
var _postcssValueParser = require('postcss-value-parser');
|
||||
|
||||
var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
|
||||
|
||||
var _alphanumSort = require('alphanum-sort');
|
||||
|
||||
var _alphanumSort2 = _interopRequireDefault(_alphanumSort);
|
||||
|
||||
var _uniqs = require('uniqs');
|
||||
|
||||
var _uniqs2 = _interopRequireDefault(_uniqs);
|
||||
|
||||
var _cssnanoUtilGetArguments = require('cssnano-util-get-arguments');
|
||||
|
||||
var _cssnanoUtilGetArguments2 = _interopRequireDefault(_cssnanoUtilGetArguments);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* Return the greatest common divisor
|
||||
* of two numbers.
|
||||
*/
|
||||
|
||||
function gcd(a, b) {
|
||||
return b ? gcd(b, a % b) : a;
|
||||
}
|
||||
|
||||
function aspectRatio(a, b) {
|
||||
const divisor = gcd(a, b);
|
||||
|
||||
return [a / divisor, b / divisor];
|
||||
}
|
||||
|
||||
function split(args) {
|
||||
return args.map(arg => (0, _postcssValueParser.stringify)(arg)).join('');
|
||||
}
|
||||
|
||||
function removeNode(node) {
|
||||
node.value = '';
|
||||
node.type = 'word';
|
||||
}
|
||||
|
||||
function transform(legacy, rule) {
|
||||
const ruleName = rule.name.toLowerCase();
|
||||
|
||||
// We should re-arrange parameters only for `@media` and `@supports` at-rules
|
||||
if (!rule.params || !["media", "supports"].includes(ruleName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const params = (0, _postcssValueParser2.default)(rule.params);
|
||||
|
||||
params.walk((node, index) => {
|
||||
if (node.type === 'div' || node.type === 'function') {
|
||||
node.before = node.after = '';
|
||||
|
||||
if (node.type === 'function' && node.nodes[4] && node.nodes[0].value.toLowerCase().indexOf('-aspect-ratio') === 3) {
|
||||
const [a, b] = aspectRatio(node.nodes[2].value, node.nodes[4].value);
|
||||
|
||||
node.nodes[2].value = a;
|
||||
node.nodes[4].value = b;
|
||||
}
|
||||
} else if (node.type === 'space') {
|
||||
node.value = ' ';
|
||||
} else {
|
||||
const prevWord = params.nodes[index - 2];
|
||||
|
||||
if (node.value.toLowerCase() === 'all' && rule.name.toLowerCase() === 'media' && !prevWord) {
|
||||
const nextWord = params.nodes[index + 2];
|
||||
|
||||
if (!legacy || nextWord) {
|
||||
removeNode(node);
|
||||
}
|
||||
|
||||
if (nextWord && nextWord.value.toLowerCase() === 'and') {
|
||||
const nextSpace = params.nodes[index + 1];
|
||||
const secondSpace = params.nodes[index + 3];
|
||||
|
||||
removeNode(nextWord);
|
||||
removeNode(nextSpace);
|
||||
removeNode(secondSpace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, true);
|
||||
|
||||
rule.params = (0, _alphanumSort2.default)((0, _uniqs2.default)((0, _cssnanoUtilGetArguments2.default)(params).map(split)), {
|
||||
insensitive: true
|
||||
}).join();
|
||||
|
||||
if (!rule.params.length) {
|
||||
rule.raws.afterName = '';
|
||||
}
|
||||
}
|
||||
|
||||
function hasAllBug(browser) {
|
||||
return ~['ie 10', 'ie 11'].indexOf(browser);
|
||||
}
|
||||
|
||||
exports.default = _postcss2.default.plugin('postcss-minify-params', () => {
|
||||
return (css, result) => {
|
||||
const resultOpts = result.opts || {};
|
||||
const browsers = (0, _browserslist2.default)(null, {
|
||||
stats: resultOpts.stats,
|
||||
path: __dirname,
|
||||
env: resultOpts.env
|
||||
});
|
||||
|
||||
return css.walkAtRules(transform.bind(null, browsers.some(hasAllBug)));
|
||||
};
|
||||
});
|
||||
module.exports = exports['default'];
|
||||
42
BACK_BACK/node_modules/postcss-minify-params/package.json
generated
vendored
Executable file
42
BACK_BACK/node_modules/postcss-minify-params/package.json
generated
vendored
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"name": "postcss-minify-params",
|
||||
"version": "4.0.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": "cssnano/cssnano",
|
||||
"bugs": {
|
||||
"url": "https://github.com/cssnano/cssnano/issues"
|
||||
},
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
"dependencies": {
|
||||
"alphanum-sort": "^1.0.0",
|
||||
"browserslist": "^4.0.0",
|
||||
"cssnano-util-get-arguments": "^4.0.0",
|
||||
"postcss": "^7.0.0",
|
||||
"postcss-value-parser": "^3.0.0",
|
||||
"uniqs": "^2.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.0.0",
|
||||
"cross-env": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue