Agent skill

CSS Modules

by Opentrons in Opentrons/opentrons

CSS Modules conventions, Stylelint rules, design tokens (spacing, colors, typography, border-radius), and patterns for the Opentrons monorepo.

Apache-2.0Auto-check passedFrontend & Design

Install CSS Modules

skills CLI
$ npx skills add Opentrons/opentrons --skill css-modules -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Opentrons/opentrons css-modules --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Opentrons/opentrons.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/css-modules .claude/skills/css-modules && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
css-modules
GitHub stars
521
Token cost
~2.2k tokens
SKILL.md length
578 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

CSS Modules conventions, Stylelint rules, design tokens (spacing, colors, typography, border-radius), and patterns for the Opentrons monorepo.

  • Working with .module.css files
  • SKILL.md covers File Naming, Class Naming, Importing in Components and Dynamic Styling with clsx, plus 8 more sections
  • Calls make and pnpm
  • Styling React components in app/

What it does

CSS Modules is an agent skill from Opentrons/opentrons. CSS Modules conventions, Stylelint rules, design tokens (spacing, colors, typography, border-radius), and patterns for the Opentrons monorepo. Use when working with .module.css files or styling React components in app/, components/, protocol-visualization/, protocol-designer/, or other JS packages.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design, covering Design tokens, Typography and React components. The repository describes itself as: Software for writing protocols and running them on the Opentrons Flex and Opentrons OT-2. The licence is Apache-2.0.

When your agent uses it

  • Working with .module.css files
  • Styling React components in app/
  • Protocol-visualization/
  • Protocol-designer/

Example prompts

  • “/css-modules”

What it can do on your machine

Read from SKILL.md and the folder at commit a14fef9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • make
    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

CSS Modules loads about 2.2k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 578 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~78
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Opentrons/opentrons at commit a14fef9, republished under its Apache-2.0 licence (© Opentrons). 578 words, ~2,209 tokens.

