UNPKG

430 BJavaScriptView Raw
1'use strict';
2
3const _ = require('lodash');
4const hasBlock = require('../utils/hasBlock');
5
6/**
7 * Check whether a Node is a custom property set
8 *
9 * @param {import('postcss').Rule} node
10 * @returns {boolean}
11 */
12module.exports = function (node) {
13 const selector = _.get(node, 'raws.selector.raw', node.selector);
14
15 return (
16 node.type === 'rule' && hasBlock(node) && selector.startsWith('--') && selector.endsWith(':')
17 );
18};