mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-18 03:55:32 +00:00
29 lines
836 B
JavaScript
29 lines
836 B
JavaScript
// NOTICE: This file is generated by Rollup. To modify it,
|
|
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
|
|
'use strict';
|
|
|
|
const findNodeUpToRoot = require('./findNodeUpToRoot.cjs');
|
|
const typeGuards = require('./typeGuards.cjs');
|
|
const atKeywords = require('../reference/atKeywords.cjs');
|
|
|
|
/** @import { Declaration, Node } from 'postcss' */
|
|
|
|
/**
|
|
* Check whether a declaration is a descriptor one
|
|
*
|
|
* @param {Declaration} decl
|
|
* @returns {boolean}
|
|
*/
|
|
function isDescriptorDeclaration(decl) {
|
|
return Boolean(findNodeUpToRoot(decl, isAtRuleSupportingDescriptors));
|
|
}
|
|
|
|
/**
|
|
* @param {Node} node
|
|
*/
|
|
function isAtRuleSupportingDescriptors(node) {
|
|
return typeGuards.isAtRule(node) && !atKeywords.nestingSupportedAtKeywords.has(node.name.toLowerCase());
|
|
}
|
|
|
|
module.exports = isDescriptorDeclaration;
|