Styled Jsx Resolve

Use styled-jsx/css resolve to style nested child components from a parent while preserving encapsulation. Use when you need to target a child component’s className from a parent.

majiayu000 8b8506c 2 files · 1.6 KB Updated 567 repo stars

File contents

styled-jsx resolve Skill

When a parent must style nested child components without leaking global CSS, use styled-jsx/css "resolve".

Rules

  1. Prefer passing props/variants to the child first.
  2. If the child is third-party or cannot be changed, prefer :global(...) in a narrow way.
  3. Use resolve only when it materially improves scoping and maintainability.

Output expectations

  • Show the parent code using resolve tags from styled-jsx/css.
  • Clearly indicate the scope class returned by resolve and where it is applied.
  • Add a brief test or story demonstrating the styling effect (as feasible).

majiayu000/claude-skill-registry-data/tree/main/design/styled-jsx-resolve commit 8b8506c219

Frequently asked questions

npx skillmds add majiayu000/styled-jsx-resolve