lit / lit-element

LEGACY REPO. This repository is for maintenance of the legacy LitElement library. The LitElement base class is now part of the Lit library, which is developed in the lit monorepo.
https://lit-element.polymer-project.org
BSD 3-Clause "New" or "Revised" License
4.49k stars 318 forks source link

Add `shadowRootOptions` for more easily customizing shadowRoot #1147

Closed sorvell closed 3 years ago

sorvell commented 3 years ago

Description

For forward compatibility will the next version of LitElement, static shadowRootOptions should be added. This is a slightly easier way to customize the renderRoot.

Instead of:

createRenderRoot() {
  return this.attachShadow({mode: 'open', delegatesFocus: true});
}

users can just do:

static shadowRootOptions: {mode: 'open', delegatesFocus: true};

Acceptance criteria

PR landed with feature.