Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

namespace option on StyleSheetManager better match babel-plugin-styled-components-css-namespace #3945

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

marmite22
Copy link
Contributor

I've modified the behaviour of the namespace option on StyleSheetManager so that it doesn't prefix global stye rules added via createGlobalStyle.

This more closely matches the behaviour in the babel-plugin-styled-components-css-namespace which was the previous way to namespace/isolate styles.

I think it's better to do things this way around rather than providing some option to stop the global styles getting prefixed. This way they are never prefixed and if you want to prefix them it would just be a case of manually adding your prefix to any global styles you write.

…t prefix global styes added via createGlobalStyle to match how it was handled in `babel-plugin-styled-components-css-namespace`
@quantizor
Copy link
Contributor

This actually doesn't match the design goal of the feature. The object is to prefix all styles for a subtree. This is commonly used when deploying micro-frontends for isolation or as a global precedence boost when deploying a 3rd party widget on a destination site.

We could add additional configuration to support your case, but I do think it's currently working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants