knocklabs / javascript

Official JavaScript packages for interacting with Knock
https://knock.app/
MIT License
11 stars 2 forks source link

KnockFeedProvider style.css overrides style throughout project #17

Closed bradfier closed 5 months ago

bradfier commented 10 months ago

The styles set on the KnockFeedProvider have the side effect of forcing every descendent element of the provider (i.e. your entire app, if you follow the README instructions) to use Knock's font-family and box-sizing selection. The use of !important here adds to the effect and forces proliferation of the tag to override it.

If possible, could this be changed to only apply to elements with some rnf class rather than *?

https://github.com/knocklabs/react-notification-feed/blob/b601e88e403da7db3b699dd91b83773b7a8fcf4d/src/components/KnockFeedProvider/styles.css#L7-L10

bradfier commented 10 months ago

For anyone else finding this issue after wrestling with this CSS themselves, we were able to work around it by using 'rootless' mode, introduced in knocklabs/react-notification-feed#7.

It would still be great to either mention this in the Knock documentation, or to fix the defaults so they don't apply down the entire tree.

ShiftySlothe commented 7 months ago

I couldn't use the Container added in knocklabs/react-notification-feed#7 as children weren't correctly typed, opened knocklabs/react-notification-feed#46