You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

762 lines
24 KiB

4 years ago
  1. "use strict";
  2. var parser = require('postcss-value-parser');
  3. var Value = require('./value');
  4. var insertAreas = require('./hacks/grid-utils').insertAreas;
  5. var OLD_LINEAR = /(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i;
  6. var OLD_RADIAL = /(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i;
  7. var IGNORE_NEXT = /(!\s*)?autoprefixer:\s*ignore\s+next/i;
  8. var GRID_REGEX = /(!\s*)?autoprefixer\s*grid:\s*(on|off|(no-)?autoplace)/i;
  9. var SIZES = ['width', 'height', 'min-width', 'max-width', 'min-height', 'max-height', 'inline-size', 'min-inline-size', 'max-inline-size', 'block-size', 'min-block-size', 'max-block-size'];
  10. function hasGridTemplate(decl) {
  11. return decl.parent.some(function (i) {
  12. return i.prop === 'grid-template' || i.prop === 'grid-template-areas';
  13. });
  14. }
  15. function hasRowsAndColumns(decl) {
  16. var hasRows = decl.parent.some(function (i) {
  17. return i.prop === 'grid-template-rows';
  18. });
  19. var hasColumns = decl.parent.some(function (i) {
  20. return i.prop === 'grid-template-columns';
  21. });
  22. return hasRows && hasColumns;
  23. }
  24. var Processor =
  25. /*#__PURE__*/
  26. function () {
  27. function Processor(prefixes) {
  28. this.prefixes = prefixes;
  29. }
  30. /**
  31. * Add necessary prefixes
  32. */
  33. var _proto = Processor.prototype;
  34. _proto.add = function add(css, result) {
  35. var _this = this;
  36. // At-rules
  37. var resolution = this.prefixes.add['@resolution'];
  38. var keyframes = this.prefixes.add['@keyframes'];
  39. var viewport = this.prefixes.add['@viewport'];
  40. var supports = this.prefixes.add['@supports'];
  41. css.walkAtRules(function (rule) {
  42. if (rule.name === 'keyframes') {
  43. if (!_this.disabled(rule, result)) {
  44. return keyframes && keyframes.process(rule);
  45. }
  46. } else if (rule.name === 'viewport') {
  47. if (!_this.disabled(rule, result)) {
  48. return viewport && viewport.process(rule);
  49. }
  50. } else if (rule.name === 'supports') {
  51. if (_this.prefixes.options.supports !== false && !_this.disabled(rule, result)) {
  52. return supports.process(rule);
  53. }
  54. } else if (rule.name === 'media' && rule.params.includes('-resolution')) {
  55. if (!_this.disabled(rule, result)) {
  56. return resolution && resolution.process(rule);
  57. }
  58. }
  59. return undefined;
  60. }); // Selectors
  61. css.walkRules(function (rule) {
  62. if (_this.disabled(rule, result)) return undefined;
  63. return _this.prefixes.add.selectors.map(function (selector) {
  64. return selector.process(rule, result);
  65. });
  66. });
  67. function insideGrid(decl) {
  68. return decl.parent.nodes.some(function (node) {
  69. if (node.type !== 'decl') return false;
  70. var displayGrid = node.prop === 'display' && /(inline-)?grid/.test(node.value);
  71. var gridTemplate = node.prop.startsWith('grid-template');
  72. var gridGap = /^grid-([A-z]+-)?gap/.test(node.prop);
  73. return displayGrid || gridTemplate || gridGap;
  74. });
  75. }
  76. function insideFlex(decl) {
  77. return decl.parent.some(function (node) {
  78. return node.prop === 'display' && /(inline-)?flex/.test(node.value);
  79. });
  80. }
  81. var gridPrefixes = this.gridStatus(css, result) && this.prefixes.add['grid-area'] && this.prefixes.add['grid-area'].prefixes;
  82. css.walkDecls(function (decl) {
  83. if (_this.disabledDecl(decl, result)) return undefined;
  84. var parent = decl.parent;
  85. var prop = decl.prop;
  86. var value = decl.value;
  87. if (prop === 'grid-row-span') {
  88. result.warn('grid-row-span is not part of final Grid Layout. Use grid-row.', {
  89. node: decl
  90. });
  91. return undefined;
  92. } else if (prop === 'grid-column-span') {
  93. result.warn('grid-column-span is not part of final Grid Layout. Use grid-column.', {
  94. node: decl
  95. });
  96. return undefined;
  97. } else if (prop === 'display' && value === 'box') {
  98. result.warn('You should write display: flex by final spec ' + 'instead of display: box', {
  99. node: decl
  100. });
  101. return undefined;
  102. } else if (prop === 'text-emphasis-position') {
  103. if (value === 'under' || value === 'over') {
  104. result.warn('You should use 2 values for text-emphasis-position ' + 'For example, `under left` instead of just `under`.', {
  105. node: decl
  106. });
  107. }
  108. } else if (/^(align|justify|place)-(items|content)$/.test(prop) && insideFlex(decl)) {
  109. if (value === 'start' || value === 'end') {
  110. result.warn(value + " value has mixed support, consider using " + ("flex-" + value + " instead"), {
  111. node: decl
  112. });
  113. }
  114. } else if (prop === 'text-decoration-skip' && value === 'ink') {
  115. result.warn('Replace text-decoration-skip: ink to ' + 'text-decoration-skip-ink: auto, because spec had been changed', {
  116. node: decl
  117. });
  118. } else {
  119. if (gridPrefixes) {
  120. if (/^(align|justify|place)-items$/.test(prop) && insideGrid(decl)) {
  121. var fixed = prop.replace('-items', '-self');
  122. result.warn("IE does not support " + prop + " on grid containers. " + ("Try using " + fixed + " on child elements instead: ") + (decl.parent.selector + " > * { " + fixed + ": " + decl.value + " }"), {
  123. node: decl
  124. });
  125. } else if (/^(align|justify|place)-content$/.test(prop) && insideGrid(decl)) {
  126. result.warn("IE does not support " + decl.prop + " on grid containers", {
  127. node: decl
  128. });
  129. } else if (prop === 'display' && decl.value === 'contents') {
  130. result.warn('Please do not use display: contents; ' + 'if you have grid setting enabled', {
  131. node: decl
  132. });
  133. return undefined;
  134. } else if (decl.prop === 'grid-gap') {
  135. var status = _this.gridStatus(decl, result);
  136. if (status === 'autoplace' && !hasRowsAndColumns(decl) && !hasGridTemplate(decl)) {
  137. result.warn('grid-gap only works if grid-template(-areas) is being ' + 'used or both rows and columns have been declared ' + 'and cells have not been manually ' + 'placed inside the explicit grid', {
  138. node: decl
  139. });
  140. } else if ((status === true || status === 'no-autoplace') && !hasGridTemplate(decl)) {
  141. result.warn('grid-gap only works if grid-template(-areas) is being used', {
  142. node: decl
  143. });
  144. }
  145. } else if (prop === 'grid-auto-columns') {
  146. result.warn('grid-auto-columns is not supported by IE', {
  147. node: decl
  148. });
  149. return undefined;
  150. } else if (prop === 'grid-auto-rows') {
  151. result.warn('grid-auto-rows is not supported by IE', {
  152. node: decl
  153. });
  154. return undefined;
  155. } else if (prop === 'grid-auto-flow') {
  156. var hasRows = parent.some(function (i) {
  157. return i.prop === 'grid-template-rows';
  158. });
  159. var hasCols = parent.some(function (i) {
  160. return i.prop === 'grid-template-columns';
  161. });
  162. if (hasGridTemplate(decl)) {
  163. result.warn('grid-auto-flow is not supported by IE', {
  164. node: decl
  165. });
  166. } else if (value.includes('dense')) {
  167. result.warn('grid-auto-flow: dense is not supported by IE', {
  168. node: decl
  169. });
  170. } else if (!hasRows && !hasCols) {
  171. result.warn('grid-auto-flow works only if grid-template-rows and ' + 'grid-template-columns are present in the same rule', {
  172. node: decl
  173. });
  174. }
  175. return undefined;
  176. } else if (value.includes('auto-fit')) {
  177. result.warn('auto-fit value is not supported by IE', {
  178. node: decl,
  179. word: 'auto-fit'
  180. });
  181. return undefined;
  182. } else if (value.includes('auto-fill')) {
  183. result.warn('auto-fill value is not supported by IE', {
  184. node: decl,
  185. word: 'auto-fill'
  186. });
  187. return undefined;
  188. } else if (prop.startsWith('grid-template') && value.includes('[')) {
  189. result.warn('Autoprefixer currently does not support line names. ' + 'Try using grid-template-areas instead.', {
  190. node: decl,
  191. word: '['
  192. });
  193. }
  194. }
  195. if (value.includes('radial-gradient')) {
  196. if (OLD_RADIAL.test(decl.value)) {
  197. result.warn('Gradient has outdated direction syntax. ' + 'New syntax is like `closest-side at 0 0` ' + 'instead of `0 0, closest-side`.', {
  198. node: decl
  199. });
  200. } else {
  201. var ast = parser(value);
  202. for (var _iterator = ast.nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  203. var _ref;
  204. if (_isArray) {
  205. if (_i >= _iterator.length) break;
  206. _ref = _iterator[_i++];
  207. } else {
  208. _i = _iterator.next();
  209. if (_i.done) break;
  210. _ref = _i.value;
  211. }
  212. var i = _ref;
  213. if (i.type === 'function' && i.value === 'radial-gradient') {
  214. for (var _iterator2 = i.nodes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  215. var _ref2;
  216. if (_isArray2) {
  217. if (_i2 >= _iterator2.length) break;
  218. _ref2 = _iterator2[_i2++];
  219. } else {
  220. _i2 = _iterator2.next();
  221. if (_i2.done) break;
  222. _ref2 = _i2.value;
  223. }
  224. var word = _ref2;
  225. if (word.type === 'word') {
  226. if (word.value === 'cover') {
  227. result.warn('Gradient has outdated direction syntax. ' + 'Replace `cover` to `farthest-corner`.', {
  228. node: decl
  229. });
  230. } else if (word.value === 'contain') {
  231. result.warn('Gradient has outdated direction syntax. ' + 'Replace `contain` to `closest-side`.', {
  232. node: decl
  233. });
  234. }
  235. }
  236. }
  237. }
  238. }
  239. }
  240. }
  241. if (value.includes('linear-gradient')) {
  242. if (OLD_LINEAR.test(value)) {
  243. result.warn('Gradient has outdated direction syntax. ' + 'New syntax is like `to left` instead of `right`.', {
  244. node: decl
  245. });
  246. }
  247. }
  248. }
  249. if (SIZES.includes(decl.prop)) {
  250. if (!decl.value.includes('-fill-available')) {
  251. if (decl.value.includes('fill-available')) {
  252. result.warn('Replace fill-available to stretch, ' + 'because spec had been changed', {
  253. node: decl
  254. });
  255. } else if (decl.value.includes('fill')) {
  256. var _ast = parser(value);
  257. if (_ast.nodes.some(function (i) {
  258. return i.type === 'word' && i.value === 'fill';
  259. })) {
  260. result.warn('Replace fill to stretch, because spec had been changed', {
  261. node: decl
  262. });
  263. }
  264. }
  265. }
  266. }
  267. var prefixer;
  268. if (decl.prop === 'transition' || decl.prop === 'transition-property') {
  269. // Transition
  270. return _this.prefixes.transition.add(decl, result);
  271. } else if (decl.prop === 'align-self') {
  272. // align-self flexbox or grid
  273. var display = _this.displayType(decl);
  274. if (display !== 'grid' && _this.prefixes.options.flexbox !== false) {
  275. prefixer = _this.prefixes.add['align-self'];
  276. if (prefixer && prefixer.prefixes) {
  277. prefixer.process(decl);
  278. }
  279. }
  280. if (display !== 'flex' && _this.gridStatus(decl, result) !== false) {
  281. prefixer = _this.prefixes.add['grid-row-align'];
  282. if (prefixer && prefixer.prefixes) {
  283. return prefixer.process(decl, result);
  284. }
  285. }
  286. } else if (decl.prop === 'justify-self') {
  287. // justify-self flexbox or grid
  288. var _display = _this.displayType(decl);
  289. if (_display !== 'flex' && _this.gridStatus(decl, result) !== false) {
  290. prefixer = _this.prefixes.add['grid-column-align'];
  291. if (prefixer && prefixer.prefixes) {
  292. return prefixer.process(decl, result);
  293. }
  294. }
  295. } else if (decl.prop === 'place-self') {
  296. prefixer = _this.prefixes.add['place-self'];
  297. if (prefixer && prefixer.prefixes && _this.gridStatus(decl, result) !== false) {
  298. return prefixer.process(decl, result);
  299. }
  300. } else {
  301. // Properties
  302. prefixer = _this.prefixes.add[decl.prop];
  303. if (prefixer && prefixer.prefixes) {
  304. return prefixer.process(decl, result);
  305. }
  306. }
  307. return undefined;
  308. }); // Insert grid-area prefixes. We need to be able to store the different
  309. // rules as a data and hack API is not enough for this
  310. if (this.gridStatus(css, result)) {
  311. insertAreas(css, this.disabled);
  312. } // Values
  313. return css.walkDecls(function (decl) {
  314. if (_this.disabledValue(decl, result)) return;
  315. var unprefixed = _this.prefixes.unprefixed(decl.prop);
  316. var list = _this.prefixes.values('add', unprefixed);
  317. if (Array.isArray(list)) {
  318. for (var _iterator3 = list, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
  319. var _ref3;
  320. if (_isArray3) {
  321. if (_i3 >= _iterator3.length) break;
  322. _ref3 = _iterator3[_i3++];
  323. } else {
  324. _i3 = _iterator3.next();
  325. if (_i3.done) break;
  326. _ref3 = _i3.value;
  327. }
  328. var value = _ref3;
  329. if (value.process) value.process(decl, result);
  330. }
  331. }
  332. Value.save(_this.prefixes, decl);
  333. });
  334. }
  335. /**
  336. * Remove unnecessary pefixes
  337. */
  338. ;
  339. _proto.remove = function remove(css, result) {
  340. var _this2 = this;
  341. // At-rules
  342. var resolution = this.prefixes.remove['@resolution'];
  343. css.walkAtRules(function (rule, i) {
  344. if (_this2.prefixes.remove["@" + rule.name]) {
  345. if (!_this2.disabled(rule, result)) {
  346. rule.parent.removeChild(i);
  347. }
  348. } else if (rule.name === 'media' && rule.params.includes('-resolution') && resolution) {
  349. resolution.clean(rule);
  350. }
  351. }); // Selectors
  352. var _loop = function _loop() {
  353. if (_isArray4) {
  354. if (_i4 >= _iterator4.length) return "break";
  355. _ref4 = _iterator4[_i4++];
  356. } else {
  357. _i4 = _iterator4.next();
  358. if (_i4.done) return "break";
  359. _ref4 = _i4.value;
  360. }
  361. var checker = _ref4;
  362. css.walkRules(function (rule, i) {
  363. if (checker.check(rule)) {
  364. if (!_this2.disabled(rule, result)) {
  365. rule.parent.removeChild(i);
  366. }
  367. }
  368. });
  369. };
  370. for (var _iterator4 = this.prefixes.remove.selectors, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
  371. var _ref4;
  372. var _ret = _loop();
  373. if (_ret === "break") break;
  374. }
  375. return css.walkDecls(function (decl, i) {
  376. if (_this2.disabled(decl, result)) return;
  377. var rule = decl.parent;
  378. var unprefixed = _this2.prefixes.unprefixed(decl.prop); // Transition
  379. if (decl.prop === 'transition' || decl.prop === 'transition-property') {
  380. _this2.prefixes.transition.remove(decl);
  381. } // Properties
  382. if (_this2.prefixes.remove[decl.prop] && _this2.prefixes.remove[decl.prop].remove) {
  383. var notHack = _this2.prefixes.group(decl).down(function (other) {
  384. return _this2.prefixes.normalize(other.prop) === unprefixed;
  385. });
  386. if (unprefixed === 'flex-flow') {
  387. notHack = true;
  388. }
  389. if (decl.prop === '-webkit-box-orient') {
  390. var hacks = {
  391. 'flex-direction': true,
  392. 'flex-flow': true
  393. };
  394. if (!decl.parent.some(function (j) {
  395. return hacks[j.prop];
  396. })) return;
  397. }
  398. if (notHack && !_this2.withHackValue(decl)) {
  399. if (decl.raw('before').includes('\n')) {
  400. _this2.reduceSpaces(decl);
  401. }
  402. rule.removeChild(i);
  403. return;
  404. }
  405. } // Values
  406. for (var _iterator5 = _this2.prefixes.values('remove', unprefixed), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
  407. var _ref5;
  408. if (_isArray5) {
  409. if (_i5 >= _iterator5.length) break;
  410. _ref5 = _iterator5[_i5++];
  411. } else {
  412. _i5 = _iterator5.next();
  413. if (_i5.done) break;
  414. _ref5 = _i5.value;
  415. }
  416. var checker = _ref5;
  417. if (!checker.check) continue;
  418. if (!checker.check(decl.value)) continue;
  419. unprefixed = checker.unprefixed;
  420. var _notHack = _this2.prefixes.group(decl).down(function (other) {
  421. return other.value.includes(unprefixed);
  422. });
  423. if (_notHack) {
  424. rule.removeChild(i);
  425. return;
  426. }
  427. }
  428. });
  429. }
  430. /**
  431. * Some rare old values, which is not in standard
  432. */
  433. ;
  434. _proto.withHackValue = function withHackValue(decl) {
  435. return decl.prop === '-webkit-background-clip' && decl.value === 'text';
  436. }
  437. /**
  438. * Check for grid/flexbox options.
  439. */
  440. ;
  441. _proto.disabledValue = function disabledValue(node, result) {
  442. if (this.gridStatus(node, result) === false && node.type === 'decl') {
  443. if (node.prop === 'display' && node.value.includes('grid')) {
  444. return true;
  445. }
  446. }
  447. if (this.prefixes.options.flexbox === false && node.type === 'decl') {
  448. if (node.prop === 'display' && node.value.includes('flex')) {
  449. return true;
  450. }
  451. }
  452. return this.disabled(node, result);
  453. }
  454. /**
  455. * Check for grid/flexbox options.
  456. */
  457. ;
  458. _proto.disabledDecl = function disabledDecl(node, result) {
  459. if (this.gridStatus(node, result) === false && node.type === 'decl') {
  460. if (node.prop.includes('grid') || node.prop === 'justify-items') {
  461. return true;
  462. }
  463. }
  464. if (this.prefixes.options.flexbox === false && node.type === 'decl') {
  465. var other = ['order', 'justify-content', 'align-items', 'align-content'];
  466. if (node.prop.includes('flex') || other.includes(node.prop)) {
  467. return true;
  468. }
  469. }
  470. return this.disabled(node, result);
  471. }
  472. /**
  473. * Check for control comment and global options
  474. */
  475. ;
  476. _proto.disabled = function disabled(node, result) {
  477. if (!node) return false;
  478. if (node._autoprefixerDisabled !== undefined) {
  479. return node._autoprefixerDisabled;
  480. }
  481. if (node.parent) {
  482. var p = node.prev();
  483. if (p && p.type === 'comment' && IGNORE_NEXT.test(p.text)) {
  484. node._autoprefixerDisabled = true;
  485. node._autoprefixerSelfDisabled = true;
  486. return true;
  487. }
  488. }
  489. var value = null;
  490. if (node.nodes) {
  491. var status;
  492. node.each(function (i) {
  493. if (i.type !== 'comment') return;
  494. if (/(!\s*)?autoprefixer:\s*(off|on)/i.test(i.text)) {
  495. if (typeof status !== 'undefined') {
  496. result.warn('Second Autoprefixer control comment ' + 'was ignored. Autoprefixer applies control ' + 'comment to whole block, not to next rules.', {
  497. node: i
  498. });
  499. } else {
  500. status = /on/i.test(i.text);
  501. }
  502. }
  503. });
  504. if (status !== undefined) {
  505. value = !status;
  506. }
  507. }
  508. if (!node.nodes || value === null) {
  509. if (node.parent) {
  510. var isParentDisabled = this.disabled(node.parent, result);
  511. if (node.parent._autoprefixerSelfDisabled === true) {
  512. value = false;
  513. } else {
  514. value = isParentDisabled;
  515. }
  516. } else {
  517. value = false;
  518. }
  519. }
  520. node._autoprefixerDisabled = value;
  521. return value;
  522. }
  523. /**
  524. * Normalize spaces in cascade declaration group
  525. */
  526. ;
  527. _proto.reduceSpaces = function reduceSpaces(decl) {
  528. var stop = false;
  529. this.prefixes.group(decl).up(function () {
  530. stop = true;
  531. return true;
  532. });
  533. if (stop) {
  534. return;
  535. }
  536. var parts = decl.raw('before').split('\n');
  537. var prevMin = parts[parts.length - 1].length;
  538. var diff = false;
  539. this.prefixes.group(decl).down(function (other) {
  540. parts = other.raw('before').split('\n');
  541. var last = parts.length - 1;
  542. if (parts[last].length > prevMin) {
  543. if (diff === false) {
  544. diff = parts[last].length - prevMin;
  545. }
  546. parts[last] = parts[last].slice(0, -diff);
  547. other.raws.before = parts.join('\n');
  548. }
  549. });
  550. }
  551. /**
  552. * Is it flebox or grid rule
  553. */
  554. ;
  555. _proto.displayType = function displayType(decl) {
  556. for (var _iterator6 = decl.parent.nodes, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
  557. var _ref6;
  558. if (_isArray6) {
  559. if (_i6 >= _iterator6.length) break;
  560. _ref6 = _iterator6[_i6++];
  561. } else {
  562. _i6 = _iterator6.next();
  563. if (_i6.done) break;
  564. _ref6 = _i6.value;
  565. }
  566. var i = _ref6;
  567. if (i.prop !== 'display') {
  568. continue;
  569. }
  570. if (i.value.includes('flex')) {
  571. return 'flex';
  572. }
  573. if (i.value.includes('grid')) {
  574. return 'grid';
  575. }
  576. }
  577. return false;
  578. }
  579. /**
  580. * Set grid option via control comment
  581. */
  582. ;
  583. _proto.gridStatus = function gridStatus(node, result) {
  584. if (!node) return false;
  585. if (node._autoprefixerGridStatus !== undefined) {
  586. return node._autoprefixerGridStatus;
  587. }
  588. var value = null;
  589. if (node.nodes) {
  590. var status;
  591. node.each(function (i) {
  592. if (i.type !== 'comment') return;
  593. if (GRID_REGEX.test(i.text)) {
  594. var hasAutoplace = /:\s*autoplace/i.test(i.text);
  595. var noAutoplace = /no-autoplace/i.test(i.text);
  596. if (typeof status !== 'undefined') {
  597. result.warn('Second Autoprefixer grid control comment was ' + 'ignored. Autoprefixer applies control comments to the whole ' + 'block, not to the next rules.', {
  598. node: i
  599. });
  600. } else if (hasAutoplace) {
  601. status = 'autoplace';
  602. } else if (noAutoplace) {
  603. status = true;
  604. } else {
  605. status = /on/i.test(i.text);
  606. }
  607. }
  608. });
  609. if (status !== undefined) {
  610. value = status;
  611. }
  612. }
  613. if (node.type === 'atrule' && node.name === 'supports') {
  614. var params = node.params;
  615. if (params.includes('grid') && params.includes('auto')) {
  616. value = false;
  617. }
  618. }
  619. if (!node.nodes || value === null) {
  620. if (node.parent) {
  621. var isParentGrid = this.gridStatus(node.parent, result);
  622. if (node.parent._autoprefixerSelfDisabled === true) {
  623. value = false;
  624. } else {
  625. value = isParentGrid;
  626. }
  627. } else if (typeof this.prefixes.options.grid !== 'undefined') {
  628. value = this.prefixes.options.grid;
  629. } else if (typeof process.env.AUTOPREFIXER_GRID !== 'undefined') {
  630. if (process.env.AUTOPREFIXER_GRID === 'autoplace') {
  631. value = 'autoplace';
  632. } else {
  633. value = true;
  634. }
  635. } else {
  636. value = false;
  637. }
  638. }
  639. node._autoprefixerGridStatus = value;
  640. return value;
  641. };
  642. return Processor;
  643. }();
  644. module.exports = Processor;