Skip to main content
rule CX Codex

styling · devin-axis — Claude Code rule: CSS and components

Rule for consistent React component styling: semantic color tokens instead of raw Tailwind values, built-in component variants, conditional classes via cn(). Prevents improper Tailwind usage and ensures light and dark theme support.

LicenseRef-Proprietary ★ 7,523 updated 2026-10-29

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/styling.md
Open on GitHub

What styling does

This rule enforces styling conventions for UI: use semantic tokens (bg-primary, text-muted-foreground) rather than literal colors like bg-blue-500, prefer component variants (variant="outline") over manual class overrides, apply className only for layout (max-w-md, gap-4), not colors or typography.

Key requirements: replace space-x-* and space-y-* with gap-*, use size-10 instead of w-10 h-10, prefer truncate to the full set overflow-hidden text-ellipsis whitespace-nowrap, write conditional classes through cn() from @/lib/utils, never add z-index to overlays (Dialog, Sheet, Drawer).

Common mistake: hard-coded status and indicator colors. Instead of text-red-600 for error, use text-destructive or a Badge variant. When a needed token is missing, suggest adding a CSS variable to customization.md rather than reaching for a raw color.

What it helps with

  • pick a semantic color token instead of a hard-coded Tailwind value
  • add a conditional class without ternary inside className string
  • replace element spacing from space-* to gap
  • override component styling with built-in variant
  • align styles across light and dark themes without manual dark: prefixes

Example prompts for the agent

  • Replace the background color with bg-primary—this rule blocks raw bg-blue-500
  • How do I customize colors for my brand? Check customization.md and add a CSS variable
  • Change space-y-4 to flex flex-col gap-4 for me

How to install styling

Manually: put the files in place

.claude/rules/styling.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about styling

How do I install styling in Claude Code?

Create or edit .claude/rules/styling.md at your project root and add the rule content. Claude Code loads rules automatically on next run.

What does the styling rule do?

It sets standards for component styling: semantic colors, built-in variants, conditional classes via cn(), no manual z-index, and automatic light/dark theme support. This prevents style inconsistency and makes maintenance easier.

What color should I use instead of text-green-500 for a status indicator?

Use a Badge component with a built-in variant or the text-destructive semantic token for errors. If the token you need doesn't exist, add a CSS variable to customization.md instead of using a raw Tailwind color.

Similar IDE rules

All IDE rules for Frontend and UI →

styling by other authors comes first.

styling calesthio Rule for styling mobjects in ManimGL: fill, stroke, opacity, and visual effects. Use it when building animations and want consistent, reusable styling across objects. CX Codex +1 ★ 78,316repo stars styling maxtrigify styling is a Claude Code rule that enforces Tailwind CSS patterns. Guides the agent to combine classes with tailwind-merge, clsx, and CVA. CX Codex +1 ★ 141repo stars ui-styling fcakyon ui-styling enforces modern React Native styling practices: smooth continuous borders, gap spacing, CSS boxShadow syntax, and native gradients. CX Codex +1 ★ 1,216repo stars preline-theme-generator htmlstreamofficial preline-theme-generator generates custom Preline UI theme CSS from brand colors or mood descriptions. Runs entirely through local scripts after install. CX Codex +1 1,400installs refactoring-ui wondelai refactoring-ui is a Claude Code skill that audits visual hierarchy, spacing scales, and color palettes in web interfaces. It uses a grayscale-first workflow before applying accent colors. CX Codex +1 10,500installs design-style-installer OneWave-AI The design-style-installer Claude Code skill installs a design theme and applies its tokens across a project. It runs for a visual restyle, updating component paint while keeping layout and content intact. CX Codex +1 105installs tailwind-4 prowler-cloud tailwind-4 is a Claude Code skill for styling with Tailwind CSS 4. It activates around className, variants, and dynamic values. CX Codex +1 617installs UISandbox Ideelab UISandbox launches your web project inside a browser tab to tweak styling controls directly. It passes the resulting visual tokens straight back to your coding agent. CX Codex +1 ★ 7repo stars

From the same set42

The whole set →
run-evals The run-evals skill launches iPolloWork and runs coded E2E flows through CDP. Use it to check a feature and produce run artifacts for a PR. CX Codex +1 ★ 7,523repo stars voiceover The voiceover skill writes the demo narration before any code exists, then carries the feature through to a pull request with frame-by-frame proof attached. Useful when the team should agree on what a viewer sees first. CX Codex +1 ★ 7,523repo stars image-generation image-generation generates image assets through the iPolloWork service for slide decks and web pages. Operates directly in chat without opening Image Studio. CX Codex +1 ★ 7,523repo stars ipollowork-template-generation The ipollowork-template-generation skill builds and revises reusable iPolloWork templates for design, presentations, editable PPT, and HyperFrames Video. Use it to validate and save template packages. CX Codex +1 ★ 7,523repo stars composition Enforces component composition patterns: wraps list items in groups, requires modal titles for accessibility, and swaps custom divs for UI primitives. CX Codex +1 ★ 7,523repo stars forms This rule standardizes form structure, input groups, option sets, and validation states. Use it when building interfaces with several kinds of controls. CX Codex +1 ★ 7,523repo stars agent-first-screenshots The agent-first-screenshots agent drives the live app over CDP and keeps a frame only after structural, pixel and vision checks pass. Built for landing pages, newsletters and decks. CX Codex +1 ★ 7,523repo stars create-plugin create-plugin scaffolds TypeScript plugins for iPolloWork and OpenCode. Sets up tool definitions, runtime hooks, and registers the file in your project configuration. CX Codex +1 ★ 7,523repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open