Styled Jsx Global

Add or refactor global styles using styled-jsx (<style jsx global>). Use for resets, typography defaults, global tokens, and safe one-off global selectors.

majiayu000 f1d5892 2 files · 1.9 KB Updated 567 repo stars

File contents

styled-jsx Global Styles Skill

Use styled-jsx global styling responsibly.

Rules

  1. Prefer component-scoped styles. Use global styles only when truly global.
  2. Prefer CSS variables for tokens (color, spacing, typography) over global tag styling.
  3. Avoid heavy global resets unless the project already uses them.
  4. If adding a one-off global selector, keep it narrow and well-commented.

Output expectations

  • Create/modify:
    • src/pages/_app.tsx or src/pages/_document.tsx (Next.js) OR
    • a top-level Layout component OR
    • the requested file
  • Include a short explanation of what is global and why.

Patterns

  • Global tokens:
    :root { --color-bg: ...; --space-2: ...; }
    
  • Global typography:
    body { font-family: ...; }
    
  • One-off escape hatch:
    <style jsx global>{`
      .third-party-class { ... }
    `}</style>
    

majiayu000/claude-skill-registry-data/tree/main/design/styled-jsx-global commit f1d5892dd0

Frequently asked questions

npx skillmds add majiayu000/styled-jsx-global