-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
When we pass shadow : 'open'
or shadow : 'closed'
we would probably expect the styles to be included in the shadow root.
Is there any way to accomplish this?
.welcome {
color: red;
}
React component
import './Welcome.css';
export function Welcome(props: { name: string }) {
return <div>
<h1 className="welcome">Welcome, {props.name}!</h1>
<slot></slot>
</div>
}
export default Welcome;
To create the web component
const WelcomeWC = r2wc(Welcome, {
props: {
name: "string"
},
shadow: "open"
});
customElements.define("welcome-wc", WelcomeWC);
Usage
<welcome-wc>
</welcome-wc>
se-andbjo, MartinJaskulla, HighLiuk, maxd, chriszrc and 2 more
Metadata
Metadata
Assignees
Labels
No labels