more optimizations, execution is now split into eager (for main UI) and

lazy (for modals, popovers etc) parts
This commit is contained in:
Henry Jameson 2024-02-15 20:20:27 +02:00
commit 96e3a1593a
13 changed files with 156 additions and 51 deletions

View file

@ -28,11 +28,17 @@ export const applyTheme = (input) => {
// styleSheet.insertRule(`:root { ${rules.colors} }`, 'index-max')
// styleSheet.insertRule(`:root { ${rules.shadows} }`, 'index-max')
styleSheet.insertRule(`:root { ${rules.fonts} }`, 'index-max')
themes3.css.forEach(rule => {
console.log(rule)
themes3.css(themes3.eager).forEach(rule => {
styleSheet.insertRule(rule, 'index-max')
})
body.classList.remove('hidden')
themes3.lazy.then(lazyRules => {
themes3.css(lazyRules).forEach(rule => {
styleSheet.insertRule(rule, 'index-max')
})
const t3 = performance.now()
console.log('Themes 3 finalization took ' + (t3 - t2) + 'ms')
})
}
const configColumns = ({ sidebarColumnWidth, contentColumnWidth, notifsColumnWidth, emojiReactionsScale }) =>