Frequently Asked Questions — Responsive Design Testing
Why does responsive design matter specifically for a harm-reduction portal like Psilobase?
Harm-reduction portals serve users who may be under unusual stress or urgency at the moment of access. A person seeking dosage reference information, contraindication warnings, or grounding techniques during or immediately before a psilocybin experience is very likely to be using a smartphone, possibly in low-light conditions, possibly with reduced fine motor control. A broken mobile layout — a menu that will not open, a table that overflows its container, text that requires pinch-zooming — is not just a usability inconvenience but a potential barrier to accessing safety-critical information. This is why Psilobase treats mobile-first design as a harm-reduction commitment, not a technical nicety.
What is the single most common responsive failure across all breakpoints?
Horizontal overflow — content that causes the body to be wider than the viewport, requiring the user to scroll sideways — is by far the most common responsive failure. It is typically caused by one of three things: an image without max-width: 100%, a table without a scrollable wrapper, or a long unbreakable string (a URL, a scientific name, a code snippet) without overflow-wrap: break-word. A quick diagnostic: open browser DevTools, go to the Console, and run document.querySelectorAll('*') filtered by elements with offsetWidth > document.body.offsetWidth. This identifies the overflowing element immediately without manual bisection.
How should the Psilobase design team prioritize which devices to test on?
Prioritize based on the actual device distribution from site analytics. However, as a general rule for a UK and US-oriented English-language site, start with: iPhone SE (375 px, iOS Safari — most restrictive small-screen Apple device), iPhone 14 or 15 (393 px, iOS Safari — current mainstream Apple device), a mid-range Android such as Pixel 6a or Samsung Galaxy A-series (360–412 px, Chrome), and an iPad (768 px portrait, iPadOS Safari). Desktop Chrome and Firefox at 1200 px and 1440 px complete the critical matrix. Budget Android devices on slow networks are a secondary priority but should be tested at least monthly using BrowserStack's budget device catalog.
What does iOS Safari's 100vh bug actually look like in practice, and how do I confirm it is fixed?
On a real iPhone or in a Chrome DevTools iOS Safari simulation, set a div to height: 100vh and load the page. You will notice the div extends slightly below the visible screen on initial load. When you scroll, the browser chrome (address bar + tab bar) collapses, the visible viewport grows, and the div no longer fills the screen — it is now shorter than the visible area. This is the manifestation: 100vh was calculated at initial load including the browser chrome, and it is not recalculated when the chrome retracts. To confirm the fix with 100dvh: the div should always precisely fill the visible viewport regardless of scroll position or browser chrome visibility. Test by setting a bright red background on the div — if you see any page background color at the bottom on initial load, the bug is present.
How can I test the focus trap in the mobile navigation menu?
Connect a keyboard (physical keyboard or Tab key in DevTools device emulation mode). Open the mobile menu using the Enter key on the hamburger button. Then repeatedly press Tab to cycle through the nav links. The focus should cycle back to the first link (or the close button) after reaching the last link, without ever escaping the menu. Then test Shift+Tab from the first link — focus should jump to the last link, not leave the menu. Finally, press Escape — the menu should close and focus should return to the hamburger button. If focus at any point disappears into the page behind the overlay (visible as the focus indicator jumping to the main article or footer), the focus trap is broken. Screen readers (NVDA + Firefox, VoiceOver + Safari) should also be tested to verify the menu is announced correctly when opening and closing.
What is the correct way to prevent iOS viewport zoom on form inputs?
iOS Safari automatically zooms in on form inputs when the input's computed font-size is below 16 px. The fix is straightforward: ensure every input, select, and textarea element has font-size: 16px or larger in the stylesheet. This applies to the element itself, not a parent container — CSS inheritance does not always carry the computed value if any intermediate selector reduces it. A safe global rule is: input, select, textarea { font-size: max(16px, 1rem); }. Note: adding user-scalable=no to the viewport meta tag would also prevent zoom, but this is an accessibility violation (WCAG 1.4.4 Resize Text) and should never be used. The font-size fix is the correct approach.
What is the difference between CSS Grid auto-fill and auto-fit for the species card layout?
auto-fill and auto-fit both work with repeat() and minmax() to create a flexible number of grid columns. The difference appears when there are fewer items than the number of columns that would fit at the current viewport width. With auto-fill, empty grid tracks are created and the existing items do not expand beyond their minimum width. With auto-fit, empty tracks are collapsed and the existing items stretch to fill the available space. For species cards, auto-fill is generally preferable: if there are only 3 species in a new subcategory, they should display at the same width as in a full category page, not stretch to fill the entire container. auto-fit is better for sections where you always want items to fill the row regardless of count, such as a "Top 3 species" feature strip.
How should data tables in species comparisons handle very narrow viewports?
There are three valid approaches, each with trade-offs. The first is horizontal scrolling: wrap the table in a container with overflow-x: auto. The table remains in its natural tabular form and is accessible to screen readers and keyboard users; the user simply scrolls sideways. This is the simplest and most semantically correct approach. The second approach is a "card transform" at mobile widths: use CSS to hide the table headers and display each row as a card, with data attributes used as pseudo-labels. This looks beautiful on mobile but is complex to implement accessibly (the relationship between header and data cell must be communicated to screen readers differently). The third approach is column prioritization: hide lower-priority columns at narrow widths with a "Show more" toggle. For Psilobase's harm-reduction context, horizontal scroll is recommended as the primary approach — it is the most robust and accessible, requires no JavaScript, and preserves all data at all times. Add a visible scroll hint for discoverability.
Should the hamburger menu use a CSS-only or JavaScript toggle on Psilobase?
A JavaScript-enhanced toggle is correct for Psilobase. Pure CSS solutions (the checkbox hack, :focus-within) cannot update aria-expanded on the toggle button, cannot trap focus within the open menu, and cannot close the menu on Escape. These are not optional enhancements — they are WCAG-required behaviors for any interactive disclosure widget. JavaScript should be loaded via a defer attribute so it does not block rendering, and the initial HTML should have aria-expanded="false" on the button. If JavaScript fails to load for any reason, the menu button is still visible and focusable, and while the menu will not open, the page content is still fully accessible via the normal page scroll. This is acceptable graceful degradation.
How do I verify that WebP images are actually being served to compatible browsers?
Open Chrome DevTools, go to the Network tab, and filter by "Img". Reload the page. Click on any image request and look at the "Response Headers" section. The content-type header should show image/webp for WebP images. Then do the same in Firefox — it should also request and receive WebP (Firefox has supported WebP since version 65). To confirm the JPEG fallback: open Safari 13 (macOS Mojave, available via BrowserStack) — this version predates WebP support, and the <picture> element should cause the browser to load the <img> JPEG fallback instead of the <source type="image/webp"> variant. Verify the content-type in Network logs shows image/jpeg. This three-step check confirms the <picture> element is working correctly for both modern and legacy browsers.