-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Using with Shadowed Web Components #202
Comments
I would need a more precise example of the desired behaviour. I'm having trouble understanding the use-case. Thanks |
Sorry, I got pulled into other things. I updated the question a bit and added more details. Does that help? |
I think what you are describing could be implemented as a simple plugin. It's not documented but the modern API of tss-react implements a plugin system. Main usecase is to implement global theme overwrite when tss-react is used with MUI. The plugin system is only available with the modern API though but the modern API is mutch better than the The way the plugin system work is by letting you provide a Line 16 in f7566d3
You can see the MUI plugin implementation here: You could intercept the |
When working with Web Components in Shadow mode, it is very common to define
:host
styles. They could be put in aGlobalStyles
, but because these are about styling the component itself, rather than say the html/body, putting them in aGlobalStyles
call breaks the usability of the tss-react pattern. These are not global styles in the idea of the term, but they do need to be treated as global when injected.Would it be possible for global-ish styles (technically created as globals, but conceptualized and used as local) to still be used in the local structure? This could be implemented as a specific exception to the
:host
keyword. It could also be implemented as a wrapper that is removed at runtime (such as:global(:host)
; this would have the added benefit of being usable with other elements that might want this behaviour. Either would work for me.An example from my project:
I need to use css something like this:
However, when putting it into makeStyles like this:
A prefix is still added to the
:host
key, resulting in something like.comet-1wpixln-Comet-:host
as the "class name", which is obviously not valid. I need that entry in the style object to stay as:host
without anything added to it.The text was updated successfully, but these errors were encountered: