agentleFS
ViviBeriViviBeri/webcraft-pro/skills/modern-css/SKILL.md

modern-css

Skill11 starsChanged 10 days agoMITView on GitHub

Use when writing or refactoring CSS architecture, design tokens, layout systems, cascade strategy, responsive styling, themes or motion preferences.

13 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

31 rules. 0 are common, 31 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 31

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use platform CSS capabilities to create maintainable, resilient styles without unnecessary dependencies or unsupported browser assumptions.

    line 10
  2. Distinctive:

    Use clear ownership for reset, tokens, base elements, layout, components and utilities.

    line 19
  3. Distinctive:

    Consider cascade layers when the project has competing style sources or needs predictable precedence.

    line 20
  4. Distinctive:

    Keep selector specificity low and avoid !important except for documented integration constraints.

    line 21
  5. Distinctive:

    Use semantic token names for roles such as surface, text, border and action rather than naming every token after a visual color.

    line 25
  6. Distinctive:

    Do not introduce tokens for one-off values without a reuse or consistency reason.

    line 27
  7. Distinctive:

    Use Grid for two-dimensional placement and Flexbox for one-dimensional alignment.

    line 29
  8. Distinctive:

    Use intrinsic sizing and minmax() to avoid brittle fixed widths.

    line 30
  9. Distinctive:

    Use container queries for reusable components that respond to their own available space.

    line 31
  10. Distinctive:

    Use logical properties for writing-mode and direction resilience.

    line 32
  11. Distinctive:

    Avoid layout hacks based on arbitrary transforms or absolute positioning when normal flow works.

    line 33
  12. Distinctive:

    Use color-scheme only when the actual UI supports the corresponding browser-native surfaces.

    line 38
  13. Distinctive:

    Avoid expensive broad selectors and unnecessary animation of layout properties.

    line 40
  14. Distinctive:

    Prefer transform and opacity for motion when appropriate, but verify compositing and rendering rather than assuming every transform is free.

    line 41
  15. Distinctive:

    Remove obsolete styles only after checking all consumers.

    line 43
  16. Distinctive:

    Test supported browsers and responsive conditions.

    line 45
  17. Distinctive:

    Check focus, hover, reduced motion, dark/light themes and forced colors as relevant.

    line 46
  18. Distinctive:

    Run existing CSS lint/build checks.

    line 48
  19. Distinctive:

    Prefer readable CSS over compressed one-liners.

    line 52
  20. Distinctive:

    Avoid unexplained magic numbers and conflicting duplicate declarations.

    line 53
  21. Distinctive:

    Do not use !important to compensate for unclear cascade ownership.

    line 54
  22. Distinctive:

    Do not rely on CSS visual reordering that conflicts with DOM reading order.

    line 55
  23. Distinctive:

    Do not hide focus outlines without an equally visible replacement.

    line 56
  24. Distinctive:

    Do not use color alone to communicate validation or status.

    line 57
  25. Distinctive:

    Do not add browser-specific hacks without a documented support requirement.

    line 58
  26. Distinctive:

    Do not assume the newest CSS feature is supported by every target browser.

    line 59
  27. Distinctive:

    Use feature queries such as @supports when a newer feature is an enhancement rather than a baseline requirement.

    line 68
  28. Distinctive:

    Use cascade layers to establish intentional precedence between reset, vendor, base, components and utilities.

    line 70
  29. Distinctive:

    Prefer logical properties for direction-aware spacing and sizing.

    line 71
  30. Distinctive:

    Test forced-colors/high-contrast modes and ensure borders, icons and focus indicators remain perceivable.

    line 72
  31. Distinctive:

    Avoid using content-visibility, containment or will-change as blanket performance switches.

    line 73

“Common” is measured: kept by at least 6 in 10 of the 13 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

Modern CSS Engineering

Objective

Use platform CSS capabilities to create maintainable, resilient styles without unnecessary dependencies or unsupported browser assumptions.

Workflow

  1. Inspect the current system
    • Identify CSS methodology, build tooling, preprocessor, browser support policy and existing tokens.
    • Review global styles, resets, component boundaries and specificity hotspots.
    • Preserve established conventions unless they cause a concrete problem.
  2. Define a deliberate cascade
    • Use clear ownership for reset, tokens, base elements, layout, components and utilities.
    • Consider cascade layers when the project has competing style sources or needs predictable precedence.
    • Keep selector specificity low and avoid !important except for documented integration constraints.
    • Scope component styles to avoid accidental leakage.
  3. Build tokens around decisions
    • Centralize repeated color, spacing, typography, radius, shadow, border and motion values.
    • Use semantic token names for roles such as surface, text, border and action rather than naming every token after a visual color.
    • Define theme changes through tokens instead of duplicating whole component styles.
    • Do not introduce tokens for one-off values without a reuse or consistency reason.
  4. Choose layout primitives
    • Use Grid for two-dimensional placement and Flexbox for one-dimensional alignment.
    • Use intrinsic sizing and minmax() to avoid brittle fixed widths.
    • Use container queries for reusable components that respond to their own available space.
    • Use logical properties for writing-mode and direction resilience.
    • Avoid layout hacks based on arbitrary transforms or absolute positioning when normal flow works.
  5. Handle states and preferences
    • Provide focus-visible styling and meaningful hover/active/disabled states.
    • Respect prefers-reduced-motion and avoid motion as the only status signal.
    • Support forced colors and increased contrast when relevant.
    • Use color-scheme only when the actual UI supports the corresponding browser-native surfaces.
  6. Optimize safely
    • Avoid expensive broad selectors and unnecessary animation of layout properties.
    • Prefer transform and opacity for motion when appropriate, but verify compositing and rendering rather than assuming every transform is free.
    • Reserve image/media dimensions to reduce layout shifts.
    • Remove obsolete styles only after checking all consumers.
  7. Verify
    • Test supported browsers and responsive conditions.
    • Check focus, hover, reduced motion, dark/light themes and forced colors as relevant.
    • Inspect computed styles and layout shifts in a real browser when available.
    • Run existing CSS lint/build checks.

CSS quality rules

  • Prefer readable CSS over compressed one-liners.
  • Avoid unexplained magic numbers and conflicting duplicate declarations.
  • Do not use !important to compensate for unclear cascade ownership.
  • Do not rely on CSS visual reordering that conflicts with DOM reading order.
  • Do not hide focus outlines without an equally visible replacement.
  • Do not use color alone to communicate validation or status.
  • Do not add browser-specific hacks without a documented support requirement.
  • Do not assume the newest CSS feature is supported by every target browser; check compatibility against the project's support policy.

Completion criteria

Styles have clear cascade ownership, reusable semantic tokens where justified, robust intrinsic layouts, accessible interaction states and verified browser behavior.

Progressive enhancement and resilience

  • Use feature queries such as @supports when a newer feature is an enhancement rather than a baseline requirement.
  • Establish fallback layout behavior before introducing container queries, advanced selectors or newer color functions when the declared browser support requires it.
  • Use cascade layers to establish intentional precedence between reset, vendor, base, components and utilities; layer order participates in the cascade and can outweigh selector specificity.
  • Prefer logical properties for direction-aware spacing and sizing; test right-to-left and vertical writing modes when required.
  • Test forced-colors/high-contrast modes and ensure borders, icons and focus indicators remain perceivable.
  • Avoid using content-visibility, containment or will-change as blanket performance switches; measure behavior and verify focus, find-in-page and layout implications.

For each progressive enhancement, state the baseline behavior and the enhancement. Check actual browser support against the project's policy.

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.