| 1 | .card-header | .header1, .h-blue | Naming | Semantic names describe purpose, not appearance or position. |
| 2 | .btn-primary | .btn-red | Naming | Purpose-based names survive design changes without updates. |
| 3 | .user-profile | .userProfile, .User_Profile | Naming | Consistent kebab-case naming across all stylesheets. |
| 4 | .card | div (generic selector) | Selectors | Target specific elements, not generic ones. |
| 5 | .nav-link:hover | .nav-link:hover a (overly nested) | Selectors | Keep selector depth shallow for performance and maintainability. |
| 6 | display: flex; | position: absolute; (for layout) | Layout | Flexbox is more flexible and responsive than absolute positioning. |
| 7 | display: grid; | float: left; | Layout | Grid is cleaner and more semantic than floats for complex layouts. |
| 8 | gap: 1rem; | margin: 1rem; on every child | Spacing | Gap prevents margin collapse and is more maintainable. |
| 9 | margin: 0 auto; | text-align: center; on parent for block alignment | Spacing | Auto margins reliably center block-level elements. |
| 10 | box-sizing: border-box; | Default content-box | Box Model | Border-box makes width/height calculations predictable and consistent. |
| 11 | font-size: 1rem; | font-size: 16px; (on body) | Typography | Relative units scale better with user font preferences. |
| 12 | line-height: 1.5; | line-height: 1.5px; | Typography | Unitless line-height is proportional to font size. |
| 13 | font-family: system-ui, sans-serif; | font-family: "Comic Sans"; | Typography | System fonts load faster and match user expectations. |
| 14 | letter-spacing: 0.05em; | letter-spacing: 2px; | Typography | Relative units scale with font size. |
| 15 | max-width: 70ch; for body text | Full viewport width | Typography | Optimal line length (50–75 characters) improves readability. |
| 16 | 4.5:1 color contrast | 3:1 or lower contrast | Accessibility | WCAG AA compliance ensures readability for all users. |
| 17 | color: var(--primary); | color: #0d6efd; (hardcoded) | Colors | CSS variables make themes and brand updates consistent. |
| 18 | Don't rely on color alone | color: red; to indicate error (no icon/text) | Accessibility | Color-blind users need alternative visual cues. |
| 19 | background: linear-gradient(...); | background-image: url(bad-image.jpg); (no fallback) | Colors | Provide fallback colors for failed image loads. |
| 20 | color-scheme: light dark; | Hardcoded light colors only | Accessibility | Supports dark mode preferences without CSS rewriting. |
| 21 | outline: 3px solid #0d6efd; | outline: none; | Accessibility | Remove outlines responsibly; always provide visible focus indicators. |
| 22 | cursor: pointer; on clickable elements | Default cursor on buttons | UX | Users expect visual feedback that an element is clickable. |
| 23 | pointer-events: none; on overlays | Allowing clicks through overlays | UX | Prevents accidental interaction with hidden elements. |
| 24 | :focus-visible for keyboard users | :focus with no indicator | Accessibility | Keyboard navigation requires clear focus indicators. |
| 25 | transition: transform 0.2s ease; | transition: all 0.2s ease; | Performance | Specific properties animate faster than all. |
| 26 | transform: translateY(-4px); | top: -4px; (for animation) | Performance | Transform uses GPU and avoids layout recalculation. |
| 27 | opacity: 0.5; | display: none; visibility: hidden; (for fade) | Performance | Opacity animates smoothly; other methods cause reflow. |
| 28 | Minimize reflows | Animating width, height, margin | Performance | Layout properties trigger expensive recalculations. |
| 29 | will-change: transform; | No performance hints | Performance | Hints let browsers optimize animations in advance. |
| 30 | Minimize critical CSS | Large CSS files in <head> | Performance | Smaller critical CSS improves First Contentful Paint. |
| 31 | max-width: 1200px; | Fixed widths like width: 1200px; | Responsive | Max-width allows flexible growth on large screens. |
| 32 | @media (min-width: 768px) | @media (max-width: ...) (mobile-last) | Responsive | Mobile-first is simpler and more maintainable. |
| 33 | width: 100%; max-width: 100%; on images | No width/height on images | Responsive | Images scale responsively and prevent layout shift. |
| 34 | aspect-ratio: 16 / 9; | Hardcoded heights | Responsive | Aspect ratio prevents Cumulative Layout Shift (CLS). |
| 35 | padding: clamp(1rem, 5vw, 3rem); | Fixed padding for all screens | Responsive | Fluid spacing adapts smoothly across screen sizes. |
| 36 | prefers-reduced-motion support | Animations without escape | Accessibility | Respects user preferences for motion sensitivity. |
| 37 | text-decoration-line: underline; | Color alone to indicate links | Accessibility | Multiple cues help color-blind users identify links. |
| 38 | aria-label + visible text | Hidden text or no labels | Accessibility | Assistive technology users need descriptive labels. |
| 39 | Skip links visible on focus | Hidden skip links | Accessibility | Keyboard users need to skip repetitive navigation. |
| 40 | font-size: 16px; minimum on inputs | Smaller font on inputs | Accessibility | Prevents iOS zoom on focus in form fields. |
| 41 | Organize by component | Random rule placement | Organization | Logical grouping makes CSS easier to find and maintain. |
| 42 | /* Card Component */ | No comments or structure | Organization | Comments help future developers understand intent. |
| 43 | Single responsibility per class | .card-title-header-blue-large | Organization | Focused classes are reusable and composable. |
| 44 | Use nesting for logical grouping | Flat structure without hierarchy | Organization | Nested rules show component relationships clearly. |
| 45 | Avoid !important | Using !important liberally | Maintenance | Specificity wars make CSS impossible to maintain. |
| 46 | content-visibility: auto; | Rendering off-screen content | Performance | Skips rendering invisible content for performance. |
| 47 | Use containment for layout isolation | Global scope pollution | Performance | Contained layouts prevent cascading reflows. |
| 48 | Logical properties for i18n | Hardcoded left, right positioning | Maintenance | Logical properties support right-to-left languages automatically. |
| 49 | Use CSS Grid for complex layouts | Hacking layouts with nested flexbox | Maintenance | Grid is more semantic and easier to read for 2D layouts. |
| 50 | Test on real devices | Only testing in browser DevTools | Testing | Real devices expose bugs DevTools emulation misses. |