From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- node_modules/postcss-discard-empty/CHANGELOG.md | 29 +++++++++++++ node_modules/postcss-discard-empty/LICENSE-MIT | 22 ++++++++++ node_modules/postcss-discard-empty/README.md | 50 ++++++++++++++++++++++ node_modules/postcss-discard-empty/dist/index.js | 36 ++++++++++++++++ node_modules/postcss-discard-empty/package.json | 53 ++++++++++++++++++++++++ 5 files changed, 190 insertions(+) create mode 100644 node_modules/postcss-discard-empty/CHANGELOG.md create mode 100644 node_modules/postcss-discard-empty/LICENSE-MIT create mode 100644 node_modules/postcss-discard-empty/README.md create mode 100644 node_modules/postcss-discard-empty/dist/index.js create mode 100644 node_modules/postcss-discard-empty/package.json (limited to 'node_modules/postcss-discard-empty') diff --git a/node_modules/postcss-discard-empty/CHANGELOG.md b/node_modules/postcss-discard-empty/CHANGELOG.md new file mode 100644 index 00000000..a14294a9 --- /dev/null +++ b/node_modules/postcss-discard-empty/CHANGELOG.md @@ -0,0 +1,29 @@ +# 2.1.0 + +* postcss-discard-empty will now report the rules that were removed + (thanks to @duncanbeevers). + +# 2.0.1 + +* Now compiled with babel 6. + +# 2.0.0 + +* Upgraded to PostCSS 5. + +# 1.1.2 + +* Increased performance by iterating the AST in a single pass + (thanks to @andyjansson). + +# 1.1.1 + +* Tweaks for compatibility with the plugin guidelines. + +# 1.1.0 + +* Now uses the PostCSS `4.1` plugin API. + +# 1.0.0 + +* Initial release. diff --git a/node_modules/postcss-discard-empty/LICENSE-MIT b/node_modules/postcss-discard-empty/LICENSE-MIT new file mode 100644 index 00000000..fd0e863a --- /dev/null +++ b/node_modules/postcss-discard-empty/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) Ben Briggs (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. diff --git a/node_modules/postcss-discard-empty/README.md b/node_modules/postcss-discard-empty/README.md new file mode 100644 index 00000000..81a43b89 --- /dev/null +++ b/node_modules/postcss-discard-empty/README.md @@ -0,0 +1,50 @@ +# [postcss][postcss]-discard-empty [![Build Status](https://travis-ci.org/ben-eb/postcss-discard-empty.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-discard-empty.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-discard-empty.svg)][deps] + +> Discard empty rules and values with PostCSS. + +## Install + +With [npm](https://npmjs.org/package/postcss-discard-empty) do: + +``` +npm install postcss-discard-empty --save +``` + +## Example + +For more examples see the [tests](test.js). + +### Input + +```css +@font-face; +h1 {} +{color:blue} +h2 {color:} +h3 {color:red} +``` + +### Output + +```css +h3 {color:red} +``` + +## Usage + +See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for +examples for your environment. + +## Contributing + +Pull requests are welcome. If you add functionality, then please add unit tests +to cover it. + +## License + +MIT © [Ben Briggs](http://beneb.info) + +[ci]: https://travis-ci.org/ben-eb/postcss-discard-empty +[deps]: https://gemnasium.com/ben-eb/postcss-discard-empty +[npm]: http://badge.fury.io/js/postcss-discard-empty +[postcss]: https://github.com/postcss/postcss diff --git a/node_modules/postcss-discard-empty/dist/index.js b/node_modules/postcss-discard-empty/dist/index.js new file mode 100644 index 00000000..b3bb445e --- /dev/null +++ b/node_modules/postcss-discard-empty/dist/index.js @@ -0,0 +1,36 @@ +'use strict'; + +exports.__esModule = true; + +var _postcss = require('postcss'); + +function discardAndReport(css, result) { + function discardEmpty(node) { + var type = node.type; + var sub = node.nodes; + + + if (sub) { + node.each(discardEmpty); + } + + if (type === 'decl' && !node.value || type === 'rule' && !node.selector || sub && !sub.length || type === 'atrule' && (!sub && !node.params || !node.params && !sub.length)) { + node.remove(); + + result.messages.push({ + type: 'removal', + plugin: 'postcss-discard-empty', + node: node + }); + } + } + + css.each(discardEmpty); +} + +exports.default = (0, _postcss.plugin)('postcss-discard-empty', function () { + return function (css, result) { + return discardAndReport(css, result); + }; +}); +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/postcss-discard-empty/package.json b/node_modules/postcss-discard-empty/package.json new file mode 100644 index 00000000..910a802d --- /dev/null +++ b/node_modules/postcss-discard-empty/package.json @@ -0,0 +1,53 @@ +{ + "name": "postcss-discard-empty", + "version": "2.1.0", + "description": "Discard empty rules and values with PostCSS.", + "main": "dist/index.js", + "files": [ + "dist", + "LICENSE-MIT" + ], + "scripts": { + "pretest": "eslint src", + "prepublish": "del-cli dist && babel src --out-dir dist --ignore /__tests__/", + "test": "ava src/__tests__" + }, + "keywords": [ + "compress", + "css", + "empty", + "minify", + "optimisation", + "postcss", + "postcss-plugin" + ], + "license": "MIT", + "dependencies": { + "postcss": "^5.0.14" + }, + "devDependencies": { + "ava": "^0.14.0", + "babel-cli": "^6.4.5", + "babel-core": "^6.4.5", + "babel-plugin-add-module-exports": "^0.1.2", + "babel-preset-es2015": "^6.3.13", + "babel-preset-es2015-loose": "^7.0.0", + "babel-preset-stage-0": "^6.3.13", + "del-cli": "^0.2.0", + "eslint": "^2.0.0", + "eslint-config-cssnano": "^2.0.0" + }, + "homepage": "https://github.com/ben-eb/postcss-discard-empty", + "author": { + "name": "Ben Briggs", + "email": "beneb.info@gmail.com", + "url": "http://beneb.info" + }, + "repository": "ben-eb/postcss-discard-empty", + "eslintConfig": { + "extends": "cssnano" + }, + "ava": { + "require": "babel-core/register" + } +} -- cgit v1.2.3