isLessVariable.js 334 B

1234567891011121314
  1. 'use strict';
  2. const hasBlock = require('./hasBlock');
  3. /**
  4. * @param {import('postcss').AtRule | import('postcss-less').AtRule} atRule
  5. * @returns {boolean}
  6. */
  7. module.exports = function isLessVariable(atRule) {
  8. return (
  9. (atRule.type === 'atrule' && 'variable' in atRule && atRule.variable && !hasBlock(atRule)) ||
  10. false
  11. );
  12. };