Created
August 27, 2019 09:14
-
-
Save rowan-m/2f80b1a6ceb36acae93d3b2c51f8fbd7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// connectedCallback() | |
if (!this._container.part) { | |
// create a <span> | |
const wrapper = document.createElement('span'); | |
// move this element's child nodes into it | |
wrapper.append(...this.childNodes); | |
// add the classes | |
wrapper.classList.add('fallback'); | |
this.classList.add('fallback'); | |
// and add the wrapper into this element | |
this.append(wrapper); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment