Skip to content

Experimental adoptedStyleSheets #257

@2A5F

Description

@2A5F

#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    announcementContent suitable for everyone

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions