catppuccin_obsidian/node_modules/postcss-sorting/lib/getContainingNode.js
2022-10-07 16:22:01 -06:00

14 lines
349 B
JavaScript

module.exports = function getContainingNode(node) {
// For styled-components declarations are children of Root node
if (
node.type !== 'rule' &&
node.type !== 'atrule' &&
node.parent.document &&
node.parent.document.nodes &&
node.parent.document.nodes.some((item) => item.type === 'root')
) {
return node.parent;
}
return node;
};