Skip to content
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

Experimental adoptedStyleSheets #257

Open
2A5F opened this issue Jun 15, 2022 · 0 comments
Open

Experimental adoptedStyleSheets #257

2A5F opened this issue Jun 15, 2022 · 0 comments
Labels
announcement Content suitable for everyone

Comments

@2A5F
Copy link
Owner

2A5F commented Jun 15, 2022

#214 (comment)

For styling :

mounted() { var shadow_css = new CSSStyleSheet; shadow_css.replaceSync(YOUR_CSS) this.$el.shadowRoot.adoptedStyleSheets = [ shadow_css ]; }

61fc8ac

Experimental adoptedStyleSheets

const adoptedStyleSheets = new CSSStyleSheet()
adoptedStyleSheets.replace('p { color: green }')
<shadow-root :adopted-style-sheets="[adoptedStyleSheets]">
  <p>test adoptedStyleSheets</p>
</shadow-root>

result: p is green

@2A5F 2A5F added the announcement Content suitable for everyone label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
announcement Content suitable for everyone
Projects
None yet
Development

No branches or pull requests

1 participant