jcrabapple/hermes-skills/mobile-viewport-fit
Claude Code and agent skill by jcrabapple/hermes-skills
- community
Checking that the SKILL.md file is still in the repository.
Make full-screen web apps (game boards, tools with fixed header + flexible content + fixed keyboard/footer) fit on mobile without scrolling. Solves the common problem where 100vh includes the browser address bar area on mobile, causing content to overflow below the visible viewport.
Install
npx vskill@latest install jcrabapple/hermes-skills/mobile-viewport-fitSKILL.md
The same SKILL.md was published earlier as jcrabapple/hermes-skills/mobile-viewport-fit.
Mobile Viewport Fit
The Problem
On mobile browsers, 100vh includes the area behind the URL/address bar. The visible area is smaller, so content sized to 100vh overflows and requires scrolling. This is especially bad for game UIs (Wordle clones, keyboards, calculators) where all controls must be visible at once.
The Fix Pattern
1. Body: Lock to Dynamic Viewport Height
100dvh = the actual visible area. 100vh is kept as fallback since dvh isn't supported everywhere yet.
2. Fixed Elements: No Shrink
Header and keyboard/footer must not shrink — they always get their full size:
3. Flexible Content: Takes Remaining Space
The game board / main content area gets whatever space is left:
min-height: 0 is critical — without it, flex items won't shrink below their content's intrinsic size.
4. Dynamic Sizing for Content Tiles/Cells
CSS alone can't make fixed-size elements shrink to fit a flex container's computed height. Use JS to measure available space and set CSS custom properties:
Then in CSS:
Fallback values in var() ensure it works before JS runs.
5. Media Queries: Shrink Gaps and Fixed Elements
Use max-height media queries to reduce keyboard key heights and gaps on short viewports:
Do NOT override the dynamic tile sizes in media queries — the JS handles that based on actual available space.
Common Mistakes
- Setting tile sizes in media queries — these fight with JS dynamic sizing.
Let JS handle tile dimensions; only adjust gaps/padding/keyboard in MQs.
- Using `min-height: 100vh` on body — allows the page to grow beyond
the viewport. Use fixed height: 100dvh instead.
- Forgetting `min-height: 0` on flex child — without it, the board won't
shrink below its content's intrinsic size even with flex-shrink.
- Forgetting `flex-shrink: 0` on header/keyboard — they'll compress
and become unusable.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdevops/mobile-viewport-fit/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jcrabapple/hermes-skills/mobile-viewport-fit)