lit / lit/lit.dev

Proposal: Add Style section on using parts & exportparts attribute

Open
#720 0 comments 1 reaction 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

When styling a LitElement, I wanted to expose some elements using parts, and it was a bit challenging to find the right information or examples.

Proposal is to add a section on using the `part` and `exportparts` attribute in the styles page.

Impact is users of Lit looking to expose an element in the shadow DOM for arbitrary styles can find a technique on our Styles page and be pointed in the right direction. Another impact is that my naive googling in the past to solve this problem always results in a suggestion of using `createRenderRoot`, and finding `part` on the styling page would have been preferred.

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

Start from the Styles page in the Lit website documentation and review how it presents styling techniques. Add a section covering the part and exportparts attributes, with guidance or examples for exposing shadow-DOM elements to arbitrary styles; it is done when users can find this technique there.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.