leadingUnderscore.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _postcss = require('postcss');
  6. var _postcss2 = _interopRequireDefault(_postcss);
  7. var _plugin = require('../plugin');
  8. var _plugin2 = _interopRequireDefault(_plugin);
  9. var _browsers = require('../dictionary/browsers');
  10. var _identifiers = require('../dictionary/identifiers');
  11. var _postcss3 = require('../dictionary/postcss');
  12. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13. exports.default = (0, _plugin2.default)([_browsers.IE_6], [_postcss3.DECL], function (decl) {
  14. const { before } = decl.raws;
  15. if (before && ~before.indexOf('_')) {
  16. this.push(decl, {
  17. identifier: _identifiers.PROPERTY,
  18. hack: `${before.trim()}${decl.prop}`
  19. });
  20. }
  21. if (decl.prop[0] === '-' && decl.prop[1] !== '-' && _postcss2.default.vendor.prefix(decl.prop) === '') {
  22. this.push(decl, {
  23. identifier: _identifiers.PROPERTY,
  24. hack: decl.prop
  25. });
  26. }
  27. });
  28. module.exports = exports['default'];