UNPKG

500 BJavaScriptView Raw
1'use strict';
2
3/**
4 * Check whether a node is logical combination (`:not`, `:has`, `:matches`)
5 *
6 * @param {import('postcss-selector-parser').Pseudo} node postcss-selector-parser node (of type pseudo)
7 * @return {boolean} If `true`, the combination is logical
8 */
9module.exports = function isLogicalCombination(node) {
10 if (node.type === 'pseudo') {
11 switch (node.value) {
12 case ':not':
13 case ':has':
14 case ':matches':
15 return true;
16 default:
17 return false;
18 }
19 }
20
21 return false;
22};