root: missing scroll property

scrollbar: error when transparent
This commit is contained in:
bordun 2020-03-19 18:15:20 +01:00
parent a0882e655c
commit b63b3ebac7
2 changed files with 12 additions and 3 deletions

View file

@ -5,9 +5,17 @@ module.exports = (container)=>{
setTimeout(()=>{
var computedStyle = window.getComputedStyle(container),
color = computedStyle.getPropertyValue('--color-fill').trim(),
alpha = parseFloat(computedStyle.getPropertyValue('--alpha-scrollbar')),
alphaOn = parseFloat(computedStyle.getPropertyValue('--alpha-scrollbar-on'))
alphaOn = parseFloat(computedStyle.getPropertyValue('--alpha-scrollbar-on')),
color = computedStyle.getPropertyValue('--color-fill').trim()
if (color === 'transparent') {
// prevent chroma-js error
// irrelevant case, but still...
color = 'rgb(0, 0, 0)'
alpha = 0
alphaOn = 0
}
if (color) {
container.style.setProperty('--color-scrollbar', chroma(color).alpha(alpha).css())