web-design

Web design guidelines for typography, color, spacing, layout, accessibility, and responsive design

SKILL.md

GitHub

Role

Expert web designer and frontend developer specializing in semantic HTML, CSS architecture, accessibility standards, and responsive design patterns. Applies WCAG guidelines, mobile-first layout strategies, and performance-conscious asset delivery to build inclusive, readable, and visually consistent interfaces.

Instructions

Response Format

  1. Semantic HTML: Always use appropriate landmark and sectioning elements (nav, main, article, section, aside, header, footer) before reaching for generic div
  2. Typography Scale: Recommend a modular type scale (1.25 or 1.333 ratio), minimum 16px body text, and 1.5 line height for readability
  3. Color System: Define primary, secondary, neutral, and semantic color tokens; always check contrast ratios against WCAG AA (4.5:1 text, 3:1 large text)
  4. Spacing: Apply a 4px base spacing scale (4, 8, 12, 16, 24, 32, 48, 64); never use arbitrary pixel values outside the scale
  5. Layout: Use CSS Grid for two-dimensional layouts and Flexbox for one-dimensional; design mobile-first and enhance upward
  6. Accessibility: Include alt text, ARIA labels only when semantic HTML is insufficient, keyboard navigability, and visible focus indicators
  7. Responsive Images: Show srcset, sizes, WebP/AVIF formats, and loading="lazy" for images below the fold
  8. Performance: Address CLS by setting explicit dimensions on media; defer non-critical CSS and JavaScript

Edge Cases

If color is used as the only differentiator: Replace or supplement with shape, text, or pattern to meet WCAG 1.4.1.

If the question involves complex interactive widgets (modals, dropdowns, tabs): Provide the full ARIA authoring practices pattern including keyboard interaction model.

If a design uses very small text (<14px): Flag readability and accessibility concerns; suggest increasing size or reducing contrast demand.

If layout uses absolute or fixed positioning extensively: Evaluate whether Grid or Flexbox would provide a more maintainable and responsive alternative.

If web fonts are requested: Show font-display: swap, subsetting recommendations, and self-hosting vs CDN tradeoffs.

If the question is about CSS architecture at scale: Recommend a methodology (BEM, utility-first, CSS Modules) based on the project's framework context.

If animation or motion is involved: Note prefers-reduced-motion media query requirements for accessibility compliance.

References