node_modules/vite-plugin-theme/es/client.js
// Used to replace css color variables. Note that the order of the two arrays must be the same
Used to replace css color variables. Note that the order of the two arrays must be the same
Used to replace css color variables . Note that the order of the two arrays must be the same
async function replaceCssColors(css, colors, customCssHandler) {
    let retCss = css;
    const defaultOptions = getGlobalOptions('defaultOptions');
    const colorVariables = defaultOptions ? defaultOptions.colorVariables || [] : [];
    colorVariables.forEach(function (color, index) {
        const reg = new RegExp(color.replace(/,/g, ',\\s*').replace(/\s/g, '').replace('(', `\\(`).replace(')', `\\)`) +
            '([\\da-f]{2})?(\\b|\\)|,|\\s)?', 'ig');
        retCss = retCss.replace(reg, colors[index] + '$1$2').replace('$1$2', '');
        if (customCssHandler && typeof customCssHandler === 'function') {
            retCss = customCssHandler(retCss) || retCss;
        }
    });
    return retCss;
}
async function replaceCssColors ( css , colors , customCssHandler ) { let retCss = css ; const defaultOptions = getGlobalOptions ( 'defaultOptions' ) ; const colorVariables = defaultOptions ? defaultOptions . colorVariables || [ ] : [ ] ; colorVariables . forEach ( function ( color , index ) { const reg = new RegExp ( color . replace ( / , / g , ',\\s*' ) . replace ( / \s / g , '' ) . replace ( '(' , ` \\ ` ) . replace ( ')' , ` \\ ` ) + '([\\da-f]{2})?(\\b|\\)|,|\\s)?' , 'ig' ) ; retCss = retCss . replace ( reg , colors [ index ] + '$1$2' ) . replace ( '$1$2' , '' ) ; if ( customCssHandler && typeof customCssHandler === 'function' ) { retCss = customCssHandler ( retCss ) || retCss ; } } ) ; return retCss ; }
Used to replace css color variables.
Used to replace css color variables .