lit / lit/lit.dev

super.styles inherited from mixin returns void(0)

Open
#596 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
142
Forks
230
PR merge metrics
No merged PRs in 30d

Description

Like the title says: using `super.styles` (inside static styles) in a component that extends a mixin like `MYMixin(LitElement)` returns void(0)

Example visible in the Playground [highlighttable example](https://lit.dev/playground/#sample=docs/mixins/highlightable/)

![Screenshot 2021-12-01 185508](https://user-images.githubusercontent.com/4903900/144466813-d39ad36f-1bf0-462a-8a29-79ee15e908dc.png)

I see this with Chrome and Firefox
using:
```
"typescript": "^4.4.4",
"lit": "^2.0.2",
```

Discussion from slack lit&friends: [link](https://lit-and-friends.slack.com/archives/C03PF4L4L/p1638382590428800)
Elliot there asked me to file an issue.

Workaround: use super.styles only in a static function aka` static get styles () {...}`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the issue in the linked Lit Playground highlighttable example, comparing `super.styles` in a static styles field with the documented static getter workaround. Done means inherited `super.styles` no longer evaluates to `void(0)` in the mixin case.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.