
Setting up charcoal CSS variables
Sets up charcoal UI components with design tokens loaded as CSS variables
Setting up charcoal CSS variables is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 380
- Last commit
- License
- Apache-2.0
- Listing updated
Similar skills
About Setting up charcoal CSS variables
This skill walks an agent through wiring the charcoal React component library to its CSS variable theme. It covers installing matching major versions of the packages and their react-aria peers, loading the component and Design Token 2.0 light and dark stylesheets, and adding the opt-in class that makes the color tokens apply. Without that class, components keep their layout but lose all colors, so the skill treats that as the first thing to check.
The guidance also covers theme switching through a data-theme attribute, including an SSR script helper, and the known gap where the system theme does not follow the operating system's dark mode. It offers a CSS bridge for that case and notes when to use the layered stylesheet so project styles can override charcoal without specificity conflicts.
The skill is a set of instructions with no scripts. It expects a React project that uses npm and TypeScript or JSX, and it is useful both for new setups and for auditing an existing charcoal integration that looks unstyled.
When your agent uses it
Use before writing or editing any code that imports @charcoal-ui/react, and whenever a project's charcoal setup is unverified, incomplete or being finished. Charcoal components render completely unstyled unless BOTH @charcoal-ui/theme/css/v2/light.css is imported AND the .ch-token-v2 class is on <html>; importing dist/index.css alone, or adding the stylesheet without the class, silently produces correct geometry with no colors at all.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (6 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the charcoal plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add pixiv/charcoal
/plugin install charcoal@charcoalOr copy only this skill to ~/.claude/skills/setting-up-charcoal-css-variables:
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-css-variables &&
cp -R "$tmp/skills/setting-up-charcoal-css-variables" ~/.claude/skills/setting-up-charcoal-css-variables &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/setting-up-charcoal-css-variables inside it instead.
Copy the skill folder to ~/.agents/skills/setting-up-charcoal-css-variables to use it in every repository:
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-css-variables &&
cp -R "$tmp/skills/setting-up-charcoal-css-variables" ~/.agents/skills/setting-up-charcoal-css-variables &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/setting-up-charcoal-css-variables inside it instead.
Copy the skill folder to ~/.cursor/skills/setting-up-charcoal-css-variables to use it in every project:
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-css-variables &&
cp -R "$tmp/skills/setting-up-charcoal-css-variables" ~/.cursor/skills/setting-up-charcoal-css-variables &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/setting-up-charcoal-css-variables inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/pixiv/charcoal.git --path skills/setting-up-charcoal-css-variablesOr copy the folder to ~/.gemini/skills/setting-up-charcoal-css-variables yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/setting-up-charcoal-css-variables:
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-css-variables &&
cp -R "$tmp/skills/setting-up-charcoal-css-variables" ~/.copilot/skills/setting-up-charcoal-css-variables &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/setting-up-charcoal-css-variables inside it instead.
Get the folder:
git clone --depth 1 https://github.com/pixiv/charcoal.gitThen copy charcoal/skills/setting-up-charcoal-css-variables into your agent's skills folder as setting-up-charcoal-css-variables. Agents that support SKILL.md read one folder per skill.
What it does
- Stylesheet loading order
- Explains which charcoal CSS files to import and why the component stylesheet alone is not enough.
- Design token opt-in
- Shows how the ch-token-v2 class scopes Design Token 2.0 variables to the page or a subtree.
- Theme switching setup
- Covers setting data-theme at runtime and pre-paint script injection for server-rendered pages.
- System dark mode bridge
- Provides a CSS fallback so the page follows the operating system color scheme.
- Common mistakes table
- Lists frequent integration errors alongside their fixes for quick troubleshooting.
Good for
- Set up charcoal components in a new React project
- Fix charcoal buttons that render without colors
- Add light and dark theme switching to a charcoal app
- Make a charcoal page follow the OS dark mode setting
- Override charcoal component styles with project CSS
Setting up charcoal CSS variables FAQ
Do I need CharcoalProvider to use Button?
No. Button imports its own CSS and uses no context. CharcoalProvider is only needed when using overlays such as Modal or DropdownSelector.
Why do my charcoal components look right but have no color?
Usually only dist/index.css is loaded, or the ch-token-v2 class is missing. Colors come from CSS variables that only the theme stylesheets define, and the token rules apply only inside ch-token-v2.
Which major version should I install?
The skill targets version 6 of @charcoal-ui/react and @charcoal-ui/theme, and says all @charcoal-ui packages should share the same major version.
Does dark mode follow my system setting automatically?
Not by default. Removing data-theme for system mode leaves the page on light, so the skill describes adding a prefers-color-scheme CSS block.
How do I install Setting up charcoal CSS variables in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/setting-up-charcoal-css-variables to use it in all your projects, or to .claude/skills/setting-up-charcoal-css-variables 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 CSS variables 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 CSS variables?
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 CSS variables?
The closest alternatives to Setting up charcoal CSS variables are Setting up charcoal styled, Choosing charcoal styling, Setting up charcoal tailwind, Choosing charcoal tokens and Design system.
Where this comes from
- Description: from the skill's own SKILL.md.
More from pixiv/charcoal

Guides agents to pick and correctly set up pixiv's charcoal-ui styling routes
- Open source
- 380 GitHub stars
- Developer tools

Guides agents to pick the correct Charcoal design tokens instead of hardcoded values
- Open source
- 380 GitHub stars
- Developer tools

Builds a UI screen from a prepared Figma design pack and checks it against the spec
- Open source
- 380 GitHub stars
- Developer tools

Turns a Figma design or .fig export into structured files an agent can build from
- Open source
- 380 GitHub stars
- Design and media

Guides wiring charcoal design tokens into an existing styled-components codebase
- Open source
- 380 GitHub stars
- Developer tools

Sets up charcoal design tokens and classes in a Tailwind CSS project
- Open source
- 380 GitHub stars
- Developer tools

