lit / lit/lit.dev

[docs] Improve top level Context example by adding html

Open
#1,186 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

It's not clear in the first Context example that the provider should be a parent of the consumer.

This results in a first experience where it's unclear how to arrange the producing and consuming elements. E.g., Placing the elements as siblings does not result in context being shared.

  <my-app></my-app>
  <my-element></my-element>

Instead, my-element (the consumer) must be a descendent of my-app. So the following works:

<my-app>
  <my-element></my-element>
</my-app>

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

Open the first Context example at the linked documentation anchor and compare its current element arrangement with the issue's HTML snippets. Clarify that the consumer must be nested inside the provider, include the working nested example, and confirm the example explains why sibling elements do not share context.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.