From a0579f91bbdf0de62b59df381d97a008bb98df57 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 30 Oct 2023 16:45:38 +0800 Subject: update/upgrade --- node_modules/oldie/index.js | 71 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 node_modules/oldie/index.js (limited to 'node_modules/oldie/index.js') diff --git a/node_modules/oldie/index.js b/node_modules/oldie/index.js new file mode 100644 index 00000000..557b2d5c --- /dev/null +++ b/node_modules/oldie/index.js @@ -0,0 +1,71 @@ +var assign = require('object-assign'); +var postcss = require('postcss'); + +var processors = [ + { + plugin: require('postcss-calc'), + namespace: 'calc', + defaults: {} + }, + { + plugin: require('postcss-unmq'), + namespace: 'media', + defaults: {} + }, + { + plugin: require('postcss-unroot'), + namespace: 'root', + defaults: {} + }, + { + plugin: require('postcss-unnth'), + namespace: 'nth', + defaults: {} + }, + { + plugin: require('postcss-unnot'), + namespace: 'not', + defaults: {} + }, + { + plugin: require('postcss-unopacity'), + namespace: 'opacity', + defaults: {} + }, + { + plugin: require('postcss-unrgba'), + namespace: 'rgba', + defaults: {} + }, + { + plugin: require('pixrem'), + namespace: 'rem', + defaults: { + replace: true + } + }, + { + plugin: require('postcss-pseudoelements'), + namespace: 'pseudo', + defaults: {} + } +]; + +module.exports = postcss.plugin('oldie', function (opts) { + opts = assign({}, opts); + + var instance = postcss(); + + processors.forEach(function (processor) { + var namespaceOptions = processor.namespace in opts ? opts[processor.namespace] : opts; + var processorOptions = {}; + + processorOptions = assign({}, processor.defaults, namespaceOptions); + + if (namespaceOptions && !processorOptions.disable) { + instance.use(processor.plugin(processorOptions)); + } + }); + + return instance; +}); -- cgit v1.2.3