# Setting up charcoal styled

> Setting up charcoal styled is an open-source agent skill for developer tools. Guides wiring charcoal design tokens into an existing styled-components codebase. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/pixiv/charcoal/tree/main/skills/setting-up-charcoal-styled
- **Repository:** https://github.com/pixiv/charcoal
- **GitHub stars:** 380
- **License:** Apache-2.0
- **Skill name:** setting-up-charcoal-styled
- **Collection:** https://github.com/pixiv/charcoal
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill covers setting up the charcoal design system in projects already written with styled-components. It explains when the styled-components bindings are the wrong choice, since that package stays on Design Token 1.0 and pulls in the React component library as a peer. It walks through installing the matching major versions, wrapping the app in a theme provider alongside a token injector that emits CSS variables, and declaring the theme types for styled-components.

The guide also shows how to write components against the theme object, including the utility helpers for margin, padding, typography and focus rings, and lists the limits of those helpers such as the accepted font sizes and spacing scale. It includes an SSR-safe theme switching script and a migration path that moves a project off the styled-components layer step by step toward CSS variables.

Expected inputs are a React project using styled-components with the charcoal packages. The examples are written in TSX and TypeScript.

## When your agent uses it

> Use before writing or editing code that uses @charcoal-ui with styled-components, TokenInjector, createTheme or addThemeUtils, and whenever such a project's charcoal setup is unverified or incomplete.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/pixiv/charcoal/tree/HEAD/skills/setting-up-charcoal-styled)
- [License: Apache-2.0](https://github.com/pixiv/charcoal/tree/HEAD/skills/setting-up-charcoal-styled)

## Features

- **Setup and version pinning:** Covers installing the matching charcoal packages at major version 6 and the required peer dependency versions.
- **Theme provider and token injection:** Shows how to supply the JS theme object and emit CSS variables for light and dark modes.
- **Typed theme declarations:** Provides a module declaration that extends the styled-components default theme with charcoal types.
- **Theme utility helpers:** Describes the margin, padding, gap, typography and focus ring helpers and their accepted values.
- **SSR theme switching:** Explains a theme-setting script to inject into the page head to avoid flicker on load.
- **Migration path:** Lists ordered steps for moving away from styled-components and the deprecated createTheme API.

## Good for

- Add charcoal design tokens to an existing styled-components React app
- Set up light and dark theme switching with styled-components
- Write a styled component that uses charcoal spacing and typography
- Migrate a styled-components project toward charcoal CSS variables
- Fix a typography size that the theme utility helper rejects

## Install

### Claude Code

This skill ships in the `charcoal` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add pixiv/charcoal
/plugin install charcoal@charcoal
```

Or copy only this skill to `~/.claude/skills/setting-up-charcoal-styled`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pixiv/charcoal.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/setting-up-charcoal-styled &&
cp -R "$tmp/skills/setting-up-charcoal-styled" ~/.claude/skills/setting-up-charcoal-styled &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/setting-up-charcoal-styled` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/setting-up-charcoal-styled` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pixiv/charcoal.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/setting-up-charcoal-styled &&
cp -R "$tmp/skills/setting-up-charcoal-styled" ~/.agents/skills/setting-up-charcoal-styled &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/setting-up-charcoal-styled` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/setting-up-charcoal-styled` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pixiv/charcoal.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/setting-up-charcoal-styled &&
cp -R "$tmp/skills/setting-up-charcoal-styled" ~/.cursor/skills/setting-up-charcoal-styled &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/setting-up-charcoal-styled` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/pixiv/charcoal.git --path skills/setting-up-charcoal-styled
```

Or copy the folder to `~/.gemini/skills/setting-up-charcoal-styled` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/setting-up-charcoal-styled`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pixiv/charcoal.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/setting-up-charcoal-styled &&
cp -R "$tmp/skills/setting-up-charcoal-styled" ~/.copilot/skills/setting-up-charcoal-styled &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/setting-up-charcoal-styled` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/pixiv/charcoal.git
```

Then copy `charcoal/skills/setting-up-charcoal-styled` into your agent's skills folder as `setting-up-charcoal-styled`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Is Setting up charcoal styled suitable for a new project?

No. The skill recommends the CSS variables setup for new projects or when only tokens are needed, since the styled-components package is frozen at Design Token 1.0.

### Which packages does the setup require?

It installs @charcoal-ui/styled, @charcoal-ui/theme and @charcoal-ui/react at major version 6, with styled-components 5.1.1 or newer and React 17 or newer as peers.

### Why doesn't changing CSS variables switch the theme in styled components?

The JavaScript theme objects hold literal color values, so the ThemeProvider's theme prop must be swapped as well.

### Can I use font size 32 with the typography helper?

No. The helper accepts only 12, 14, 16 and 20, so the skill shows how to expand the size 32 values by hand.

### How do I install Setting up charcoal styled in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/setting-up-charcoal-styled to use it in all your projects, or to .claude/skills/setting-up-charcoal-styled in one project. Or install the charcoal plugin, which includes it: /plugin marketplace add pixiv/charcoal, then /plugin install charcoal@charcoal.

### Does Setting up charcoal styled run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Setting up charcoal styled?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Setting up charcoal styled?

The closest alternatives to Setting up charcoal styled are Setting up charcoal CSS variables, Choosing charcoal styling, Setting up charcoal tailwind, Choosing charcoal tokens and Expo design system.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Setting up charcoal CSS variables](https://ai-powered.com/skills/setting-up-charcoal-css-variables): Setting up charcoal CSS variables is an open-source agent skill for developer tools.
- [Choosing charcoal styling](https://ai-powered.com/skills/choosing-charcoal-styling): Choosing charcoal styling is an open-source agent skill for developer tools.
- [Setting up charcoal tailwind](https://ai-powered.com/skills/setting-up-charcoal-tailwind): Setting up charcoal tailwind is an open-source agent skill for developer tools.
- [Choosing charcoal tokens](https://ai-powered.com/skills/choosing-charcoal-tokens): Choosing charcoal tokens is an open-source agent skill for developer tools.
- [Expo design system](https://ai-powered.com/skills/expo-design-system-scaledockhq): Expo design system is an open-source agent skill for developer tools.
- [Design kit](https://ai-powered.com/skills/design-kit): Design kit is an open-source agent skill for design and media.
- [Design system](https://ai-powered.com/skills/design-system-daveebbelaar): Design system is an open-source agent skill for design and media.
- [Expo design system](https://ai-powered.com/skills/expo-design-system): Expo design system is an open-source agent skill for design and media.

---
Source: https://ai-powered.com/skills/setting-up-charcoal-styled