Download SKILL.mdSave it as .claude/skills/css-modules/SKILL.md (or your agent's skills folder).
name
css-modules
description
CSS Modules conventions, Stylelint rules, design tokens (spacing, colors, typography, border-radius), and patterns for the Opentrons monorepo. Use when working with .module.css files or styling React components in app/, components/, protocol-visualization/, protocol-designer/, or other JS packages.

CSS Modules — Opentrons Conventions

File Naming

File names are lowercase, no separators, suffixed with .module.css, and match the component name:

markdown
ComponentName/
├── index.tsx
├── componentname.module.css
└── **tests**/
└── ComponentName.test.tsx

Examples: navbar.module.css, labwarebutton.module.css, textareafield.module.css

Class Naming

Stylelint enforces the pattern /^[a-z0-9_]+$/ — snake_case only (lowercase letters, digits, underscores).

Use a component_element or element_modifier structure:

css
/* Base classes */
.button {
}
.slider_container {
}
.crumb_link {
}

/* State/modifier variants */
.button_active {
}
.textarea_error {
}
.title_text_center {
}
.crumb_link_inactive {
}

Importing in Components

tsx
import styles from './componentname.module.css'

export function MyComponent(): JSX.Element {
  return <div className={styles.wrapper}>content</div>
}

Dynamic Styling with clsx

Use clsx for combining or conditionally applying classes:

tsx
import clsx from 'clsx'

import styles from './componentname.module.css'

export function MyButton({ isActive, isError }: Props): JSX.Element {
  const className = clsx(styles.button, {
    [styles.button_active]: isActive,
    [styles.button_error]: isError,
  })
  return <button className={className}>Click</button>
}

Design Tokens (CSS Custom Properties)

All tokens are defined in components/src/styles/global.css. Always use these variables instead of hard-coding values for colors, spacing, typography, and border-radius.

Spacing
VariableValue
--spacing-20.125rem (2px)
--spacing-40.25rem (4px)
--spacing-60.375rem (6px)
--spacing-80.5rem (8px)
--spacing-100.625rem (10px)
--spacing-120.75rem (12px)
--spacing-161rem (16px)
--spacing-201.25rem (20px)
--spacing-241.5rem (24px)
--spacing-322rem (32px)
--spacing-402.5rem (40px)
--spacing-442.75rem (44px)
--spacing-483rem (48px)
--spacing-603.75rem (60px)
--spacing-684.25rem (68px)
--spacing-805rem (80px)
--spacing-1207.5rem (120px)
Colors

Core: --white (#fff), --black-90 (#16212d), --black-80 (#24313f), --black-70 (#39495b)

Grey: --grey-10 through --grey-60 (10, 20, 30, 35, 40, 50, 55, 60)

Blue: --blue-10 through --blue-60 (10, 20, 30, 35, 40, 50, 55, 60)

Purple: --purple-20 through --purple-60 (20, 30, 35, 40, 50, 55, 60)

Green: --green-20 through --green-60 (20, 30, 35, 40, 50, 60)

Red: --red-20 through --red-60 (20, 30, 35, 40, 50, 55, 60)

Yellow: --yellow-20 through --yellow-60 (20, 30, 35, 40, 50, 60)

Flex brand: --flex-20 through --flex-60 (20, 30, 35, 40, 50, 55, 60)

Semi-transparent white: --transparent-white-20 through --transparent-white-80 (20, 30, 50, 80)

Semi-transparent black: --transparent-black-10 through --transparent-black-80 (10, 20, 30, 40, 50, 60, 80)

transparent: --transparent

Some colors (green, purple) have touchscreen variants that activate when components/src/styles/global.css applies the .enable_touchscreen_colors class. The default values are non-touchscreen.

Border Radius

--border-radius-2, --border-radius-4, --border-radius-8, --border-radius-12, --border-radius-16, --border-radius-40, --border-radius-full (pill/circle)

Typography

Font size: --font-size-9, --font-size-10, --font-size-11, --font-size-12, --font-size-13, --font-size-14, --font-size-15, --font-size-16, --font-size-18, --font-size-19, --font-size-20, --font-size-22, --font-size-23, --font-size-24, --font-size-26, --font-size-28, --font-size-32, --font-size-38, --font-size-39, --font-size-80

Font weight: --font-weight-light (300), --font-weight-regular (400), --font-weight-semi-bold (600), --font-weight-bold (700)

Line height: --line-height-12, --line-height-16, --line-height-18, --line-height-20, --line-height-24, --line-height-28, --line-height-36, --line-height-42, --line-height-48, --line-height-96

Show full SKILL.md (255 more words)Show less

Where to Use Tokens vs Explicit Values

PropertyUse token?Example
color, background-color, border-colorYesvar(--blue-50)
padding, margin, gapYesvar(--spacing-16)
border-radiusYesvar(--border-radius-8)
font-sizeYesvar(--font-size-p)
font-weightYesvar(--font-weight-semi-bold)
line-heightYesvar(--line-height-20)
width, height, max-width, min-heightNo — use explicit rem15rem, 100vh
box-shadowNo — use px0 0 0 2px var(--blue-50)

Unit Rules

  • rem for all dimensions — divide design-spec px by 16 (240px / 16 = 15rem)
  • px only for box-shadow values and <img> tag dimensions
  • Prefer padding over margin for wrapper and container elements
  • Avoid complex calc() expressions

State & Pseudo-Class Handling

css
.button:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--blue-50);
}

