How to use the spritejs.stylesheet.fromDocumentCSS function in spritejs

To help you get started, we’ve selected a few spritejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Tencent / omi / packages / omi-sprite / src / index.js View on Github external
installed() {
    if(this.shadowRoot && this.shadowRoot.styleSheets) {
      stylesheet.fromDocumentCSS(this.shadowRoot.styleSheets)
    }
    let node = this
    while(node) {
      const styleSheets = node.styleSheets
      if(styleSheets) {
        stylesheet.fromDocumentCSS(styleSheets)
      }
      node = node.parentNode
    }
    this.scene = new Scene(this.container, this.props)
    render(this.scene, this.props.children)
  }
github Tencent / omi / packages / omi-sprite / src / index.js View on Github external
installed() {
    if(this.shadowRoot && this.shadowRoot.styleSheets) {
      stylesheet.fromDocumentCSS(this.shadowRoot.styleSheets)
    }
    let node = this
    while(node) {
      const styleSheets = node.styleSheets
      if(styleSheets) {
        stylesheet.fromDocumentCSS(styleSheets)
      }
      node = node.parentNode
    }
    this.scene = new Scene(this.container, this.props)
    render(this.scene, this.props.children)
  }