/** * Check if the less compiler is done rendering Less stylesheets into CSS. * * @returns {boolean} `true` if the rendering is complete, `false` otherwise. */ function isLessDone() { const lessSheets = document.querySelectorAll("link[rel=\"stylesheet/less\"]") const cssSheets = document.querySelectorAll("style") return lessSheets.length === cssSheets.length } /** * Pause an async function until {@link isLessDone Less is done}. * * @returns {Promise} Awaitable that waits until {@link isLessDone Less is done}. */ async function sleepUntilLessIsDone() { while(!isLessDone()) { await new Promise(resolve => setTimeout(resolve, 100)) console.debug("[Bluelib] Less seems to be done processing.") } } /** * List of stylesheet ids that should be enabled on page load. * * @type {string[]} */ const enabledByDefault = [ "less:dist-base:root", "less:dist-classic:root", "less:dist-glass:root", "less:dist-layouts-center:root", "less:dist-colors-royalblue:root", "less:dist-fonts-fira-ghpages:root", ] /** * List of all `