.button:hover:not(:disabled) {
  background-color: var(--grey-10);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input:focus {
  border-color: var(--blue-50);
}

Always guard hover styles with :not(:disabled) on interactive elements.

CSS Modules Features

Composition

Stylelint allows the composes property for class composition:

css
.base_button {
  padding: var(--spacing-8) var(--spacing-16);
  border-radius: var(--border-radius-4);
}

.primary_button {
  composes: base_button;
  background-color: var(--blue-50);
  color: var(--white);
}
Global Selectors

Use :global() to target non-module classes (e.g., from React Router or third-party libraries):

css
.nav_link:global(.active) {
  color: var(--blue-50);
}

Stylelint Configuration

The repo uses stylelint-config-standard + stylelint-config-idiomatic-order (property ordering). Key enforced rules:

  • Class selector pattern: /^[a-z0-9_]+$/
  • Max 4 decimal places for numbers (except dimension properties like width, height, flex)
  • Standard CSS property ordering (idiomatic order)
  • @value at-rule is still allowed but deprecated — avoid in new code
Tips: Common Stylelint Fixes

Zero lengths must have no unit (length-zero-no-unit):

css
/* ✖ Unexpected unit */
box-shadow: 0px 3px 6px rgb(0 0 0 / 23%);

/* ✔ Use bare 0 — no px/rem/etc. */
box-shadow: 0 3px 6px rgb(0 0 0 / 23%);

Use modern rgb notation (color-function-alias-notation, color-function-notation):

css
/* ✖ rgba + comma-separated args are legacy */
box-shadow: 0 3px 6px rgba(0, 0, 0, 23%);

/* ✔ Prefer rgb with space-separated channels and / alpha */
box-shadow: 0 3px 6px rgb(0 0 0 / 23%);

Linting and Formatting

bash
# Lint all CSS
make lint-css

# Auto-fix all CSS
make format-css

# Lint a single file
pnpm stylelint path/to/componentname.module.css

# Auto-fix a single file
pnpm stylelint path/to/componentname.module.css --fix

Always run make lint-css and fix any issues before committing.

Legacy Patterns (Do Not Introduce)

  • components/src/styles/borders.module.css — old border tokens (--bd-radius-*, --bd-width-*, --shadow-lvl-*). Use global.css tokens instead.
  • components/src/styles/typography.module.css — old typography tokens (--fs-*, --fw-*, --lh-*). Use global.css tokens instead.
  • styled-components — the codebase is migrating away. Always use CSS Modules for new styles.
  • @value declarations — still parsed by stylelint but deprecated. Use CSS custom properties.

© Opentrons, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .cursor/skills/css-modules of Opentrons/opentrons.

Open the folder on GitHubat commit a14fef9

Compare with similar skills

CSS Modules next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

CSS Modules compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
CSS Modules this skillOpentrons/opentrons521—~2.2kAutomated safety check: PassApache-2.0
Skillshare UI Website StyleJetBrains/skills364—~3.1kAutomated safety check: PassNone
Tailwindcss Developmentanonaddy/anonaddy4.9k10 repos~865Automated safety check: PassMIT
Design SystemOhh-889/skyroc79511 repos~1.7kAutomated safety check: PassMIT
Stitch Taste Design Systemgoogle-labs-code/stitch-skills8.4k15 repos~3.1kAutomated safety check: PassApache-2.0
Scalar Design Systemscalar/scalar16k—~2.7kAutomated safety check: PassMIT

Similar skills

  • Official

    Skillshare frontend design system for the React dashboard (ui/) and Docusaurus website (website/).

    364 GitHub stars~3.1k tokensUpdated 3 mo ago
    Frontend & DesignAuto-check passed
  • Tailwindcss Development

    anonaddy/anonaddy

    Always invoke when the user's message includes 'tailwind' in any form.

    4.9k GitHub starsUsed in 10 repos~865 tokens
    Frontend & DesignAuto-check passed
  • Design System

    Ohh-889/skyroc

    Token architecture, component specifications, and slide generation.

    795 GitHub starsUsed in 11 repos~1.7k tokens
    Frontend & DesignAuto-check passed
  • Stitch Taste Design System

    google-labs-code/stitch-skills

    Official

    Generates a DESIGN.md design-language file for Google Stitch that encodes color, typography, layout, component behavior and motion rules to avoid generic AI-looking UI.

    8.4k GitHub starsUsed in 15 repos~3.1k tokens
    Frontend & DesignAuto-check passed
  • Scalar's design system — design tokens, theming (@scalar/themes), CSS variables, and the @scalar/components library.

    16k GitHub stars~2.7k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Design Guide

    paperclipai/paperclip

    Paperclip UI design system guide for building consistent, reusable frontend components.

    99k GitHub starsUsed in 1 repo~3.1k tokens
    Frontend & DesignAuto-check passed

More from Opentrons/opentrons

All 17 skills in this repo
  • AI Client

    Opentrons/opentrons

    Conventions for the opentrons-ai-client React/TypeScript frontend — project structure, API integration, state management (Jotai), feature flags, types, and testing.

    521 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • AI Server

    Opentrons/opentrons

    Conventions for the opentrons-ai-server FastAPI service — project structure, uv dependency management, settings, testing, Docker, and deployment.

    521 GitHub stars~2.5k tokensUpdated today
    Auto-check: notes
  • Analyses Snapshot Testing

    Opentrons/opentrons

    Conventions for the analyses snapshot testing framework in analyses-snapshot-testing/.

    521 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Docs

    Opentrons/opentrons

    Authoring and styling guidelines for the Opentrons /docs MkDocs project.

    521 GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • E2E Testing

    Opentrons/opentrons

    E2E testing conventions for Protocol Designer and Labware Library using Playwright + pytest in e2e-testing/.

    521 GitHub stars~3k tokensUpdated today
    Auto-check: notes
  • JS Package Testing

    Opentrons/opentrons

    Vite demo and Playwright + Applitools tests for packed @opentrons JS packages in js-package-testing/.

    521 GitHub stars~1.2k tokensUpdated today
    Auto-check: notes

Questions about CSS Modules

What does CSS Modules do?

CSS Modules conventions, Stylelint rules, design tokens (spacing, colors, typography, border-radius), and patterns for the Opentrons monorepo. CSS Modules is an agent skill from Opentrons/opentrons. CSS Modules conventions, Stylelint rules, design tokens (spacing, colors, typography, border-radius), and patterns for the Opentrons monorepo.

When should I use CSS Modules?

CSS Modules fits situations like: working with .module.css files; styling React components in app/; protocol-visualization/; protocol-designer/.

How do I install CSS Modules in Claude Code?

Run `npx skills add Opentrons/opentrons --skill css-modules -a claude-code`. Or copy the skill folder (.cursor/skills/css-modules in Opentrons/opentrons) into .claude/skills/css-modules in your project. Claude Code loads it when a task matches its description.

How do I install CSS Modules in Codex?

Run `npx skills add Opentrons/opentrons --skill css-modules -a codex`. Or copy the skill folder (.cursor/skills/css-modules in Opentrons/opentrons) into .agents/skills/css-modules in your project. Codex loads it when a task matches its description.

Can I use CSS Modules in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Opentrons/opentrons --skill css-modules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/css-modules, .gemini/skills/css-modules, .github/skills/css-modules and .opencode/skills/css-modules in your project.

What does CSS Modules need to run?

Going by SKILL.md and its folder, CSS Modules needs the command-line tools its instructions call (make and pnpm).

Does CSS Modules access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is CSS Modules safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does CSS Modules use?

CSS Modules is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does CSS Modules use?

About 2.2k tokens (SKILL.md is roughly 8.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to CSS Modules?

Skills that share tags, products or a category with CSS Modules: Skillshare UI Website Style (JetBrains/skills, 364 stars), Tailwindcss Development (anonaddy/anonaddy, 4.9k stars), Design System (Ohh-889/skyroc, 795 stars) and Stitch Taste Design System (google-labs-code/stitch-skills, 8.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains CSS Modules?

Opentrons (a GitHub organization) maintains it in Opentrons/opentrons, which has 521 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: Opentrons/opentrons on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.