Styling
Menhir ships no styles. You can write each component's CSS yourself, or have a coding agent style them in one consistent look with the styling skill that comes in the package.
Styling a component yourself
Every part takes class and style, and exposes its state as data attributes that are present or absent, such as data-checked, data-open, data-selected and data-disabled. Keyboard focus is :focus-visible. Each component's page lists its parts and their attributes, with an example in Tailwind CSS and in plain CSS.
.switch[data-checked] {
background: steelblue;
}
.switch:focus-visible {
outline: 2px solid steelblue;
outline-offset: 2px;
}
.switch[data-disabled] {
opacity: 0.5;
}Popups are in the browser's top layer, so they need no portal and no z-index. Animate one opening with @starting-style on [data-open], and closing with the [data-closed] styles:
.popup {
transition:
opacity 150ms,
scale 150ms;
}
/* Entry: where the popup starts from when it opens. */
@starting-style {
.popup[data-open] {
opacity: 0;
scale: 0.95;
}
}
/* Exit: Menhir keeps the popup shown until this transition ends. */
.popup[data-closed] {
opacity: 0;
scale: 0.95;
}Looks
A look is a complete visual style for Menhir's components. It has three parts:
- Tokens: the look's named colours and radii, for light and dark, in one
tokens.css. - Recipes: the classes for each kind of part, such as buttons, the focus ring and popup surfaces.
- Worked examples: components styled from both, for the agent to start from.
The first look is the shadcn look, in Tailwind CSS v4, with worked examples of Switch, Dialog, Tabs and Popover. Each of those pages shows its example in the look, beside Tailwind CSS and CSS.
Give your agent the skill
The skill is in the package, at node_modules/menhir/skills/menhir-styling, so it matches the version you have installed. Agents do not look for skills there, so point yours at it with a line in the file it reads at the start, such as AGENTS.md or CLAUDE.md:
To style Menhir components, follow node_modules/menhir/skills/menhir-styling/SKILL.md.Or copy it into your agent's skills folder, here Claude Code's. A copy does not follow new releases; copy it again when you update menhir.
cp -r node_modules/menhir/skills/menhir-styling .claude/skills/Ask for a look
Name the look and the components in your request:
Style the Dialog and the Switch on the settings page in the shadcn look.
Give every Menhir component in this app the shadcn look.
Style the Accordion in the look the app already has.The agent then works in this order:
- It chooses the look: the one you name, or the one the app already has.
- It sets the look up, once per app: it adds the look's
tokens.css, putsdata-lookon<html>, and makes light and dark follow the CSScolor-scheme, which the Color Scheme utility sets. - It styles each component: from its worked example when the look has one, and otherwise from the look's recipes and the nearest worked example.
- It checks the result in the browser: each state, the open and close animations, keyboard focus and contrast, in both color schemes.
Because every component uses the same tokens and recipes, components styled weeks apart still match.
A look of your own
For a look that is not shipped, describe it or show it: a screenshot, a site, or your existing design system. The agent writes that look's tokens first, keeping the token names of the closest shipped look, and then styles the components from them.
Style our Menhir components to match this screenshot. Write the look's tokens first.Plain CSS instead of Tailwind CSS
A look is written in one technology; the shadcn look is in Tailwind CSS. When your app uses plain CSS, say so, and the agent translates the look's classes into it, token for token.