atRuleParamIndex.js 413 B

1234567891011121314151617181920
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports["default"] = _default;
  6. /**
  7. * Get the index of a media query's params
  8. *
  9. * @param {AtRule} atRule
  10. * @return {int} The index
  11. */
  12. function _default(atRule) {
  13. // Initial 1 is for the `@`
  14. var index = 1 + atRule.name.length;
  15. if (atRule.raw("afterName")) {
  16. index += atRule.raw("afterName").length;
  17. }
  18. return index;
  19. }