adoptStyles() {
        const styles = this.constructor._styles;
        if (styles.length === 0) {
            return;
        }
        // There are three separate cases here based on Shadow DOM support.
        // (1) shadowRoot polyfilled: use ShadyCSS
        // (2) shadowRoot.adoptedStyleSheets available: use it.
        // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after
        // rendering
        if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {
            window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);
        }
        else if (supportsAdoptingStyleSheets) {
            this.renderRoot.adoptedStyleSheets =
                styles.map((s) => s.styleSheet);
        }
        else {
            // This must be done after rendering so the actual style insertion is done
            // in `update`.
            this._needsShimAdoptedStyleSheets = true;
        }
    }
Applies styling to the element shadowRoot using the `static get styles`
property. Styling will apply using `shadowRoot.adoptedStyleSheets` where
available and will fallback otherwise. When Shadow DOM is polyfilled,
ShadyCSS scopes styles and adds them to the document. When Shadow DOM
is available but `adoptedStyleSheets` is not, styles are appended to the
end of the `shadowRoot` to [mimic spec
behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets).