setAtRuleParams.js 380 B

1234567891011121314151617181920
  1. 'use strict';
  2. /** @typedef {import('postcss').AtRule} AtRule */
  3. /**
  4. * @param {AtRule} atRule
  5. * @param {string} params
  6. * @returns {AtRule} The atRulearation that was passed in.
  7. */
  8. module.exports = function setAtRuleParams(atRule, params) {
  9. const raws = atRule.raws;
  10. if (raws.params) {
  11. raws.params.raw = params;
  12. } else {
  13. atRule.params = params;
  14. }
  15. return atRule;
  16. };