css

Enforces strict authoring rules for CSS across files, modules, and JS-in-CSS.

2|Updated Jun 1, 2017
One-click install
npx skills add https://github.com/carlos-algms/dotfiles --skill css-carlos-algms
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: css
Source: https://github.com/carlos-algms/dotfiles/tree/main/AI-configs/skills/css
Command: npx skills add https://github.com/carlos-algms/dotfiles --skill css-carlos-algms

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents messy, inconsistent, and incompatible CSS patterns by enforcing strict, team-friendly conventions for plain CSS, CSS Modules, and CSS-in-JS.

Core Features & Use Cases

  • Modern CSS conventions: Encourages using nesting, :has(), and correct selector composition (including & and &:hover patterns) while supporting nested @media blocks.
  • CSS Modules discipline: Enforces camelCase class naming, forbids root tag selectors, and restricts nesting to only allowed forms to avoid invalid or fragile selector structures.
  • CSS-in-JS coverage: Applies the same CSS quality bar to styled-components, Emotion, vanilla-extract, styled-jsx, Stitches, and template-literal styles embedded in TS/JS.

Quick Start

Tell your AI to create or review a .module.css or styled-component snippet so it follows camelCase class names and uses only allowed nesting with & and nested @media.

Frequently Asked Questions about css

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce consistent CSS naming and nesting rules across CSS Modules and styled-components?

Enforcing consistent CSS rules requires standardizing selector composition and class naming. This Skill applies strict conventions like camelCase class names and restricted nesting using & for pseudo-classes to ensure high-quality, compatible CSS output across modules and CSS-in-JS.

What is the correct way to use CSS nesting with pseudo-classes and @media queries?

Correct CSS nesting uses the & operator for pseudo-classes and pseudo-elements, along with nested @media blocks. This prevents fragile selector structures by prohibiting descendant nesting and root tag selectors, ensuring modern syntax compatibility.

How do I write styled-components or Emotion styles that follow strict team conventions?

Writing styled-components with strict conventions involves applying quality bars to template-literal styles. This Skill enforces correct selector rules and naming restrictions across CSS-in-JS libraries like Emotion, vanilla-extract, and Stitches to prevent inconsistent styling patterns.

Why does my CSS Modules descendant nesting create fragile selector structures?

Descendant nesting creates fragile selector structures because it generates overly specific CSS rules. Prohibiting root tag selectors and enforcing nesting only via & ensures that CSS Modules remain modular, predictable, and compatible with modern CSS-in-JS approaches.

Can I use modern CSS features like :has() and nested @media blocks in CSS Modules?

Modern CSS features like :has() and nested @media blocks are fully supported. This Skill encourages correct selector composition and modern syntax, allowing you to create component styles and theme files while maintaining strict authoring rules.

Does this approach work with vanilla-extract and Stitches as well as plain CSS files?

This approach works across plain CSS, CSS Modules, and CSS-in-JS libraries including vanilla-extract and Stitches. It applies the same strict quality bar to global stylesheets, component styles, and inline style blocks embedded in TypeScript or JavaScript files.