gajus / usus

Webpage pre-rendering service. ⚡️
Other
805 stars 33 forks source link

Pseudo classes missing from extracted CSS? #18

Open davidhund opened 6 years ago

davidhund commented 6 years ago

I noticed extractStyles and inlineStyles does not produce any pseudo classes. E.g. a:hover was left out.

I realize this is all not usus specific (but CSS Coverage) but I was wondering why. Also: for critical styles I would expect these to be included.

gajus commented 6 years ago

I realize this is all not usus specific (but CSS Coverage) but I was wondering why. Also: for critical styles I would expect these to be included.

This is definitely doable.

The reason it is not included is because browser never needed to use them. To make it include these styles, I would need to instruct Chrome to trigger "hover" for all elements in the DOM as part of the page loading.

This would be a separate option.

davidhund commented 6 years ago

I'm not sure if it's 'critical' but it could surely cause some a11y issues on slow loading pages.

PS: I can understand now why they're not included since they're all user-initiated state changes. Thanks!