You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
603 B
24 lines
603 B
|
2 years ago
|
'use strict';
|
||
|
|
|
||
|
|
const getPreviousNonSharedLineCommentNode = require('./getPreviousNonSharedLineCommentNode');
|
||
|
|
const hasBlock = require('./hasBlock');
|
||
|
|
const { isAtRule } = require('./typeGuards');
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param {import('postcss').AtRule} atRule
|
||
|
|
* @returns {boolean}
|
||
|
|
*/
|
||
|
|
module.exports = function isBlocklessAtRuleAfterBlocklessAtRule(atRule) {
|
||
|
|
if (atRule.type !== 'atrule') {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
const previousNode = getPreviousNonSharedLineCommentNode(atRule);
|
||
|
|
|
||
|
|
if (previousNode === undefined) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
return isAtRule(previousNode) && !hasBlock(previousNode) && !hasBlock(atRule);
|
||
|
|
};
|