Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

19 righe
644 B

  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = sameParent;
  6. function sameParent(ruleA, ruleB) {
  7. let hasParent = ruleA.parent && ruleB.parent;
  8. // Check for detached rules
  9. if (!hasParent) {
  10. return true;
  11. }
  12. // If an at rule, ensure that the parameters are the same
  13. if (ruleA.parent.type === 'atrule' && ruleB.parent.type === 'atrule') {
  14. return ruleA.parent.params === ruleB.parent.params && ruleA.parent.name.toLowerCase() === ruleB.parent.name.toLowerCase();
  15. }
  16. return ruleA.parent.type === ruleB.parent.type;
  17. }
  18. module.exports = exports['default'];