UNPKG

1.36 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.resetWarning = undefined;
7
8var _postcss = require("postcss");
9
10var _postcss2 = _interopRequireDefault(_postcss);
11
12var _chalk = require("chalk");
13
14var _chalk2 = _interopRequireDefault(_chalk);
15
16function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
18var shouldGlobalWarn = true;
19var resetWarning = exports.resetWarning = function resetWarning() {
20 return shouldGlobalWarn = true;
21};
22
23var warnForDeprecations = _postcss2.default.plugin("postcss-cssnext-warn-for-deprecations", function (_ref) {
24 var messenger = _ref.console;
25
26 return function (style) {
27 // warn for removed @apply
28 style.walkAtRules("apply", function () {
29 if (shouldGlobalWarn) {
30 shouldGlobalWarn = false;
31 messenger.log(_chalk2.default.yellow.bold("You are using @apply rule and custom property sets. \n" + "This feature won't be included in next the major release " + "of postcss-cssnext. \n") + _chalk2.default.grey("This most likely won't get any more support from browser vendors as the " + "spec is yet considered deprecated and alternative solutions are being " + "discussed. \n") + "Read more about the reason here https://github.com/pascalduez/postcss-apply.");
32 }
33 });
34 };
35});
36
37exports.default = warnForDeprecations;
\No newline at end of file