agentleFS
MindrallyMindrally/skills/css/SKILL.md

css

Skill266 starsChanged 10 months agoApache-2.0View on GitHub

Best practices for CSS development including modern layout techniques, naming conventions, theming, and maintainable stylesheet architecture

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

36 rules. 0 are common, 24 are distinctive, and 12 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 24

    Distinctive

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write semantic HTML to improve accessibility and SEO

    line 10
  2. Distinctive:

    Use CSS for styling, avoiding inline styles

    line 11
  3. Distinctive:

    Ensure responsive design using media queries and flexible layouts

    line 12
  4. Distinctive:

    Use Flexbox for one-dimensional layouts (rows or columns)

    line 18
  5. Very specific:

    Use flex-wrap for responsive wrapping behavior

    line 20
  6. Very specific:

    Prefer gap property over margins for consistent spacing

    line 21
  7. Distinctive:

    Use CSS Grid for two-dimensional layouts

    line 24
  8. Very specific:

    Use grid-area for named template areas

    line 26
  9. Very specific:

    Use rem units for typography to respect user preferences

    line 31
  10. Very specific:

    Use em units for component-relative sizing

    line 32
  11. Very specific:

    Avoid px for font sizes; reserve for borders and fixed elements

    line 33
  12. Very specific:

    Use viewport units (vw, vh) thoughtfully for full-screen layouts

    line 35
  13. Distinctive:

    Use variables for colors, spacing, typography, and shadows

    line 40
  14. Distinctive:

    Use lowercase with hyphens for class names

    line 52
  15. Distinctive:

    Avoid IDs for styling; reserve for JavaScript hooks

    line 53
  16. Distinctive:

    Keep specificity low by using single class selectors

    line 54
  17. Distinctive:

    Use cascading intentionally, not accidentally

    line 61
  18. Very specific:

    Consider CSS Layers (@layer) for specificity control

    line 62
  19. Distinctive:

    Use relative units for flexible layouts

    line 67
  20. Distinctive:

    Test across multiple viewport sizes

    line 68
  21. Distinctive:

    Consider container queries for component-level responsiveness

    line 69
  22. Distinctive:

    Avoid deeply nested selectors

    line 74
  23. Distinctive:

    Use efficient selectors (class over element)

    line 75
  24. Distinctive:

    Consider critical CSS for above-the-fold content

    line 77
  25. Very specific:

    Use aspect-ratio for maintaining proportions

    line 81
  26. Very specific:

    Use logical properties (margin-inline, padding-block)

    line 83
  27. Very specific:

    Use @supports for feature detection

    line 85
  28. Distinctive:

    Keep files modular and focused

    line 90
  29. Distinctive:

    Document complex styles with comments

    line 91
  30. Distinctive:

    Use a consistent property order within declarations

    line 92
  31. Distinctive:

    Use vendor prefixes when necessary (consider Autoprefixer)

    line 96
  32. Distinctive:

    Test across target browsers

    line 97
  33. Distinctive:

    Use progressive enhancement approach

    line 99
  34. Distinctive:

    Ensure sufficient color contrast (WCAG AA minimum)

    line 103
  35. Distinctive:

    Avoid hiding content in ways that affect screen readers

    line 105
  36. Very specific:

    Use prefers-reduced-motion media query for animations

    line 106

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CSS Development Guidelines

Core Principles

  • Write semantic HTML to improve accessibility and SEO
  • Use CSS for styling, avoiding inline styles
  • Ensure responsive design using media queries and flexible layouts
  • Prioritize external stylesheets over inline or embedded styles

Layout Techniques

Flexbox

  • Use Flexbox for one-dimensional layouts (rows or columns)
  • Leverage justify-content and align-items for alignment
  • Use flex-wrap for responsive wrapping behavior
  • Prefer gap property over margins for consistent spacing

Grid

  • Use CSS Grid for two-dimensional layouts
  • Define grid templates with grid-template-columns and grid-template-rows
  • Use grid-area for named template areas
  • Leverage auto-fit and auto-fill for responsive grids

Units and Typography

  • Use rem units for typography to respect user preferences
  • Use em units for component-relative sizing
  • Avoid px for font sizes; reserve for borders and fixed elements
  • Implement fluid typography with clamp() when appropriate
  • Use viewport units (vw, vh) thoughtfully for full-screen layouts

CSS Variables (Custom Properties)

  • Define design tokens as CSS variables on :root
  • Use variables for colors, spacing, typography, and shadows
  • Implement theming by overriding variables in different contexts
  • Name variables semantically (e.g., --color-primary, --spacing-md)

Naming Conventions

BEM Methodology

  • Block: Standalone component (e.g., .card)
  • Element: Part of a block (e.g., .card__title)
  • Modifier: Variation of block or element (e.g., .card--featured)

Best Practices

  • Use lowercase with hyphens for class names
  • Avoid IDs for styling; reserve for JavaScript hooks
  • Keep specificity low by using single class selectors
  • Scope styles to components to prevent conflicts

Specificity Management

  • Maintain specificity at 0-1-0 (single class) when possible
  • Avoid !important declarations
  • Use cascading intentionally, not accidentally
  • Consider CSS Layers (@layer) for specificity control

Responsive Design

  • Implement mobile-first media queries
  • Use relative units for flexible layouts
  • Test across multiple viewport sizes
  • Consider container queries for component-level responsiveness

Performance

  • Minimize selector complexity
  • Avoid deeply nested selectors
  • Use efficient selectors (class over element)
  • Leverage CSS containment for isolated components
  • Consider critical CSS for above-the-fold content

Modern CSS Features

  • Use aspect-ratio for maintaining proportions
  • Leverage gap in Flexbox and Grid
  • Use logical properties (margin-inline, padding-block)
  • Implement smooth transitions with transition property
  • Use @supports for feature detection

Organization

  • Structure stylesheets logically (base, layout, components, utilities)
  • Keep files modular and focused
  • Document complex styles with comments
  • Use a consistent property order within declarations

Browser Compatibility

  • Use vendor prefixes when necessary (consider Autoprefixer)
  • Test across target browsers
  • Provide fallbacks for newer features
  • Use progressive enhancement approach

Accessibility

  • Ensure sufficient color contrast (WCAG AA minimum)
  • Provide visible focus styles for keyboard navigation
  • Avoid hiding content in ways that affect screen readers
  • Use prefers-reduced-motion media query for animations

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.