baasith6/cursor-skills/converting-css-modules-to-tailwind
Claude Code and agent skill by baasith6/cursor-skills
- community
Checking that the SKILL.md file is still in the repository.
Migrate CSS Modules (.module.css/.module.scss) to Tailwind utility classes. Handles styles object removal, className interpolation, composition, and global overrides.
Install
npx vskill@latest install baasith6/cursor-skills/converting-css-modules-to-tailwindSKILL.md
The same SKILL.md was published earlier as spencerpauly/awesome-cursor-skills/converting-css-modules-to-tailwind.
Converting CSS Modules to Tailwind
Migrate a component from CSS Modules (.module.css / .module.scss) to Tailwind utility classes.
Workflow
1. Inventory the Module
Read the .module.css file and the component that imports it. Map every styles.xxx reference to the CSS rule it resolves to.
2. Convert Each Class
Replace styles.xxx with equivalent Tailwind utilities:
3. Handle CSS Modules Patterns
`composes` keyword:
→ Flatten into a single set of utilities. If reuse is needed, extract a component, not a class.
Conditional classNames with `clsx`/`classnames`:
Dynamic class selection:
CSS Modules global overrides:
→ Move to globals.css with @layer components { } or use Tailwind's @apply in the global stylesheet.
SCSS features (nesting, variables, mixins):
- Nested selectors → flatten into utility classes on each element
- SCSS
$variables→ map totailwind.config.tstheme values - Mixins → replace with utility composition or extract components
4. Clean Up
- Remove the
import styles from './Xxx.module.css'line - Delete the
.module.css/.module.scssfile - If the component had a co-located
index.tsbarrel that re-exported styles, update it - Search the codebase for any other imports of the deleted module
- Run the app and verify visually — check for regressions
Rules
- Convert one component at a time — don't batch entire directories
- Keep conditional logic in
clsx()or template literals, not in CSS - If a module has pseudo-element styles (
:before,:afterwithcontent), those needbefore:/after:prefixes pluscontent-['...']in Tailwind - For
:nth-child,:first-of-type, etc. — check if Tailwind has a matching variant, otherwise keep a minimal CSS rule - Don't create
@applyclasses to replicate what the module did — the goal is to eliminate the indirection
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingresources/converting-css-modules-to-tailwind/SKILL.md
Popularity
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/baasith6/cursor-skills/converting-css-modules-to-tailwind)