css-ratiocinator icon indicating copy to clipboard operation
css-ratiocinator copied to clipboard

Include styles for states (e.g. :hover)

Open begriffs opened this issue 13 years ago • 2 comments
trafficstars

See docs for window.getComputedStyle

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

begriffs avatar Nov 09 '12 18:11 begriffs

This: http://stackoverflow.com/questions/311052/setting-css-pseudo-class-rules-from-javascript and this: http://stackoverflow.com/questions/1285033/read-hover-pseudo-class-with-javascript/1285212#1285212 Seem to suggest that there is no really solution to this...

Surely you can access the CSS stylesheet itself somehow and read it out, however, this would defeat what css-ratiocinator is all about, as far as I understand it.

I'll try to find the time to see how Webkit does that in the Developers Tools pane, it might give a hint for a solution.

So, bottom line, nothing to contribute, but left this comment however, to follow up if someone comes with a proper solution :)

AvnerCohen avatar Dec 30 '12 18:12 AvnerCohen

Looks like PhantomJS can simulate a real mouse-over event that we can use to check :hover style.

https://github.com/ariya/phantomjs/wiki/API-Reference-WebPage#wiki-webpage-sendEvent

begriffs avatar Feb 09 '13 20:02 begriffs