fixed oot selectors not working, added support for (webkit) scrollbars

This commit is contained in:
Henry Jameson 2024-02-18 20:11:06 +02:00
commit 13a289ac74
11 changed files with 214 additions and 23 deletions

View file

@ -26,7 +26,21 @@ export const applyTheme = (input) => {
styleSheet.toString()
styleSheet.insertRule(`:root { ${rules.fonts} }`, 'index-max')
themes3.css(themes3.eager).forEach(rule => {
styleSheet.insertRule(rule, 'index-max')
// Hack to support multiple selectors on same component
if (rule.match(/::-webkit-scrollbar-button/)) {
const parts = rule.split(/[{}]/g)
const newRule = [
parts[0],
', ',
parts[0].replace(/button/, 'thumb'),
' {',
parts[1],
'}'
].join('')
styleSheet.insertRule(newRule, 'index-max')
} else {
styleSheet.insertRule(rule, 'index-max')
}
})
body.classList.remove('hidden')
themes3.lazy.then(lazyRules => {