summaryrefslogtreecommitdiff
path: root/node_modules/csso/cjs/clean/Declaration.cjs
blob: 92a2afbff107af64012d5c49b35bb7c03624f5a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict';

const cssTree = require('css-tree');

function cleanDeclartion(node, item, list) {
    if (node.value.children && node.value.children.isEmpty) {
        list.remove(item);
        return;
    }

    if (cssTree.property(node.property).custom) {
        if (/\S/.test(node.value.value)) {
            node.value.value = node.value.value.trim();
        }
    }
}

module.exports = cleanDeclartion;