I have a React component that is embedded in other webpages (i.e. through an extension or as a third-party embedded tool).
Most of its style classes are creates using JSS, and these get unique class names which can't be overridden by the including page.
However, some of our elements are generic ones (e.g. <p>, <button>, <h1>, <h2>, etc.) that we must use for accessibility reasons (e.g. screen readers require <hX> hierarchical headings, and it is hard to avoid using buttons). These elements' styles are often overridden by the including page's style, if this page uses element selectors for these elements.
I tried encapsulating the React component using a Shadow DOM but it seems non-trivial, mainly because it seems to prevent React from operating correctly (click events aren't being passed, etc.). react-shadow (https://github.com/Wildhoney/ReactShadow) doesn't seem to work either.
Is there a way to protect these elements' style from being overridden?