viewports
БесплатноЗапускает вложенные скриптыНе проверенRenders a page at every width, each breakpoint edge, a short landscape phone, 400% zoom, 200% text and spaced, longer, shorter, unbroken or mirrored text…
от raphaelsalaja★ 74 звезды на GitHubОб этом скилле
Viewports
This skill renders one page at a fixed set of widths and heights. It measures each render for sideways scroll, clipped text, small targets and controls that only hover reveals.
Every width rendered, none inferred
The widths are exact: 320, 375, 768, 1024, 1440 and 2560, plus each project breakpoint and the width 1px below it. The short sizes are exact too: 812×375 for a phone held sideways and 320×256 for 400% zoom. A width reasoned from the media queries is a finding.
When this skill loads on its own after a layout change, run the quick tier. Render 375, 768 and 1440 wide plus the breakpoint edges nearest the change, and run overflow.js on each. Run every step below when the user asks, names a phone or a width, or before a release.
Run each script by passing the file's contents to the browser tool's evaluate call, or load it with Playwright's page.addScriptTag({ path }). Set each size with Emulation.setDeviceMetricsOverride, passing width, height, deviceScaleFactor and mobile.
Opening the result belongs to verify. Alignment inside one render belongs to alignment. Rendering a component inside the container it ships in belongs to stress. Safe areas, hit areas and dynamic viewport units belong to defaults, and a failure there cites its id.
1. Read the breakpoints
Read the breakpoints from the CSS, the Tailwind config or the tokens. Add each one and the width 1px below it to the fixed widths. A sweep that skips the edges of a breakpoint is viewports-cross-each-breakpoint.
Run overflow.js once. Its breakpoints field reads every width query in the loaded stylesheets and lists widths, the edges to render and the gaps. Queries set only from JavaScript, such as matchMedia, never show there.
Each entry in gaps is a max-width up to 1px below another query's min-width. A max-width: 767px beside a min-width: 768px leaves 767.5px matching neither, and browser zoom or fractional display scaling lands there. That gap is viewports-no-breakpoint-gap.
2. Render each width
Render 320×568, 375×812, 768×1024, 1024×768, 1440×900 and 2560×1440. Breakpoint edges render 800px tall. Emulate touch at every width under 1024 with Emulation.setTouchEmulationEnabled. Take a full-page screenshot of each. A layout judged from the code is viewports-render-every-width.
At 375×812, set Emulation.setSafeAreaInsetsOverride to 44px top and 34px bottom. At 812×375 they are 44px left and right and 21px bottom. Clear them with empty insets before the other widths. A bar drawn under an inset cites defaults-safe-areas.
At 2560 the content sits centred in its column or uses the width on purpose. A 1200px column pinned left with 1360px of blank space beside it is viewports-widest-width.
3. Measure each render
Run overflow.js at each width. Treat each result as a candidate until a crop of that width shows it.
The page never scrolls sideways, though a box may scroll inside itself. A 40px sideways scroll at 320 is viewports-no-sideways-scroll. The script checks the right edge, or the left edge on a dir="rtl" page. A culprit under aria-hidden, inert or visibility: hidden still scrolls the page and carries hidden: true.
At 1440, set window.__viewportsOptions = { scrollbar: true } and run the script again. It draws the classic 15px scrollbar that macOS and touch emulation hide, and its scrollbar field reads 15 when that took effect. Delete window.__viewportsOptions afterwards, or every later run draws it too. A width: 100vw band 15px wider than the page is viewports-classic-scrollbar, so search the CSS for 100vw. A centred column that jumps 15px between a short page and a long one cites defaults-scrollbar-gutter.
Text is never cut by its box without an ellipsis or a clamp. The script flags a box with overflow: hidden or clip whose own text, direct or nested, runs past its edge. A button label cut in half at 375 is viewports-no-clipped-text. A target under 24px cites defaults-hit-area.
4. Tap at touch widths
Tap through the page with touch emulated. Row actions, copy buttons and menus that appear on hover need another way to appear. A delete button that shows only on row hover is viewports-no-hover-only-controls.
5. Shorten the height
Render 812×375. The page works in both orientations and never asks to be turned. A "Rotate your device" overlay at 812×375 is viewports-both-orientations.
Open each dialog, sheet and menu at that size. Content scrolls inside the overlay and its actions stay reachable. A dialog whose Save sits below the screen with no scroll is viewports-short-heights. A 100vh or h-screen app shell cites defaults-dynamic-viewport.
6. Zoom to 400%
Render 320×256 at a device scale factor of 4, which is a 1280×1024 window zoomed to 400%. Run overflow.js again. Text reflows with no sideways scroll.
Under 480px of height, fixed and s
Установить viewports в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл viewports?
Renders a page at every width, each breakpoint edge, a short landscape phone, 400% zoom, 200% text and spaced, longer, shorter, unbroken or mirrored text, then reports what overflows, clips or hides.
Как установить скилл viewports?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл viewports запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic