node_modules

This commit is contained in:
saeid
2019-07-15 13:07:31 +04:30
parent d3735c6d30
commit ce1a3ebf9c
35713 changed files with 3639219 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)
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.
+45
View File
@@ -0,0 +1,45 @@
# [postcss][postcss]-colormin
> Minify colors in your CSS files with PostCSS.
## Install
With [npm](https://npmjs.org/package/postcss-colormin) do:
```
npm install postcss-colormin --save
```
## Example
```js
var postcss = require('postcss')
var colormin = require('postcss-colormin');
var css = 'h1 {color: rgba(255, 0, 0, 1)}';
console.log(postcss(colormin()).process(css).css);
// => 'h1 {color:red}'
```
For more examples see the [tests](src/__tests__/index.js).
## Usage
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
examples for your environment.
## Contributors
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
## License
MIT © [Ben Briggs](http://beneb.info)
[postcss]: https://github.com/postcss/postcss
+76
View File
@@ -0,0 +1,76 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _color = require('color');
var _color2 = _interopRequireDefault(_color);
var _keywords = require('./keywords.json');
var _keywords2 = _interopRequireDefault(_keywords);
var _toShorthand = require('./lib/toShorthand');
var _toShorthand2 = _interopRequireDefault(_toShorthand);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const shorter = (a, b) => (a && a.length < b.length ? a : b).toLowerCase();
exports.default = (colour, isLegacy = false, cache = false) => {
const key = colour + "|" + isLegacy;
if (cache && cache[key]) {
return cache[key];
}
try {
const parsed = (0, _color2.default)(colour.toLowerCase());
const alpha = parsed.alpha();
if (alpha === 1) {
const toHex = (0, _toShorthand2.default)(parsed.hex().toLowerCase());
const result = shorter(_keywords2.default[toHex], toHex);
if (cache) {
cache[key] = result;
}
return result;
} else {
const rgb = parsed.rgb();
if (!isLegacy && !rgb.color[0] && !rgb.color[1] && !rgb.color[2] && !alpha) {
const result = 'transparent';
if (cache) {
cache[key] = result;
}
return result;
}
let hsla = parsed.hsl().string();
let rgba = rgb.string();
let result = hsla.length < rgba.length ? hsla : rgba;
if (cache) {
cache[key] = result;
}
return result;
}
} catch (e) {
// Possibly malformed, so pass through
const result = colour;
if (cache) {
cache[key] = result;
}
return result;
}
};
+101
View File
@@ -0,0 +1,101 @@
"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 _colours = require("./colours");
var _colours2 = _interopRequireDefault(_colours);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function walk(parent, callback) {
parent.nodes.forEach((node, index) => {
const bubble = callback(node, index, parent);
if (node.nodes && bubble !== false) {
walk(node, callback);
}
});
}
/*
* IE 8 & 9 do not properly handle clicks on elements
* with a `transparent` `background-color`.
*
* https://developer.mozilla.org/en-US/docs/Web/Events/click#Internet_Explorer
*/
function hasTransparentBug(browser) {
return ~["ie 8", "ie 9"].indexOf(browser);
}
exports.default = _postcss2.default.plugin("postcss-colormin", () => {
return (css, result) => {
const resultOpts = result.opts || {};
const browsers = (0, _browserslist2.default)(null, {
stats: resultOpts.stats,
path: __dirname,
env: resultOpts.env
});
const isLegacy = browsers.some(hasTransparentBug);
const colorminCache = {};
const cache = {};
css.walkDecls(decl => {
if (/^(composes|font|filter|-webkit-tap-highlight-color)/i.test(decl.prop)) {
return;
}
if (cache[decl.value]) {
decl.value = cache[decl.value];
return;
}
const parsed = (0, _postcssValueParser2.default)(decl.value);
walk(parsed, (node, index, parent) => {
if (node.type === "function") {
if (/^(rgb|hsl)a?$/i.test(node.value)) {
const { value } = node;
node.value = (0, _colours2.default)((0, _postcssValueParser.stringify)(node), isLegacy, colorminCache);
node.type = "word";
const next = parent.nodes[index + 1];
if (node.value !== value && next && (next.type === "word" || next.type === "function")) {
parent.nodes.splice(index + 1, 0, {
type: "space",
value: " "
});
}
} else if (node.value.toLowerCase() === "calc") {
return false;
}
} else if (node.type === "word") {
node.value = (0, _colours2.default)(node.value, isLegacy, colorminCache);
}
});
const optimizedValue = parsed.toString();
decl.value = optimizedValue;
cache[decl.value] = optimizedValue;
});
};
});
+33
View File
@@ -0,0 +1,33 @@
{
"#f0ffff": "azure",
"#f5f5dc": "beige",
"#ffe4c4": "bisque",
"#a52a2a": "brown",
"#ff7f50": "coral",
"#ffd700": "gold",
"#808080": "grey",
"#008000": "green",
"#4b0082": "indigo",
"#fffff0": "ivory",
"#f0e68c": "khaki",
"#faf0e6": "linen",
"#800000": "maroon",
"#000080": "navy",
"#808000": "olive",
"#ffa500": "orange",
"#da70d6": "orchid",
"#cd853f": "peru",
"#ffc0cb": "pink",
"#dda0dd": "plum",
"#800080": "purple",
"#f00": "red",
"#fa8072": "salmon",
"#a0522d": "sienna",
"#c0c0c0": "silver",
"#fffafa": "snow",
"#d2b48c": "tan",
"#008080": "teal",
"#ff6347": "tomato",
"#ee82ee": "violet",
"#f5deb3": "wheat"
}
+13
View File
@@ -0,0 +1,13 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = hex => {
if (hex[1] === hex[2] && hex[3] === hex[4] && hex[5] === hex[6]) {
return '#' + hex[2] + hex[4] + hex[6];
}
return hex;
};
+77
View File
@@ -0,0 +1,77 @@
{
"_from": "postcss-colormin@^4.0.3",
"_id": "postcss-colormin@4.0.3",
"_inBundle": false,
"_integrity": "sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw==",
"_location": "/postcss-colormin",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "postcss-colormin@^4.0.3",
"name": "postcss-colormin",
"escapedName": "postcss-colormin",
"rawSpec": "^4.0.3",
"saveSpec": null,
"fetchSpec": "^4.0.3"
},
"_requiredBy": [
"/cssnano-preset-default"
],
"_resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.3.tgz",
"_shasum": "ae060bce93ed794ac71264f08132d550956bd381",
"_spec": "postcss-colormin@^4.0.3",
"_where": "D:\\Atom\\Git\\Laravel_CSSd\\node_modules\\cssnano-preset-default",
"author": {
"name": "Ben Briggs",
"email": "beneb.info@gmail.com",
"url": "http://beneb.info"
},
"bugs": {
"url": "https://github.com/cssnano/cssnano/issues"
},
"bundleDependencies": false,
"dependencies": {
"browserslist": "^4.0.0",
"color": "^3.0.0",
"has": "^1.0.0",
"postcss": "^7.0.0",
"postcss-value-parser": "^3.0.0"
},
"deprecated": false,
"description": "Minify colors in your CSS files with PostCSS.",
"devDependencies": {
"babel-cli": "^6.0.0",
"cross-env": "^5.0.0",
"css-color-names": "0.0.4",
"write-file": "^1.0.0"
},
"engines": {
"node": ">=6.9.0"
},
"files": [
"dist",
"LICENSE-MIT"
],
"homepage": "https://github.com/cssnano/cssnano",
"keywords": [
"color",
"colors",
"compression",
"css",
"minify",
"postcss",
"postcss-plugin"
],
"license": "MIT",
"main": "dist/index.js",
"name": "postcss-colormin",
"repository": {
"type": "git",
"url": "git+https://github.com/cssnano/cssnano.git"
},
"scripts": {
"prepublish": "cross-env BABEL_ENV=publish babel-node ./src/generate.js && babel src --out-dir dist --ignore /__tests__/,src/generate.js"
},
"version": "4.0.3"
}