GetComputedStyle () не индексирует пунктирные свойства в ChromeJavascript

Форум по Javascript
Anonymous
GetComputedStyle () не индексирует пунктирные свойства в Chrome

Сообщение Anonymous »

getComputedStyle () не перечисляет пунктирные свойства CSS в Chrome < /p>
:root {
--test: #000;
}
< /code>
let cs = window.getComputedStyle(document.documentElement);
// works
console.log(cs.getPropertyValue('--test'));

// doesn't work
for (let i of cs) {
if (i.indexOf('--') == 0) {
console.log(i);
}
}
< /code>
https://jsfiddle.net/4kLv716o/
I read the docs (https://googlechrome.github.io/samples/ ... index.html) and I tried SO suggestions. I want to fix the above snippet for Chrome.

Подробнее здесь: https://stackoverflow.com/questions/794 ... -in-chrome

Вернуться в «Javascript»