Semantic HTML
Oat UI is designed around semantic HTML. Use the correct HTML elements for their intended purpose.Use Semantic Elements
Button vs Link
Use<button> for actions and <a> for navigation:
Form Elements
Always use proper form elements with labels:Accessibility
ARIA Labels
Provide accessible labels for all interactive elements:Keyboard Navigation
Ensure all interactive elements are keyboard accessible:Focus Management
Manage focus appropriately in dynamic interfaces:Color Contrast
Ensure sufficient contrast ratios (WCAG AA minimum):- Normal text: 4.5:1 contrast ratio
- Large text (18pt+): 3:1 contrast ratio
- UI components: 3:1 contrast ratio
Screen Reader Support
Provide context for screen reader users:Performance
Minimize CSS Overrides
Work with Oat’s defaults instead of overriding extensively:Load Order
Load Oat CSS early, custom CSS after:Lazy Load Images
Minimize JavaScript
Oat UI components use minimal JavaScript. Only load what you need:Use Native Elements
Native elements are faster and more accessible:Component Usage
Cards
Use the<card> element for grouped content:
Alerts
Provide context with semantic alerts:Buttons
Use appropriate button variants:Forms
Group related inputs with fieldsets:Layout Patterns
Use Utility Classes
Oat includes utility classes for common layouts:Grid Layouts
Use Oat’s grid system for responsive layouts:Responsive Design
Oat is mobile-first. Add responsive overrides as needed:Code Organization
Structure Your HTML
Maintain a clear document structure:Organize Custom CSS
Group related customizations:Testing
Test Checklist
- Keyboard navigation: Tab through all interactive elements
- Screen reader: Test with VoiceOver (Mac) or NVDA (Windows)
- Mobile: Test on actual mobile devices
- Dark mode: Test both light and dark color schemes
- Reduced motion: Test with reduced motion enabled
- Color contrast: Verify all text meets WCAG AA standards
- Form validation: Test with invalid inputs
- Loading states: Test slow connections
Browser Testing
Test in modern browsers:- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)
Common Mistakes to Avoid
Don’t Use Non-Semantic Markup
Don’t Skip Labels
Don’t Override with !important
Don’t Inline Styles (Except Variables)
Don’t Disable Focus Outlines
Summary
- Use semantic HTML - Let elements do what they’re designed for
- Prioritize accessibility - Build for everyone
- Leverage CSS variables - Customize without overriding
- Keep it simple - Oat is minimal by design
- Test thoroughly - Keyboard, screen readers, mobile
- Respect user preferences - Dark mode, reduced motion
- Use native elements - They’re fast, accessible, and work everywhere