我有来自父应用程序的 css,我想在 shadow dom 制作的 web 组件中使用它。我不想将 css 从父应用程序复制到 web-component,但是现在 web-component 看不到父应用程序 css,我该怎么做?
parent app:
<style>
.pretty-button {
color: green
}
</style>
<body>
<button class="pretty-button">Got It</button>
<custom-element></custom-element>
</body>
web-component made by shadow dom:
<!--doesn't work because the shadow dom can't use parent css class-->
<body>
<button class="pretty-button">Got it from shadow dom</button>
</body>