Skip to content

Use a decorator for applyTheme #2608

Open
@tomivirkki

Description

@tomivirkki

Description

Currently, the following snippet is included in each Lit example. The snippet is verbose and not related to the component being demoed.

protected override createRenderRoot() {
  const root = super.createRenderRoot();
  // Apply custom theme (only supported if your app uses one)
  applyTheme(root);
  return root;
}

Consider wrapping the above functionality inside a decorator, which could then be applied to the Lit examples with:

@applyTheme // hidden-source-line
@customElement('button-basic')
export class Example extends LitElement {

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions