You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apparently _insertCss has an prepend option - not documented, unfortunately - that allows us to control the order of the styles as the default behaviour is for the last useStyles called - normally in the innermost child - to be appended at the end.
This example reverses the order which ensures that parents' - outermost then topmost - styles gets added in the end, therefore overriding the children's.
In the previous example we need to be careful when using the children outside their Overriding parent
<><OverrideAppBackgroundColor/>{/* This will cancel the override below */}<OverrrideOverrideAppBackgroundColor/>{/* This will get the same style as the one above */}</>
But it's better to not depend on it as things could get messy if OverrideAppBackgroundColor had override: true too. If that happens it might be worth it to consider loading the overriding styles in a higher component to control the order:
I've created a repository to reproduce the issue I am having. Please refer to the readme, which explains the issue.
https://github.com/allotrop3/isomorphic-style-loader-injection-issue
The text was updated successfully, but these errors were encountered: