GetComputedStyle () indexiert gestrichelte Eigenschaften in Chrome nicht

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: GetComputedStyle () indexiert gestrichelte Eigenschaften in Chrome nicht

by Anonymous » 09 Mar 2025, 13:57

getComputedStyle () listet die gestrichelten CSS -Eigenschaften in Chrom nicht auf < /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.

Top