{"data":{"slug":"discovered-d9a29c7d362ca6df16cb0ffb05c637e7437eb3a83f3b1619","title":"Rjv Viewport Targets","summary":"Design and check web UI against viewport targets including short laptop windows (e.g., 1351 \u00d7 625), adapting height with fit-screen variants without touching tall screens. Use when designing or reviewing a hero, first screen, sign-in, app shell, or dialog.","url":"https:\/\/skillshunter.net\/skills\/discovered-d9a29c7d362ca6df16cb0ffb05c637e7437eb3a83f3b1619","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-d9a29c7d362ca6df16cb0ffb05c637e7437eb3a83f3b1619","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-d9a29c7d362ca6df16cb0ffb05c637e7437eb3a83f3b1619.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-d9a29c7d362ca6df16cb0ffb05c637e7437eb3a83f3b1619\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before applying fit-screen variants, ensure the target matrix is written into the project's spec or rulebook, starting from the default matrix and adjusting rows only with evidence about the audience (e.g., analytics, StatCounter data).","instructions":"---\nname: rjv-viewport-targets\ndescription: \"How-to: design and check web UI against viewport targets including short laptop windows (1366 x 768 gives a 1351 x 625 page), adapting height with fit-screen variants without touching tall screens. Use when designing or reviewing a hero, first screen, sign-in, app shell or dialog, choosing breakpoints\/svh, or listing sizes to screenshot. Phone-only fixes live in emil-mobile-native.\"\n---\n\n# Viewport targets\n\nDesigners work on tall Retina screens. Many users do not. A design is checked against the sizes its audience\nactually has, height included, and adapts to a short window without changing the tall one.\n\n## 1. Write the target matrix\n\nBefore designing, write the matrix into the project's spec or rulebook. Start from this default and change rows\nonly with evidence about the audience (analytics, StatCounter for the market):\n\n| Row | Viewport (CSS px) | Comes from |\n|---|---|---|\n| Phone | 390 \u00d7 844 | iPhone 12 to 16 |\n| Short phone | 375 \u00d7 553 | iPhone SE, page after browser bars |\n| Short laptop | 1351 \u00d7 625 | 1366 \u00d7 768 laptop, Edge on Windows 11 |\n| Short laptop | 1280 \u00d7 680 | 1280 \u00d7 800 laptop; also 1920 \u00d7 1080 at 150% scaling (about 1280 \u00d7 610) |\n| Standard | 1440 \u00d7 900 (page about 1440 \u00d7 790) | MacBook Air |\n| Tall | 1728 \u00d7 1000 | MacBook Pro 16, where most designs are drawn |\n\nThe viewport is the page area after the taskbar and browser bars, not the screen size. Windows display scaling\n(125%, 150%) divides the screen by the scale. 1366 \u00d7 768 is about 18% of desktop screens in India and about 10%\nworldwide (StatCounter, 2026-09).\n\nDone when the matrix is written where every agent on the project reads it.\n\n## 2. Decide what must fit\n\n| Region | Rule |\n|---|---|\n| Composed first screen: hero, sign-in, onboarding step, app shell's first view, a dialog | fits every matrix row at scroll position zero: its heading, its line, its primary action and its key visual are fully visible |\n| Everything else: sections, lists, tables, articles | scrolls; never forced to fit |\n\nA cut-off hero reads as broken. A long page that scrolls reads as normal.\nDone when each composed screen in the work has its required elements listed.\n\n## 3. Adapt to height with two opt-in variants\n\nWidth breakpoints own layout and say which device. Height gets two variants named for their purpose, making the\nfirst screen fit, which a design opts into:\n\n```css\n\/* Tailwind v4: in the shared stylesheet every surface imports *\/\n@custom-variant fit-screen (@media (max-height: 50rem));        \/* page at most 800 tall *\/\n@custom-variant fit-screen-tight (@media (max-height: 37.5rem)); \/* page at most 600 tall *\/\n```\n\n```css\n\/* lg:fit-screen: in plain CSS (Tailwind lg is 64rem) *\/\n@media (min-width: 64rem) and (max-height: 50rem) { .hero { padding-top: 1rem; } }\n```\n\nCombine them with width, read left to right:\n\n| Class | Means | Typical screen |\n|---|---|---|\n| `lg:fit-screen:pt-4` | at least 1024 wide and at most 800 tall | 1366 \u00d7 768 laptop, a Mac at a larger-text setting |\n| `fit-screen-tight:gap-3` | at most 600 tall, any width | iPhone SE (page about 375 \u00d7 553), landscape phone |\n| no variant | the default | tall screens, unchanged |\n\n- **What sets the page height:** the resolution setting (macOS scaled resolutions, Windows display scaling), browser\n  bars and taskbar, a window that is not maximised, and browser zoom. Pixel density does not: a Retina screen has the\n  same CSS size as a 1x one. The variants read the page size, so they cover every cause at once.\n- **Pair `fit-screen:` with a width breakpoint** (`lg:` or `min-[56.25rem]:`, where layouts go side by side). Below\n  that width, layouts are stacked and scroll; use `fit-screen-tight:` only when a phone first screen loses its main\n  action.\n- **Written as a maximum.** The tall layout stays the default; the variants only tighten. A design with no\n  `fit-screen` styles renders identically.\n- **In rem.** Media-query rem follows the browser's default font size, so a reader with 20px text gets the tighter\n  layout sooner. Browser zoom resizes the viewport, so it follows with no extra code.\n- Never name a variant after a device (`laptop:`, `tablet:`): the same window size occurs on several devices, and\n  never branch on user agent.\n\nUse it in the design's own classes, against the breakpoint it conflicts with:\n\n```tsx\n<div className=\"xl:pt-15.5 xl:fit-screen:pt-4\">\n<h1 className=\"xl:text-6xl xl:fit-screen:text-5xl\">\n```\n\nCascade (Tailwind v4): custom variants are emitted after the width breakpoints at equal specificity, so\n`xl:fit-screen:` wins over `xl:` regardless of class order. A `dark` variant built on `:is()` adds specificity: where a\nproperty is set under both, write `dark:fit-screen:` or the dark value wins.\n\n**Type under `fit-screen`:** reading text (paragraphs, labels, buttons, navigation) never shrinks. Display headings may\nstep down one step on the type scale, and only after the height changes alone do not fit.\n\n**Size a visual from the height left:** `100svh \u2212 header height \u2212 the design's own allowance`, with the allowance as\na named constant in that design, a floor, and the column width as a cap:\n\n```tsx\nsupports-[height:100svh]:lg:fit-screen:w-[min(100%-1.875rem,clamp(16rem,100svh-var(--header-space,6rem)-10rem,31.25rem))]\n```\n\nKeep the `supports-` guard. A declaration whose `var()` turns invalid is not dropped. It becomes `auto` at computed\ntime and loses the normal size. `svh` stays fixed while mobile bars move (`dvh` is for app shells; see\nemil-mobile-native). Below the floor the page scrolls.\n\n**Never scale the page to fit.** Do not set `zoom` or a smaller root font size on short windows. Both shrink reading\ntext on exactly the cheapest screens, and every design pays for one design's problem. (Measured: zoom 0.8 took body\ntext from 16 to 12.8px.)\n\nDone when every composed screen fits every row, the tall row is unchanged, and no reading text changed size.\n\n## 4. Check\n\nScreenshot every matrix row, in light and dark, at scroll position zero. On a short row, check \"fully visible\" for\neach required element:\n\n1. its box, intersected with every ancestor that clips overflow, equals its own box;\n2. it lies inside the viewport;\n3. at nine points on a 3 \u00d7 3 grid across the box, the topmost element is the element or inside it, so a sticky\n   header or overlay does not cover it.\n\nLoad fonts and images before measuring. Measure animated parts at their largest frame and again with reduced motion\non. In Playwright, set each row with `page.setViewportSize({ width, height })`. For Windows scaling and real Edge\nchrome, check one short row on real Windows (BrowserStack or a laptop) once per design: emulation sets the viewport\nbut not the taskbar, scaling or font rendering.\n\nDone when every row has a screenshot, each required element passes the three checks on the short rows, and the tall\nrow matches its before screenshot.\n\n## Evidence\n\nA client app, short-screens feature, 2026-09-25: the home hero was cut off at 1351 \u00d7 625 and 1280 \u00d7 680 on real\nWindows 11 via BrowserStack while rendering normally at 1728 \u00d7 962. The same variant (named `short` there), the type rule and the\nheight budget fixed it with nothing changed at 1728 \u00d7 1000. Spec and design:\nthe app's `_docs\/features\/short-screens\/` (criteria SV1 to SV12).\n","use_cases":["Designing a hero section that fits on short laptop windows","Reviewing a first screen for visibility on all viewport targets","Implementing fit-screen variants for responsive height adjustments","Checking UI elements for full visibility on short rows at scroll position zero"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/rjvim\/ai-skills\/blob\/9a942086adef21dbd0c061d9d9e8fd5f43328bf6\/skills\/rjv-viewport-targets\/SKILL.md","source_commit":"9a942086adef21dbd0c061d9d9e8fd5f43328bf6","license":null,"version":null,"listing_approved_at":"2026-12-03","created_at":"2026-12-02T09:10:13.000000Z","updated_at":"2026-12-03T16:19:55.000000Z","seo_title":"Rjv Viewport Targets - Design Web UI for Short Laptop Windows","seo_description":"Ensure web UI adapts to short laptop windows and other viewport targets without shrinking text or altering tall screen designs. Use fit-screen variants and check for full","seo_keywords":["viewport targets","fit-screen variants","responsive design","web UI design","short laptop windows","UI visibility checks"]}}