Код: Выделить всё
getComputedStyle()Я прочитал документы и попробовал это предложения. Я хочу исправить приведенный выше фрагмент для хрома.
Код: Выделить всё
let cs = window.getComputedStyle(document.documentElement);
// works
console.log('cs', cs.getPropertyValue('--test'));
// doesn't work in Chrome
for (let i of cs) {
if (i.indexOf('--') == 0) {
console.log('for let', i);
}
}< /code>
:root {
--test: #000;
}Подробнее здесь: https://stackoverflow.com/questions/794 ... -in-chrome
Мобильная версия