R
Reactiflux

Adi – 15-38 Jun 20

Adi – 15-38 Jun 20

AAdi6/20/2022
I am injecting JS widget script on webpage which loads JS as well styles for widget. Code is injected inside body tag but how can I make sure widget does not inherits CSS from body tag? How can I isolate widget from other web page CSS?? Note: I don't want to use iframe. Any other possible solutions?
SScriptyChris6/20/2022
you could put the widget into <iframe> so it won't inherit styles from already existing CSS if iframe is not an option then i guess you would have to manually exclude styles? like, you could try querying all your widget elements and put them all: unset style so they should have default values, instead of inherited from any CSS https://developer.mozilla.org/en-US/docs/Web/CSS/all (i think revert or initial will be better instead of unset, because it fallbacks to inherited stuff, which you want to avoid)
UUUnknown User6/21/2022
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

R
Reactiflux

Adi – 15-38 Jun 20

Join Server