Loading...
Loading...
Design and UI standards for accessibility, semantic HTML, and responsive layouts
npx skill4agent add alexanderstephenthompson/claude-hub designNon-negotiable design and user interface standards. These are not preferences—they are requirements.
web-accessibilityweb-cssstyles/global.css/* ✅ Correct - Uses design tokens */
.button {
padding: var(--space-sm) var(--space-md);
font-size: var(--font-size-body);
background: var(--color-primary);
border-radius: var(--radius-sm);
box-shadow: var(--shadow-sm);
}
/* ❌ Wrong - Hardcoded values */
.button {
padding: 8px 16px; /* Use var(--space-sm) var(--space-md) */
font-size: 14px; /* Use var(--font-size-body) */
background: #3B82F6; /* Use var(--color-primary) */
border-radius: 4px; /* Use var(--radius-sm) */
}<header><nav><main><article><section><footer><button><a><form><label><input><select><textarea><ul><ol><li><h1><h2><h3>alt<!-- ✅ Good - Semantic HTML -->
<article class="product-card">
<header>
<h2>Product Name</h2>
</header>
<img src="..." alt="Product description">
<p>Product description goes here.</p>
<footer>
<button type="button">Add to Cart</button>
</footer>
</article>
<!-- ❌ Bad - Non-semantic divs -->
<div class="prd-crd">
<div class="hdr">
<div class="ttl">Product Name</div>
</div>
<div class="img"></div>
<div class="btn">Add to Cart</div>
</div><h1><h6><!-- ❌ Wrong - Using heading for font size -->
<h3>Sale Price</h3> <!-- Not a section heading, just wants bold text -->
<!-- ✅ Right - Use a class for styling -->
<p class="price-label">Sale Price</p><!-- ❌ Bad - Class soup -->
<button class="px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 focus:ring-2">
Submit
</button>
<!-- ✅ Good - Semantic class (styling lives in CSS) -->
<button class="btn btn--primary">
Submit
</button>// ❌ Bad - Inline styles
<div style={{ marginTop: '16px', padding: '8px' }}>
// ✅ Good - CSS class
<div className="card-section">/* ✅ Good - Human-readable */
.product-card {
display: flex;
flex-direction: column;
gap: var(--space-md);
padding: var(--space-lg);
background-color: var(--color-neutral-50);
border-radius: var(--radius-md);
box-shadow: var(--shadow-sm);
}
.product-card:hover {
box-shadow: var(--shadow-md);
transform: translateY(-2px);
transition: all var(--duration-fast) var(--easing-standard);
}| State | Requirement | Example |
|---|---|---|
| Default | Base appearance | Normal button |
| Hover | Visual feedback on mouse over | Background darkens |
| Active | Visual feedback when pressed | Slight scale down |
| Focus | Clear focus indicator (keyboard nav) | |
| Disabled | Visually distinct, non-interactive | Grayed out, low opacity |
| Layout Need | Tool | Example |
|---|---|---|
| Page structure | Grid (named areas) | Header, sidebar, main, footer |
| Section layout | Grid (named areas) | Two-column content, form layout |
| Component structure | Grid (named areas) | Card internals, modal layout |
| Navigation items | Flexbox | Top nav items, menu items |
| Gallery/flowing items | Flexbox | Image grid, card gallery, tag list |
#app-layout {
display: grid;
grid-template-columns: 200px 1fr;
grid-template-areas:
"header header"
"sidebar main"
"footer footer";
gap: var(--space-md);
}
#header { grid-area: header; }
#sidebar { grid-area: sidebar; }
#main { grid-area: main; }
#footer { grid-area: footer; }@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}/* Mobile: 0-767px (base styles, no media query needed) */
/* Tablet: 768px and up */
@media (min-width: 768px) { }
/* Desktop: 1024px and up */
@media (min-width: 1024px) { }
/* Large Desktop: 1280px and up */
@media (min-width: 1280px) { }@media (max-width: ...)| Anti-Pattern | Why Bad | Do Instead |
|---|---|---|
| Floating labels | Confusing | Labels above inputs |
| Inline validation | Annoying | Validate on blur/submit |
| Generic error messages | Unhelpful | Specific, actionable errors |
| Tooltips for critical info | Easy to miss | Show directly |
| Disabled buttons without explanation | Frustrating | Show why disabled |
| Custom scrollbars | Inconsistent UX | System scrollbars |
| Hamburger menu on desktop | Hides navigation | Full nav on desktop |
references/semantic-html.mdreferences/css-formatting.mdreferences/accessibility-guide.mdreferences/responsive-breakpoints.mdassets/component-states-checklist.mdassets/anti-patterns.mdassets/layout-examples.mdscripts/validate_design_tokens.pyscripts/check_accessibility.py