--- title: Visual craft slug: visual prefix: VIS order: 9 summary: Hierarchy, focus and restraint, and how to avoid the generic look of AI-made UI. --- Visual design is how people tell what matters. These rules are about clarity rather than taste. For brand and tokens, use your DESIGN.md. ## VIS-01: One primary action per view - **Level:** MUST - **Why:** When everything is emphasized, nothing is. One clear primary action tells people what to do next. - **Do:** Use one filled primary button per view or section, with secondary and tertiary styles for the rest. - **Don't:** Put three filled buttons of the same color side by side. - **Check:** visual - **Test:** Each view has at most one primary-styled button per section. ## VIS-02: Build hierarchy with size, weight and space before boxes and color - **Level:** SHOULD - **Why:** Borders, cards and colors added everywhere create noise. Space and type create order. - **Do:** Group related items with proximity, separate sections with whitespace, and rank content with type size and weight. - **Don't:** Wrap every element in a card, or put cards inside cards. - **Check:** visual - **Test:** No card is nested inside another card, and section separation comes mainly from spacing. ## VIS-03: Use tokens, not one-off values - **Level:** SHOULD - **Why:** One-off spacing, colors and font sizes add up to an interface that feels slightly off everywhere. - **Do:** Take spacing, color, radius and type from the design tokens in DESIGN.md or your theme. - **Don't:** Hard-code `margin: 13px` or a hex color that isn't in the palette. - **Check:** auto - **Test:** Styles use only token values. Flag hard-coded colors and spacing that aren't on the scale. ## VIS-04: Avoid the generic AI look - **Level:** SHOULD - **Why:** People have learned to spot default AI-made UI, and it reads as low effort. - **Do:** Start from the product's own content and brand. Use icons from one consistent set. - **Don't:** Default to purple-blue gradients, emoji as icons, centered everything, glassmorphism or a sparkle icon on every feature. - **Check:** visual - **Test:** A reviewer can't point to any default AI pattern that the brand doesn't justify. ## VIS-05: Opening an overlay never shifts the page - **Level:** SHOULD - **Why:** Many modal and drawer libraries hide the scrollbar to stop the page scrolling. The page gets about 15 px wider and everything behind it jumps sideways. - **Do:** Reserve the scrollbar space once with `html { scrollbar-gutter: stable; }`, or compensate for the scrollbar width when locking scroll. - **Don't:** Lock scrolling with `overflow: hidden` and let the layout jump each time a modal opens and closes. - **Check:** walkthrough - **Test:** With Chrome DevTools' "Layout Shift Regions" on, opening and closing modals, drawers and menus shows no shift behind them. ## VIS-06: Name color tokens by their role, not their appearance - **Level:** SHOULD - **Why:** Names like `blue-500` say what a color looks like, not when to use it, so people guess, and the palette drifts. - **Do:** Name tokens by element and purpose, such as `text.danger`, `surface.subtle` or `border.accent.strong` (element, tone, emphasis, state, at most four parts). - **Don't:** Reference raw palette colors like `blue-500` or `grey-100` directly in components. - **Check:** auto - **Test:** Components only use role-named tokens; raw palette names appear only where the tokens are defined. ## VIS-07: Put actions close to what they act on - **Level:** SHOULD - **Why:** Fitts's law: the farther and smaller a target, the longer it takes to reach. Actions far from the content make people hunt and travel. - **Do:** Place the submit button right after the last field, and row actions on the row itself. Make frequent actions larger and easier to reach. - **Don't:** Put the only "Save" button in the top corner, far from the end of a long form. - **Check:** visual - **Test:** Each primary action sits next to the content it affects, and the most-used actions are the largest and closest targets. ## VIS-08: Align everything to a consistent grid - **Level:** SHOULD - **Why:** Edges that almost line up look accidental. A shared grid makes layouts feel calm, consistent and professional. - **Do:** Use a column grid and a spacing scale, and align text, inputs and cards to the same edges. - **Don't:** Nudge elements a few pixels by eye, so left edges and gaps drift between sections. - **Check:** visual - **Test:** With a grid overlay on, content edges line up with columns and gaps use the spacing scale.