lit / lit/lit.dev

[tutorial] Shadow DOM styling

Open
#870 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

- If you're playing along at home, you've already met scoped styles in our intro tutorial, right?
- Styling the host with `:host`
- Conditionally styling the host with `:host()`
- And a digression about properties with `reflect: true`.
- Or allowing users to set classes/attributes from the outside.
- Maybe some discussion of whether you should set classes on the host, or not.
- Styling slotted children
- There are many limitations, but it can still be handy.
- Selecting the child.
- Selecting the slot.
- Maybe refer people to "Interacting with slotted children" for more complicated stuff, like possibly setting a class on a slotted child.

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

The issue is an outline for a Shadow DOM styling tutorial, covering :host, conditional host styling, reflected properties, classes and attributes, and slotted children. Start by locating the intro tutorial and the existing “Interacting with slotted children” material; done means the listed topics are explained with examples and the more complex slotted-child behavior is linked appropriately.

Written by the indexing model from the issue text.

Assessment

Domain
documentation, web-dev
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.