3.7 KiB
3.7 KiB
Design System & Component Guidelines
🔒 STYLE SYSTEM LOCKED - This design system is LOCKED as of 2025-01-XX. Read this entire document before making any styling changes.
🔒 Style System Lock Status
DO NOT:
- ❌ Create new CSS classes without documenting in this file
- ❌ Duplicate existing styling patterns
- ❌ Create custom colors/utilities that already exist
- ❌ Modify core classes (
.igny8-table-compact, etc.) without updating documentation - ❌ Add inline styles for colors/spacing/typography
DO:
- ✅ Check this document before creating any styles
- ✅ Use existing classes from
igny8-colors.css - ✅ Use Tailwind defaults where possible
- ✅ Follow component patterns from this guide
- ✅ Update this document if you MUST add something new
Any new styling that duplicates existing functionality or creates new classes without documentation will be considered technical debt.
Core Principles
1. Reuse Existing Components Only
- ✅ DO: Use existing components from
/src/components/ui/and/src/components/common/ - ❌ DON'T: Create new components unless explicitly required and approved
- ❌ DON'T: Duplicate existing component functionality
2. No Inline Styles
- ✅ DO: Use Tailwind CSS utility classes
- ✅ DO: Use existing CSS classes from the design system
- ✅ DO: Use existing component props for styling
- ❌ DON'T: Use inline
styleattributes - ❌ DON'T: Use inline
style={{}}in JSX
3. Component Consistency
- All UI Elements pages should follow the same structure:
- Use
PageMetafor SEO - Use
PageBreadcrumbfor navigation - Use
ComponentCardfor consistent card styling - Import and use existing reusable components
- Use
4. Available Component Libraries
UI Components (/src/components/ui/)
alert/- Alert componentsavatar/- Avatar componentsbadge/- Badge componentsbreadcrumb/- Breadcrumb navigationbutton/- Button componentsbutton-group/- Button group componentscard/- Card componentsdropdown/- Dropdown menu componentsimages/- Image componentslist/- List componentsmodal/- Modal componentspagination/- Pagination componentsprogress/- Progress bar componentsribbon/- Ribbon componentsspinner/- Spinner/loading componentstabs/- Tab componentstable/- Table componentstoast/- Toast notification componentstooltip/- Tooltip componentsvideos/- Video components
Common Components (/src/components/common/)
ComponentCard- Consistent card wrapper for component showcasesPageBreadcrumb- Breadcrumb navigationPageMeta- SEO meta tagsConfirmDialog- Confirmation dialogsFormModal- Form modals (when available)
5. Styling Guidelines
- Use Tailwind CSS classes exclusively
- Follow the existing color scheme from
igny8-colors.css - Use dark mode variants:
dark:bg-gray-900,dark:text-white, etc. - Maintain consistent spacing using Tailwind spacing scale
- Use existing utility classes:
shadow-theme-xs,text-theme-sm, etc.
6. When Creating New Components is Acceptable
Only create new components if:
- Explicitly requested by the user
- Documented in an approved feature request
- No existing component can be adapted or extended
7. Checking for Existing Components
Before implementing any UI element:
- Search existing components in
/src/components/ui/ - Check common components in
/src/components/common/ - Review existing UI Elements pages for patterns
- Check if similar functionality exists in other modules
Last Updated: Current Session Status: Active Design System Rules