src/transform-css.js
function resolveFunc(value) {
        const name               = value.split(',')[0].replace(/[\s\n\t]/g, '');
        const fallback           = (value.match(/(?:\s*,\s*){1}(.*)?/) || [])[1];
        const match              = settings.variables.hasOwnProperty(name) ? String(settings.variables[name]) : undefined;
        const replacement        = match || (fallback ? String(fallback) : undefined);
        const unresolvedFallback = __recursiveFallback || value;

        if (!match) {
            settings.onWarning(`variable "${name}" is undefined`);
        }

        if (replacement && replacement !== 'undefined' && replacement.length > 0) {
            return resolveValue(replacement, settings, unresolvedFallback);
        }
        else {
            return `var(${unresolvedFallback})`;
        }
    }
function resolveFunc(value) {
        const name               = value.split(',')[0].replace(/[\s\n\t]/g, '');
        const fallback           = (value.match(/(?:\s*,\s*){1}(.*)?/) || [])[1];
        const match              = settings.variables.hasOwnProperty(name) ? String(settings.variables[name]) : undefined;
        const replacement        = match || (fallback ? String(fallback) : undefined);
        const unresolvedFallback = __recursiveFallback || value;

        if (!match) {
            settings.onWarning(`variable "${name}" is undefined`);
        }

        if (replacement && replacement !== 'undefined' && replacement.length > 0) {
            return resolveValue(replacement, settings, unresolvedFallback);
        }
        else {
            return `var(${unresolvedFallback})`;
        }
    }
function resolveFunc ( value ) { const name = value . split ( ',' ) [ 0 ] . replace ( / [\s\n\t] / g , '' ) ; const fallback = ( value . match ( / (?:\s*,\s*){1}(.*)? / ) || [ ] ) [ 1 ] ; const match = settings . variables . hasOwnProperty ( name ) ? String ( settings . variables [ name ] ) : undefined ; const replacement = match || ( fallback ? String ( fallback ) : undefined ) ; const unresolvedFallback = __recursiveFallback || value ; if ( ! match ) { settings . onWarning ( ` ${ name } ` ) ; } if ( replacement && replacement !== 'undefined' && replacement . length > 0 ) { return resolveValue ( replacement , settings , unresolvedFallback ) ; } else { return ` ${ unresolvedFallback } ` ; } }
Resolves contents of CSS custom property function

@param {string} value String containing contents of CSS var() function
@returns {string}

@example

resolveFunc('--x, var(--y, green)')
// => obj['--x'] or obj['--y'] or 'green'

resolveFunc('--fail')
// => 'var(--fail)' when obj['--fail'] does not exist
Resolves contents of CSS custom property function