robinweser / fela

State-Driven Styling in JavaScript
http://fela.js.org
MIT License
2.27k stars 182 forks source link

Elements with class "ad" (and others) are removed by ad blockers #314

Closed eliseumds closed 7 years ago

eliseumds commented 7 years ago

Version: 5.0.2 Environment: Both Type: Feature


Description

As already stated in this issue from Styletron, elements with the class name ad get removed by some ad blockers. A few others like facebook-icon, twitter-icon and social-icon are also affected.

Steps to reproduce

See this comment: https://github.com/rtsao/styletron/issues/139#issuecomment-305227895

Proposal

This could be fixed by a plugin like fela-monolithic but I suppose a built-in blacklist of classes would be more ideal since pretty much every dev would have to deal with it. To make it more future-proof, user could pass a custom generateClassName or a list of class names to avoid.

KittyGiraudel commented 7 years ago

As of right now, you can work around this issue by using the selectorPrefix option. Use any letter so blacklisted class names from AdBlockers are not being generated.