atRuleParamIndex.js 301 B

12345678910111213141516
  1. 'use strict';
  2. /**
  3. * @param {import('postcss').AtRule} atRule
  4. * @returns {number}
  5. */
  6. module.exports = function atRuleParamIndex(atRule) {
  7. // Initial 1 is for the `@`
  8. let index = 1 + atRule.name.length;
  9. if (atRule.raws.afterName) {
  10. index += atRule.raws.afterName.length;
  11. }
  12. return index;
  13. };