[Bug]: Layout broken in shadow DOM because some tokens are only set in :root
#18240
Open
2 tasks done
Labels
package: @carbon/react
@carbon/react
role: dev 🤖
severity: 3
https://ibm.biz/carbon-severity
type: bug 🐛
Package
@carbon/react
Browser
No response
Package version
@carbon/react@npm:1.72.0
React version
react@npm:18.3.1
Description
When my React app is compiled and mounted in a shadow-DOM with styles mounted inside the shadow root (for obvious reasons) a lot of layouting is broken due to missing tokens.
I've tracked it down to this snippet that does the trick
There was and still is more stuff to handle, like…
Portal
-ed elements mount inside shadow root…but I felt like this warrants a report since I found out the solution, and it could maybe tight into something you have already going on.
Reproduction/example
Not easily done, but the report describes the root cause and solution
Steps to reproduce
Ditto… repro rather involved, but the solution is to widen any
:root
scoped selector to include:host
tooSuggested Severity
Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.
Application/PAL
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: