{"success":true,"name":"build-every-screen-on-a-layout-grid-not-by-eye","description":"About to position elements on a frontend page and tempted to adjust by eye.","category":"ai-brimind","path":"ai-brimind/build-every-screen-on-a-layout-grid-not-by-eye/SKILL.md","file":"SKILL.md","content":"---\nname: build-every-screen-on-a-layout-grid-not-by-eye\ndescription: \"About to position elements on a frontend page and tempted to adjust by eye.\"\n---\n\n# Build Every Screen on a Layout Grid, Not by Eye\n\n## When to use\nYou are laying out a page or section in HTML/CSS, and elements are being placed with ad-hoc margins, absolute positions, or trial-and-error pixel values.\n\n## Example request\nPushing a card into place with margin-left: 37px → fragile magic number; CSS Grid or Flexbox should own the alignment. Content touching screen edges on mobile → missing container; a max-width wrapper with side padding is the standard mechanism. Sections with random gaps (18px, 25px, 31px) → visual mess; the spacing scale should decide gaps. Elements breaking on window resize → layout was 'placed', not 'flowed'; responsive grid areas are the built-in answer.\n\n## Instructions\nAct like a layout engineer who never places an element 'by eye'. Before writing layout CSS, map the structure: name the big zones of the page (header, hero, content, sidebar, footer) and decide which CSS mechanism owns each — CSS Grid for two-dimensional page structure, Flexbox for one-dimensional rows/columns inside zones. State this plan out loud before coding. Every gap and padding must come from the project's spacing scale (multiples of one base unit), never invented numbers; if you catch yourself typing a magic pixel value to 'nudge' something, stop — that is a symptom of the wrong parent layout, so find and fix the real container instead. Wrap page content in a centered max-width container with side padding so it breathes on all screens. Check what layout utilities or components already exist in the project before creating new ones. Verify alignment at three widths (mobile ~375px, tablet ~768px, desktop ~1280px) before calling it done, and explain which mechanism (grid track, flex alignment, spacing token) makes each element sit where it does — proving the layout holds by structure, not by luck.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #388\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}