import parseHTML from './parse-html.mjs';
import { MasterCSS } from '@master/css';

/**
 * Renders the Master CSS string from HTML
 * @param html
 * @param config
 * @returns MasterCSS
 */ function renderCSS(html, config) {
    if (!html) return;
    const { classes } = parseHTML(html);
    if (!classes.length) return;
    const css = new MasterCSS(config);
    classes.forEach((eachClass)=>css.add(eachClass));
    return css;
}

export { renderCSS as default };
