trailingSlashComma.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _plugin = require('../plugin');
  6. var _plugin2 = _interopRequireDefault(_plugin);
  7. var _isMixin = require('../isMixin');
  8. var _isMixin2 = _interopRequireDefault(_isMixin);
  9. var _browsers = require('../dictionary/browsers');
  10. var _identifiers = require('../dictionary/identifiers');
  11. var _postcss = require('../dictionary/postcss');
  12. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13. exports.default = (0, _plugin2.default)([_browsers.IE_5_5, _browsers.IE_6, _browsers.IE_7], [_postcss.RULE], function (rule) {
  14. if ((0, _isMixin2.default)(rule)) {
  15. return;
  16. }
  17. const { selector } = rule;
  18. const trim = selector.trim();
  19. if (trim.lastIndexOf(',') === selector.length - 1 || trim.lastIndexOf('\\') === selector.length - 1) {
  20. this.push(rule, {
  21. identifier: _identifiers.SELECTOR,
  22. hack: selector
  23. });
  24. }
  25. });
  26. module.exports = exports['default'];