Something went wrong. Try again.
Tools for building Offline-first Web Apps
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Layout Test - Mobile Breakpoint</title>
<link rel="stylesheet" href="../dist/inro.css">
<style> :root { --nav-width: 240px; --aside-width: 220px; --header-height: 60px; --main-padding: var(--s4) var(--container-padding); }
/* Header styling */ header { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--container-padding); height: var(--header-height); border-bottom: 1px solid currentColor; }
header h1 { margin: 0; font-size: var(--f4); flex: 1; }
/* ui-main-header styling */ ui-main-header { display: flex; align-items: center; justify-content: space-between; opacity: 0.8; }
ui-main-header h2 { margin: 0; font-size: var(--f4); }
/* Aside styling */ aside h3 { margin-top: 0; font-size: var(--f5); opacity: 0.8; }
aside ul { list-style: none; margin: 0; padding: 0; }
aside li { margin-bottom: var(--s2); }
aside a { text-decoration: none; color: inherit; opacity: 0.7; transition: opacity var(--transition-base); }
aside a:hover { opacity: 1; }
/* Test indicators */ .test-box { padding: var(--s4); border: 2px solid currentColor; border-radius: var(--br-lg); margin-bottom: var(--s3); }
.test-box h3 { margin-top: 0; }
.status { display: inline-block; padding: var(--s1) var(--s2); border-radius: var(--br-sm); font-size: var(--f7); font-weight: var(--fw-semibold); background: var(--success); color: var(--background); }
.breakpoint-indicator { position: fixed; bottom: var(--s3); right: var(--s3); background: var(--background); border: 2px solid currentColor; padding: var(--s2) var(--s3); border-radius: var(--br-base); font-weight: var(--fw-semibold); z-index: var(--z-fixed); font-size: var(--f6); }
.breakpoint-indicator::before { content: 'Desktop (> 768px)'; }
@media (max-width: 768px) { .breakpoint-indicator::before { content: 'Mobile (≤ 768px)'; } }
/* Grid debugging overlay */ .grid-debug { position: fixed; top: calc(var(--header-height, 60px) + var(--s3)); left: var(--s3); background: var(--error); color: var(--background); padding: var(--s2) var(--s3); border-radius: var(--br-base); font-size: var(--f7); font-weight: var(--fw-semibold); z-index: var(--z-fixed); display: none; }
@media (max-width: 768px) { /* Show if there's overflow */ body:has(main) { position: relative; } } </style> </head> <body> <a href="#main" class="skip-to-main">Skip to main content</a>
<div class="grid-debug" id="grid-debug">Grid columns issue detected!</div>
<!-- Mobile drawer controls --> <input type="checkbox" id="nav-toggle" aria-hidden="true"> <label for="nav-toggle" class="nav-backdrop" aria-label="Close navigation" ></label>
<!-- Header with hamburger --> <header> <ui-nav-toggle> <label for="nav-toggle" aria-label="Toggle navigation menu"> <span></span> </label> </ui-nav-toggle> <h1>Layout Test</h1> <button type="button">Action</button> </header>
<!-- Nav sidebar header --> <ui-nav-header> <ui-nav-toggle> <label for="nav-toggle" aria-label="Toggle navigation menu"> <span></span> </label> </ui-nav-toggle> <strong>Nav Header Zone</strong> </ui-nav-header>
<!-- Main navigation --> <nav aria-label="Primary"> <ul> <li><a href="#test1" aria-current="page">Test Section 1</a></li> <li><a href="#test2">Test Section 2</a></li> <li><a href="#test3">Test Section 3</a></li> <li> <a href="#nested">Nested Section</a> <ul> <li><a href="#nested-1">Nested Item 1</a></li> <li><a href="#nested-2">Nested Item 2</a></li> </ul> </li> <li><a href="#test4">Test Section 4</a></li> </ul> </nav>
<!-- Nav sidebar footer --> <ui-nav-footer> <a href="#settings">Nav Footer Zone</a> </ui-nav-footer>
<!-- Main content header --> <ui-main-header> <h2>Main Content Header</h2> <button type="button">New Item</button> </ui-main-header>
<!-- Main content --> <main id="main"> <div class="test-box"> <h3>Layout Test Instructions</h3> <p> This page tests the mobile breakpoint behavior at <strong >768px</strong>. Resize your browser window to test the layout. </p> <p style="margin-top: var(--s3); padding: var(--s2); background: var(--background-dull); border-radius: var(--br-base)" > <strong>Quick Check:</strong> If you see horizontal scrolling or empty space on mobile, the grid columns are not properly collapsing. This should be fixed now! </p> </div>
<div class="test-box"> <h3>✓ Desktop (> 768px)</h3> <p><strong>Should see:</strong></p> <ul> <li>Three-column layout (nav | main | aside)</li> <li>Nav sidebar on the left</li> <li>Aside sidebar on the right</li> <li>ui-nav-header above nav</li> <li>ui-nav-footer below nav</li> <li>ui-main-header above this content</li> <li>ui-main-footer below this content</li> <li>No hamburger menu visible</li> </ul> </div>
<div class="test-box"> <h3>✓ Mobile (≤ 768px)</h3> <p><strong>Should see:</strong></p> <ul> <li>Single-column layout (full width)</li> <li>Hamburger menu in top-left of header</li> <li>ui-main-header above this content (visible!)</li> <li>ui-main-footer below this content (visible!)</li> <li>Nav accessible via hamburger drawer</li> <li><strong>NO horizontal scroll</strong></li> <li><strong>NO empty space to the left</strong></li> </ul> <p><strong>Hidden on mobile:</strong></p> <ul> <li>Nav sidebar (accessible via drawer)</li> <li>Aside sidebar</li> <li>ui-nav-header (shown in drawer when open)</li> <li>ui-nav-footer (shown in drawer when open)</li> </ul> </div>
<div class="test-box"> <h3>Test Content</h3> <p> This is test content to verify that the main column takes full width on mobile without any layout issues. </p> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris. </p> <ui-card> <div style="padding: var(--s3)"> <h4>Card Component</h4> <p>Testing that components render correctly at all breakpoints.</p> <ui-button-group> <button>Action 1</button> <button>Action 2</button> </ui-button-group> </div> </ui-card> </div>
<div class="test-box"> <h3>Expected Behavior</h3> <p><span class="status">PASS</span> If at 768px or below:</p> <ol> <li>Main content is full width (no left margin/padding)</li> <li>No horizontal scrollbar appears</li> <li>Hamburger menu is visible and functional</li> <li>Clicking hamburger opens drawer from left</li> <li>Clicking backdrop closes drawer</li> <li>ui-main-header is visible above content</li> <li> <strong>Page width equals viewport width (no overflow)</strong> </li> </ol>
<div style="margin-top: var(--s3); padding: var(--s3); border: 2px solid var(--success); border-radius: var(--br-base)" > <p style="margin: 0; font-weight: var(--fw-semibold)"> ✓ Layout Fix Applied </p> <p style="margin: var(--s2) 0 0 0; font-size: var(--f6); opacity: 0.8" > Body grid now properly defined in landmarks.css with mobile override. Grid collapses to single column (grid-template-columns: 1fr) at ≤768px. </p> </div> </div> </main>
<!-- Main content footer --> <ui-main-footer> <p style="opacity: 0.6">Main Content Footer Zone</p> </ui-main-footer>
<!-- Right sidebar --> <aside aria-label="Related information"> <h3>Aside Zone</h3> <p style="font-size: var(--f6); opacity: 0.7"> This sidebar should be hidden on mobile (≤ 768px) and visible on desktop. </p> <ul> <li><a href="#related-1">Related Link 1</a></li> <li><a href="#related-2">Related Link 2</a></li> <li><a href="#related-3">Related Link 3</a></li> </ul> </aside>
<!-- Footer --> <footer> <p style="opacity: 0.6"> Layout Test • Civility Framework • Resize window to test breakpoint </p> </footer>
<!-- Breakpoint indicator --> <div class="breakpoint-indicator"></div>
<script> // Auto-dismiss drawer when clicking a navigation link document.addEventListener('DOMContentLoaded', () => { const navToggle = document.getElementById('nav-toggle') const navLinks = document.querySelectorAll('body > nav a')
navLinks.forEach((link) => { link.addEventListener('click', () => { navToggle.checked = false }) }) }) </script> </body></html>