Skip to content

Conversation

@rhildred
Copy link
Contributor

@rhildred rhildred commented Apr 5, 2025

When options.shadow == true, it would be helpful to add to adoptedStyleSheets so that one can have scoped css.

const sheet = new CSSStyleSheet(); sheet.replaceSync("h1 { color: blue; border: 2px dotted black;}"); register(App, "x-rich", [], {shadow:true, adoptedStyleSheets:[sheet]});
Copy link
Member

@rschristian rschristian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea, thanks! Sorry it took us so long to merge.

@rschristian rschristian merged commit 52daae4 into preactjs:master Sep 3, 2025
1 check passed
@rhildred
Copy link
Contributor Author

rhildred commented Sep 3, 2025

Thanks for this. I will test and delete my npm package when you make a new one.

This was referenced Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants