Claude-skill-registry css-coder
CSS authoring guidance emphasizing web standards, accessibility, and performance. Use when writing, reviewing, or refactoring CSS. Provides patterns, snippets, and conventions that prioritize native CSS over frameworks, semantic structure, and maintainable code. Refer to references/patterns.md for specific patterns and snippets.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/css-coder" ~/.claude/skills/majiayu000-claude-skill-registry-css-coder && rm -rf "$T"
manifest:
skills/data/css-coder/SKILL.mdsource content
CSS Coder
Guidance for writing CSS that prioritizes web standards, accessibility, performance, and maintainability.
Core Principles
- Web standards first — Use native CSS features before reaching for libraries or frameworks. No Tailwind, no CSS-in-JS unless explicitly requested.
- Accessibility as a requirement — Ensure styles support, never hinder, assistive technologies. Respect user preferences (motion, color scheme, contrast).
- Performance matters — Minimize repaints, avoid layout thrashing, use efficient selectors.
- Readable over clever — Future maintainers (including the author) should understand the code at a glance.
- Explicit over implicit — Avoid magic numbers and unexplained values. Use custom properties for shared values.
Workflow
- Check references first — Before writing CSS, consult
for established patterns and snippets.references/patterns.md - Validate against specs — When uncertain, reference MDN Web Docs or CSS specifications.
- Suggest alternatives — Offer ideas beyond the skill's patterns when appropriate, but always aligned with the core principles above.
Writing Guidelines
Selectors
- Prefer class selectors over element or ID selectors for styling.
- Keep specificity low and predictable.
- Avoid deep nesting (aim for 2-3 levels maximum).
Custom Properties
- Use
prefixed custom properties for colors, spacing, typography, and other repeated values.-- - Define at
or appropriate scope.:root - Name descriptively:
,--color-primary
,--spacing-md
.--font-size-body
Logical Properties
- Always use logical properties (
,margin-inline
,padding-block
,inset-inline-start
, etc.) instead of physical properties (block-size
,margin-left
,padding-top
,left
, etc.).height - Logical properties support internationalization and different writing modes automatically.
- Only fall back to physical properties where logical equivalents do not yet exist.
Units
- Use
for typography and spacing (respects user font-size preferences).rem - Use
for component-relative sizing when appropriate.em - Use viewport units (
,vw
,vh
) thoughtfully, with fallbacks where needed.dvh - Avoid
for font sizes; acceptable for borders, shadows, and fine details.px
Colors
- Use modern space-separated syntax for all color functions (
,rgb()
,hsl()
).oklch() - Recommend
for vibrant or wide-gamut colors.oklch() - Use relative color syntax to derive hover states or transparent variants from existing variables.
- See
for syntax examples.references/patterns.md
Layout
- Use CSS Grid for two-dimensional layouts, or when vertical flow is needed without extra declarations.
- Use Flexbox for one-dimensional alignment, noting it defaults to
direction.row - Avoid floats for layout (legacy use only).
Media Queries
- Use modern range syntax:
,@media (width < 48rem)
.@media (width >= 48rem) - Prefer Shared First over mobile-first: define shared styles outside queries, scope viewport-specific styles with bounded queries.
- Keep breakpoints to a minimum — add more only when there's a clear need.
- See
for detailed examples.references/patterns.md
Accessibility
- Never use
ordisplay: none
to hide content that should remain accessible to screen readers. Use appropriate techniques from the references.visibility: hidden - Respect
,prefers-reduced-motion
, andprefers-color-scheme
.prefers-contrast - Ensure sufficient color contrast (WCAG AA minimum, AAA preferred).
- Maintain visible focus indicators — never remove
styles without replacement.:focus
Performance
- Avoid expensive properties in animations (prefer
andtransform
).opacity - Use
sparingly and only when needed.will-change - Minimize use of
selectors.* - Prefer
for managing cascade when working with larger codebases.@layer
References
Consult
references/patterns.md for:
- Visually-hidden utility
- User preference queries (motion, color scheme, contrast)
- Modern color syntax and relative colors
- Shared First responsive patterns
- Any project-specific conventions
This file will grow as patterns are added. If a needed pattern doesn't exist, suggest one aligned with the core principles.