# Framework-specific Fix Guide ## Pure CSS / SCSS ### Fixing Layout Overflow ```css /* Before: Overflow occurs */ .container { width: 100%; } /* After: Control overflow */ .container { width: 100%; max-width: 100%; overflow-x: hidden; } ``` ### Text Clipping Prevention ```css /* Single line truncation */ .text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* Multi-line truncation */ .text-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; } /* Word wrapping */ .text-wrap { word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; } ``` --- ## Tailwind CSS ### Layout Fixes ```jsx {/* Before: Overflow */}
; {/* After: Overflow control */}
; ``` ### Text Clipping Prevention ```jsx {/* Single line truncation */}

Long text...

; {/* Multi-line truncation */}

Long text...

; ``` ### Responsive Support ```jsx
Content
; ``` ### Accessibility ```jsx ; ``` --- ## React + CSS Modules ```css /* Component.module.css */ .container { display: flex; flex-wrap: wrap; overflow: hidden; max-width: 100%; } ``` --- ## styled-components / Emotion ```jsx const Container = styled.div` width: 100%; max-width: 100%; overflow-x: hidden; @media (max-width: 768px) { padding: 1rem; } `; ``` --- ## Vue (Scoped Styles) ```vue ``` --- ## Next.js / App Router ```css /* app/globals.css */ html, body { max-width: 100vw; overflow-x: hidden; } img { max-width: 100%; height: auto; } ``` --- ## Common Patterns ### Flexbox ```css /* Fix overflow */ .flex-container { display: flex; flex-wrap: wrap; gap: 1rem; } .flex-item { flex: 1 1 300px; min-width: 0; } ``` ### Grid ```css /* Auto-adjust columns */ .grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; } ``` ### Focus States ```css button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; } ``` ### Z-index System ```css :root { --z-dropdown: 100; --z-sticky: 200; --z-modal: 400; --z-tooltip: 500; } ``` --- ## Debugging ### Detect Overflow ```javascript document.querySelectorAll("*").forEach((el) => { if (el.scrollWidth > el.clientWidth) { console.log("Horizontal overflow:", el); } }); ```