improvements & performance testing
This commit is contained in:
parent
a7d771e8c8
commit
6df28cde9d
5 changed files with 71 additions and 39 deletions
|
|
@ -8,8 +8,13 @@ import {
|
|||
import { defaultState } from '../../modules/config.js'
|
||||
|
||||
export const applyTheme = (input) => {
|
||||
const t0 = performance.now()
|
||||
const { rules, t3b } = generatePreset(input)
|
||||
const t1 = performance.now()
|
||||
const themes3 = init(sampleRules, t3b)
|
||||
const t2 = performance.now()
|
||||
console.log('Themes 2 initialization took ' + (t1 - t0) + 'ms')
|
||||
console.log('Themes 3 initialization took ' + (t2 - t1) + 'ms')
|
||||
const head = document.head
|
||||
const body = document.body
|
||||
body.classList.add('hidden')
|
||||
|
|
@ -24,7 +29,6 @@ export const applyTheme = (input) => {
|
|||
// styleSheet.insertRule(`:root { ${rules.shadows} }`, 'index-max')
|
||||
styleSheet.insertRule(`:root { ${rules.fonts} }`, 'index-max')
|
||||
themes3.css.forEach(rule => {
|
||||
console.log(rule)
|
||||
styleSheet.insertRule(rule, 'index-max')
|
||||
})
|
||||
body.classList.remove('hidden')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue