The PR adds @media (max-width: 768px) or a Tailwind-style arbitrary max-[820px] in a feature file. The repo already has breakpoint tokens — --breakpoint-md, theme.screens.md, or a media.md helper — and nearby layout already uses them. 768 and 1024 look familiar from tutorials, and they are not necessarily the tokens this product actually ships.
I've started treating a magic media-query pixel as a scale break, not as a quicker layout tweak. Collapsing a sidebar is the easy part. A shared set of breakpoints is why the tokens are there.
Why the magic pixels show up
A tutorial "mobile layout" example is @media (max-width: 768px) or 768px in a hook. The model can write that without finding tokens/breakpoints or the theme screens map. Your tokens may live in CSS variables, a Tailwind theme, or a useBreakpoint hook, which is easy to miss if the prompt only says "stack this on small screens."
You also skip the difference between min-width and max-width ranges, the token for the actual tablet or sidebar cutoff, and the rule about not inventing a one-off 820px because the mock was 820 pixels wide.
A simple breakpoint policy
- New layout queries use the existing breakpoint tokens
- Do not hardcode 768, 1024, or other magic pixels in a feature file
- Do not add an arbitrary screen to win one component
- A new breakpoint is a token change, with a note in the scale
If the job is spacing or typography, that is the existing spacing or type scale, not a new media query. If one component truly needs a one-off container query, say so, and do not pretend it is a product breakpoint.
What to put in the prompt
Use the existing breakpoint tokens for this layout change. Do not hardcode 768px, 1024px, or other magic media-query pixels in this file. Keep min/max ranges on the shared scale or the existing breakpoint helper. If you need a new cutoff, add it as a token, not as a one-off pixel value. Paste one existing tokenized media query or useBreakpoint usage. In review, search the diff for raw px in @media, arbitrary screen classes, and a hook that compares window.innerWidth to a literal.
Reject / send back
Reject
- A feature-level media query that hardcodes tutorial pixels
- A new 820px cutoff copied from a mock width
- A
window.innerWidthcheck that bypasses the existing breakpoint helper - A second breakpoint map added for one layout
Accept
- A layout that uses the existing breakpoint tokens or helper
- A token PR that adds a documented breakpoint and updates the scale
- A container query that is clearly local and is not named as a product breakpoint