UI for Zipcoin Blue

postcss.js 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. 'use strict';
  2. exports.__esModule = true;
  3. var _declaration = require('./declaration');
  4. var _declaration2 = _interopRequireDefault(_declaration);
  5. var _processor = require('./processor');
  6. var _processor2 = _interopRequireDefault(_processor);
  7. var _stringify = require('./stringify');
  8. var _stringify2 = _interopRequireDefault(_stringify);
  9. var _comment = require('./comment');
  10. var _comment2 = _interopRequireDefault(_comment);
  11. var _atRule = require('./at-rule');
  12. var _atRule2 = _interopRequireDefault(_atRule);
  13. var _vendor = require('./vendor');
  14. var _vendor2 = _interopRequireDefault(_vendor);
  15. var _parse = require('./parse');
  16. var _parse2 = _interopRequireDefault(_parse);
  17. var _list = require('./list');
  18. var _list2 = _interopRequireDefault(_list);
  19. var _rule = require('./rule');
  20. var _rule2 = _interopRequireDefault(_rule);
  21. var _root = require('./root');
  22. var _root2 = _interopRequireDefault(_root);
  23. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  24. /**
  25. * Create a new {@link Processor} instance that will apply `plugins`
  26. * as CSS processors.
  27. *
  28. * @param {Array.<Plugin|pluginFunction>|Processor} plugins - PostCSS
  29. * plugins. See {@link Processor#use} for plugin format.
  30. *
  31. * @return {Processor} Processor to process multiple CSS
  32. *
  33. * @example
  34. * import postcss from 'postcss';
  35. *
  36. * postcss(plugins).process(css, { from, to }).then(result => {
  37. * console.log(result.css);
  38. * });
  39. *
  40. * @namespace postcss
  41. */
  42. function postcss() {
  43. for (var _len = arguments.length, plugins = Array(_len), _key = 0; _key < _len; _key++) {
  44. plugins[_key] = arguments[_key];
  45. }
  46. if (plugins.length === 1 && Array.isArray(plugins[0])) {
  47. plugins = plugins[0];
  48. }
  49. return new _processor2.default(plugins);
  50. }
  51. /**
  52. * Creates a PostCSS plugin with a standard API.
  53. *
  54. * The newly-wrapped function will provide both the name and PostCSS
  55. * version of the plugin.
  56. *
  57. * ```js
  58. * const processor = postcss([replace]);
  59. * processor.plugins[0].postcssPlugin //=> 'postcss-replace'
  60. * processor.plugins[0].postcssVersion //=> '5.1.0'
  61. * ```
  62. *
  63. * The plugin function receives 2 arguments: {@link Root}
  64. * and {@link Result} instance. The function should mutate the provided
  65. * `Root` node. Alternatively, you can create a new `Root` node
  66. * and override the `result.root` property.
  67. *
  68. * ```js
  69. * const cleaner = postcss.plugin('postcss-cleaner', () => {
  70. * return (root, result) => {
  71. * result.root = postcss.root();
  72. * };
  73. * });
  74. * ```
  75. *
  76. * As a convenience, plugins also expose a `process` method so that you can use
  77. * them as standalone tools.
  78. *
  79. * ```js
  80. * cleaner.process(css, processOpts, pluginOpts);
  81. * // This is equivalent to:
  82. * postcss([ cleaner(pluginOpts) ]).process(css, processOpts);
  83. * ```
  84. *
  85. * Asynchronous plugins should return a `Promise` instance.
  86. *
  87. * ```js
  88. * postcss.plugin('postcss-import', () => {
  89. * return (root, result) => {
  90. * return new Promise( (resolve, reject) => {
  91. * fs.readFile('base.css', (base) => {
  92. * root.prepend(base);
  93. * resolve();
  94. * });
  95. * });
  96. * };
  97. * });
  98. * ```
  99. *
  100. * Add warnings using the {@link Node#warn} method.
  101. * Send data to other plugins using the {@link Result#messages} array.
  102. *
  103. * ```js
  104. * postcss.plugin('postcss-caniuse-test', () => {
  105. * return (root, result) => {
  106. * root.walkDecls(decl => {
  107. * if ( !caniuse.support(decl.prop) ) {
  108. * decl.warn(result, 'Some browsers do not support ' + decl.prop);
  109. * }
  110. * });
  111. * };
  112. * });
  113. * ```
  114. *
  115. * @param {string} name - PostCSS plugin name. Same as in `name`
  116. * property in `package.json`. It will be saved
  117. * in `plugin.postcssPlugin` property.
  118. * @param {function} initializer - will receive plugin options
  119. * and should return {@link pluginFunction}
  120. *
  121. * @return {Plugin} PostCSS plugin
  122. */
  123. postcss.plugin = function plugin(name, initializer) {
  124. var creator = function creator() {
  125. var transformer = initializer.apply(undefined, arguments);
  126. transformer.postcssPlugin = name;
  127. transformer.postcssVersion = new _processor2.default().version;
  128. return transformer;
  129. };
  130. var cache = void 0;
  131. Object.defineProperty(creator, 'postcss', {
  132. get: function get() {
  133. if (!cache) cache = creator();
  134. return cache;
  135. }
  136. });
  137. creator.process = function (css, processOpts, pluginOpts) {
  138. return postcss([creator(pluginOpts)]).process(css, processOpts);
  139. };
  140. return creator;
  141. };
  142. /**
  143. * Default function to convert a node tree into a CSS string.
  144. *
  145. * @param {Node} node - start node for stringifing. Usually {@link Root}.
  146. * @param {builder} builder - function to concatenate CSS from node’s parts
  147. * or generate string and source map
  148. *
  149. * @return {void}
  150. *
  151. * @function
  152. */
  153. postcss.stringify = _stringify2.default;
  154. /**
  155. * Parses source css and returns a new {@link Root} node,
  156. * which contains the source CSS nodes.
  157. *
  158. * @param {string|toString} css - string with input CSS or any object
  159. * with toString() method, like a Buffer
  160. * @param {processOptions} [opts] - options with only `from` and `map` keys
  161. *
  162. * @return {Root} PostCSS AST
  163. *
  164. * @example
  165. * // Simple CSS concatenation with source map support
  166. * const root1 = postcss.parse(css1, { from: file1 });
  167. * const root2 = postcss.parse(css2, { from: file2 });
  168. * root1.append(root2).toResult().css;
  169. *
  170. * @function
  171. */
  172. postcss.parse = _parse2.default;
  173. /**
  174. * @member {vendor} - Contains the {@link vendor} module.
  175. *
  176. * @example
  177. * postcss.vendor.unprefixed('-moz-tab') //=> ['tab']
  178. */
  179. postcss.vendor = _vendor2.default;
  180. /**
  181. * @member {list} - Contains the {@link list} module.
  182. *
  183. * @example
  184. * postcss.list.space('5px calc(10% + 5px)') //=> ['5px', 'calc(10% + 5px)']
  185. */
  186. postcss.list = _list2.default;
  187. /**
  188. * Creates a new {@link Comment} node.
  189. *
  190. * @param {object} [defaults] - properties for the new node.
  191. *
  192. * @return {Comment} new Comment node
  193. *
  194. * @example
  195. * postcss.comment({ text: 'test' })
  196. */
  197. postcss.comment = function (defaults) {
  198. return new _comment2.default(defaults);
  199. };
  200. /**
  201. * Creates a new {@link AtRule} node.
  202. *
  203. * @param {object} [defaults] - properties for the new node.
  204. *
  205. * @return {AtRule} new AtRule node
  206. *
  207. * @example
  208. * postcss.atRule({ name: 'charset' }).toString() //=> "@charset"
  209. */
  210. postcss.atRule = function (defaults) {
  211. return new _atRule2.default(defaults);
  212. };
  213. /**
  214. * Creates a new {@link Declaration} node.
  215. *
  216. * @param {object} [defaults] - properties for the new node.
  217. *
  218. * @return {Declaration} new Declaration node
  219. *
  220. * @example
  221. * postcss.decl({ prop: 'color', value: 'red' }).toString() //=> "color: red"
  222. */
  223. postcss.decl = function (defaults) {
  224. return new _declaration2.default(defaults);
  225. };
  226. /**
  227. * Creates a new {@link Rule} node.
  228. *
  229. * @param {object} [defaults] - properties for the new node.
  230. *
  231. * @return {Rule} new Rule node
  232. *
  233. * @example
  234. * postcss.rule({ selector: 'a' }).toString() //=> "a {\n}"
  235. */
  236. postcss.rule = function (defaults) {
  237. return new _rule2.default(defaults);
  238. };
  239. /**
  240. * Creates a new {@link Root} node.
  241. *
  242. * @param {object} [defaults] - properties for the new node.
  243. *
  244. * @return {Root} new Root node
  245. *
  246. * @example
  247. * postcss.root({ after: '\n' }).toString() //=> "\n"
  248. */
  249. postcss.root = function (defaults) {
  250. return new _root2.default(defaults);
  251. };
  252. exports.default = postcss;
  253. module.exports = exports['default'];
  254. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBvc3Rjc3MuZXM2Il0sIm5hbWVzIjpbInBvc3Rjc3MiLCJwbHVnaW5zIiwibGVuZ3RoIiwiQXJyYXkiLCJp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