Reputation: 11
Lets say you have one stylesheet with the following declaration at the top:
a {color: black; color: rgba(255, 255, 255, 0.6)}
So if I run document.styleSheets[0].cssRules[0].cssText
I get back
a{color: rgba(255, 255, 255, 0.6)}
Is there any possibility to get all the styles and not just the computed?
Upvotes: 0
Views: 82
Reputation: 153274
No. cssText
is actually an accessor, like innerHTML
. Which means, you cannot recover any rules that the browser has eliminated. Unless you manually parse the CSS file. (...which I do not recommend. Why do you wanna do that anyway?)
Upvotes: 2