aboutsummaryrefslogtreecommitdiff
path: root/node_modules/postcss-discard-empty
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-08 00:38:48 +0800
committerruki <waruqi@gmail.com>2018-11-07 21:53:09 +0800
commit26105034da4fcce7ac883c899d781f016559310d (patch)
treec459a5dc4e3aa0972d9919033ece511ce76dd129 /node_modules/postcss-discard-empty
parent2c77f00f1a7ecb6c8192f9c16d3b2001b254a107 (diff)
downloadxmake-docs-26105034da4fcce7ac883c899d781f016559310d.tar.gz
xmake-docs-26105034da4fcce7ac883c899d781f016559310d.zip
switch to vuepress
Diffstat (limited to 'node_modules/postcss-discard-empty')
-rw-r--r--node_modules/postcss-discard-empty/CHANGELOG.md29
-rw-r--r--node_modules/postcss-discard-empty/LICENSE-MIT22
-rw-r--r--node_modules/postcss-discard-empty/README.md50
-rw-r--r--node_modules/postcss-discard-empty/dist/index.js36
-rw-r--r--node_modules/postcss-discard-empty/package.json53
5 files changed, 190 insertions, 0 deletions
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 <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.
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"
+ }
+}