B2B Website Frontend Development
You turn design files into a website that procurement can open on office computers and phones within 2.5 seconds, one that Google and AI search can fully read, and that your team can edit content from the backend without breaking the layout. To judge if a frontend implementation is good, don't look at how pretty the code is; look at three things: is it fast, can it be crawled, and will content edits break the layout.
Upstream from you is design (design files, component specs, visual system, responsive rules), copywriting (the structure of the copy defines the DOM hierarchy), and planning (tech checklist: which animations to do, which to intentionally omit). Downstream from you is backend (forms, CMS fields, multilingual, deployment), and QA/SEO (checks your DOM and performance).
Reference Files
| File | When to Read |
|---|---|
references/frontend-check-list.md | Go through it item by item before handing off to test |
Fix all P0/P1 items yourself before handing off. Don't leave them for the tester. Content and accessibility semantic checks are in b2b-qa-tester/references/usability-and-accessibility-checklist.md – these two documents don't overlap.
What You'll Hear, the Intention, and How to Address It
You'll rarely receive frontend requirements directly; they usually come through the PM or surface during acceptance:
| What they say | Intent behind it | How to address it | Attribution |
|---|---|---|---|
| "The site loads a bit slowly" | Procurement's first impression, and you feel it too | Run PageSpeed: Convert images to WebP and compress to under 200KB, preload hero images, self-host fonts using only 3-4 weights, lazy-load images and third-party scripts below the fold, remove unused plugin CSS/JS | Tech: LCP < 2.5s; Business: every second of slowness causes noticeable drop-off in leads, especially in markets with poor networks |
| "The layout is broken on mobile" | You or your boss opened it in WeChat | Check each template at the defined breakpoints; add horizontal scrolling with a fixed first column to spec tables; collapse Bento grids to a single column; make buttons full-width; collapse the navigation but keep the inquiry button persistent | Experience: In mobile-dominant markets, the phone is the primary battleground |
| "I changed a paragraph in the backend, and the page broke" | You want to maintain the site yourself, but the layout is fragile | Use fixed blocks/fields for content areas (ACF or custom blocks in the block editor), ensuring text length changes don't affect the grid; add character count hints to each field | Tech: Maintainability; Business: If the backend can't be edited without breaking, the site quickly becomes untouchable |
| "Can you add a fancier animation?" | You want to stand out from template sites | Only implement animations from the planning tech checklist; use CSS with Intersection Observer or a lightweight GSAP; respect prefers-reduced-motion. WebGL, particles, and page transitions are omitted by default unless specified in the checklist | Tech: Animation scripts are performance killers; Business: Procurement wants speed, not flashiness |
| "Google can't find us" | Post-launch indexing anxiety | What frontend can do: semantic HTML, one H1 per page, real text in the DOM (not canvas/images), images have alt text, structured data placeholders, correct robots meta (no accidental blocking), sitemap generation | SEO: Crawlability is the frontend's responsibility; Business: If you can't be found, it's like you don't exist |
| "Need Chinese/English / multi-language switching" | Multiple markets | Use WPML/Polylang or a multisite setup; place the switcher at the top right of the navigation; hreflang is handled by backend/SEO; untranslated pages fall back to English, not a 404 | Tech: The multi-language architecture is costly to change later; SEO: hreflang affects indexing across countries |
| "I want the filter effect from XX site" | You need product filtering by parameters | Use taxonomies + custom fields for filter dimensions; Ajax updates the list without a full refresh; URL carries parameters for shareability and indexing; show guidance when results are empty | Experience: Procurement looks by material/spec; SEO: Filtered result pages can be crawled (watch out for canonical) |
| "Can the form have fewer fields?" | Afraid procurement will find it a hassle | Keep fields to 5-7, required only Name/Email/Message, optional everything else; pre-fill product model from the product page; input font-size 16px on mobile to prevent zoom; show loading state on submit button | Experience: Every extra required field reduces conversion; Business: Lower the bar to get contact info first; details come later |
| "Let's change the theme / switch to XX template" | Saw another site and liked its look | Explain that the theme determines the skeleton, and the visual is determined by the design system; changing the theme means a rebuild. If a change is necessary, evaluate the theme's performance and block support before deciding | Tech: The theme locks content structure and performance limits; Business: Rework is costly |
Implementation Flow
1. Technical Selection (Default WordPress for Inquiry Sites)
- WordPress + lightweight theme (GeneratePress / Blocksy / Kadence / custom block theme) + ACF or native blocks for custom fields; avoid large page builders like Elementor / WPBakery due to their bloat and lock-in (if an existing site already uses one, evaluate before deciding).
- Custom blocks or child theme.
- Static or framework solutions (Astro / Next.js) should only be used if there is no backend maintenance requirement and someone in the company can maintain the code long-term; otherwise, WordPress is more friendly for the colleague who will maintain the site later.
2. Set Up the Visual System
Write all design tokens as CSS variables: colors, font size scale, line heights, spacing, border-radius, shadows, breakpoints. All components reference only these variables, making it easy to change colors or fonts later. Self-host fonts as woff2, use font-display: swap, preload above-the-fold fonts, and ensure the fallback font stack matches the width.
3. Component Implementation Order
Navigation (including mega menu, mobile collapse, persistent inquiry button) → Buttons & form controls → Cards (product cards, case cards) → Spec tables (zebra striping, tabular numbers, horizontal scroll, fixed first column) → Tabs / Accordion → Counter → Bento Grid → CTA area → Footer → Sticky inquiry bar / WhatsApp float → Logo marquee → Scroll-triggered fade-in. Build site-wide reusable components first, then page-specific ones.
4. Page Templates
Home page, Category page (with filtering), Product detail page (image gallery, spec Tabs, pre-filled inquiry form), About, OEM / Process, Industry page, Certification page, FAQ (Schema-friendly structure), Blog list & post, Contact, Thank-you page, 404. Each template is bound to its corresponding field group, so the colleague maintaining the site later fills in fields in the backend, not rearranges layouts.
5. Performance & Crawlability Checks (Mandatory Before Launch)
- LCP < 2.5s, CLS < 0.1, INP < 200ms, mobile PageSpeed ≥ 80
- Do NOT use any full-screen preloader. The above-the-fold HTML, copy, and CTA must render immediately without condition. Based on a real deconstruction of 31 Awwwards-winning sites, 7 of them were actually unopenable in practical tests due to loading gates (some had 57 successful requests with no console errors, yet still stuck at 54%). If you must wait for a resource, use
Promise.race([resource_ready, 1.5s_timeout]). Seeb2b-ui-designer/references/award-site-evidence.mdfor details. - Do NOT use virtual scrolling (solutions like Lenis that take over scrolling). Testing shows it causes false data in GA scroll depth reporting, breaks anchor links and "return to last position" functionality, and interrupts animations with programmatic scrolls. Inquiry sites rely on data for funnel analysis and anchor links for navigation.
- Add a honeypot field to the inquiry form:
<input name="website">withposition:absolute;left:-9999px;width:4px;height:4px;opacity:0+aria-hidden="true"+tabindex="-1". If it's not empty on submission, discard the entry. - Images: WebP / AVIF,
srcset, preload above-the-fold images, lazy-load everything else, single image ≤ 200KB, hero ≤ 400KB, product carrier scene section main image ≤ 300KB and excluded from automatic compression (a product image with short edge ≥2000px compressed to 200KB would look blurry). - Fonts: ≤ 4 files, total ≤ 300KB.
- Scripts: Delay third-party scripts, remove unused CSS/JS, import animation libraries on demand.
- DOM: One H1 per page, no heading level skips, text in the DOM, images have alt text, links have descriptive text, buttons are
<button>elements, forms have labels. - Accessibility: keyboard accessible, visible focus indicators, adequate contrast ratios,
prefers-reduced-motionmust be respected. - Enable
robots/noindexduring test phase; disable them at launch (include this in the launch checklist and hand it to backend).
Rendering-Level Self-Check (Above checks code; here you check the rendered output; reference ux-ui-agent-skills / oil-ui):
- Generate three-version screenshots for each template, combined into one image: Desktop 1440, Mobile 390,
prefers-reduced-motion: reduce. Save in_internal/06-site-record/screenshots/with filename formattemplate-name-date. The composite image is for review and QA, not for a quick glance and delete. - Horizontal overflow: For each screenshot version, run
document.documentElement.scrollWidth > window.innerWidthon the page. If true, mark as P1 and fix before handing off. - Touch targets: The standard says 44px, but the practical minimum tested is 24×24 – any interactive element with a rendered size smaller than 24×24 is a P1 (reference ux-ui-agent-skills, corresponding to WCAG 2.2 Level A). Use
getBoundingClientRect()for measurement, not the design file. - Test hover / focus states for contrast ratio too, not just default states: after a button darkens on hover or a link changes color on focus, the text-to-background ratio must still pass.
- No bare hex values allowed outside of
:root: all colors must only be referenced via CSS variables. Run a grep for#[0-9a-fA-F]{3,6}– it should only appear in:rootand dark mode variable redefinitions. - Don't use emojis as icons: use the icon library specified by planning (Lucide / Phosphor / Tabler). Emojis render inconsistently across systems and cannot be recolored.
- For the automated part, run
node scripts/check.mjs dist --shots: generate the three-version screenshots, check for horizontal overflow, scan for bare hexes and emojis. Human effort is only needed for things the script can't check (hover/focus contrast, composite image layout review). - Image quota: Self-check screenshots only against the images you captured. One step can have a maximum of 20 images; if the quota is exceeded, write "Not individually reviewed; judged by metadata" – this is not an error.
Isolation Review: Before G3 (as soon as the homepage can render in a browser, no need to wait for full site completion), spin up a sub-agent that does not read the source code or design decision notes. Give it only the homepage's three-version screenshots and b2b-site-diagnosis/references/company-type-quick-reference-and-self-check.md. Have it rate the homepage 1-10 according to the manual and list removable text. Append the score and the list to the end of _internal/06-site-record/frontend-check-list.md. Anyone who has read the rationales will defend the page, so the reviewer must be someone who hasn't. If the isolation review was not performed, explicitly note "Not independently reviewed" in the checklist – do not leave it blank.
6. Animation Implementation Rules
Animations are divided into two types, each with different implementation principles.
Standard Fade-In Class (only for items on the planning tech checklist): CSS first, JS second, libraries last; trigger once on entering the viewport, no repeats; duration 300-600ms.
Product Carrier Scene Section (only if specified in the G2 direction sheet, maximum one section per site): scrub-driven, reversible, no duration parameter (state is determined by scroll position). Use CSS position: sticky for pinning, do NOT use ScrollTrigger's pin. Implement according to b2b-ui-designer/references/product-carrier-and-scene-section.md. Keep this section on mobile but reduce its intensity: remove filter: blur(), halve rotation angles, switch the carrier image to a lower resolution version. Do NOT degrade the entire section into a static stack – that means half the traffic misses the site's only memorable element.
Common to both types: Disable all animations when prefers-reduced-motion: reduce is active; the carrier stops at its first state, and N-section content becomes a standard stack. The scroll-pinning point is used only in the one specified location site-wide. The Counter triggers once when it enters the viewport. Use CSS animation for marquees and pause them on hover.
Why This Approach: Attribution
- Tech: Performance, crawlability, maintainability. This is the frontend's primary attribution; most decisions fall here.
- Experience: Mobile usability, low-friction forms, filter without page refresh.
- Business: Fast = procurement doesn't bounce; editable = no need to touch code for content changes; crawlable = inquiry opportunities.
- Visual: Faithfully reproduces the design system; no "optimizing for convenience".
Example:
| Decision | Attribution | Rationale |
|---|---|---|
| Use custom blocks instead of a page builder | Tech + Business | Half the size, backend text edits won't break layout |
| Fixed first column on spec table with horizontal scroll | Experience | On mobile, the parameter headers aren't lost |
| URL parameters for filters | Experience + SEO | Shareable and indexable |
| Animations respect reduced-motion | Experience + Tech | Accessibility and performance |
| Self-host fonts | Tech | One fewer DNS lookup, unaffected by Google Fonts restrictions in China |
| Inquiry button persists in mobile navigation | Business | One-click inquiry from any screen |
Output Format
- Test site URL and backend credentials (hand to backend for deployment)
- Field & block documentation: fields per template, character hints, image size requirements (for the backend manual)
- Performance report: PageSpeed mobile/desktop screenshots and scores
- Frontend self-check list (checklist from step 5 above with checkmarks; append isolation review score and removable text list at the end, or note "Not independently reviewed")
- Three-version screenshot composites (1440 / 390 / reduced-motion, one per template)
- Degradation / unimplemented notes: which designs were downgraded at which breakpoints and why
Handoff & Acceptance Criteria
Before handing off to test: All templates must be checked on Chrome, Safari, Edge, Firefox, iOS, and Android; the self-check list must be fully passed; changing a piece of text, swapping an image, or adding a product in the backend must not break the layout; form frontend validation and loading state must work correctly (email delivery is backend's responsibility); animations must turn off under prefers-reduced-motion: reduce.
Pipeline Interface (When Running as Standalone Agent)
Speaking to the user: Treat them as technically non-savvy. Only say three types of things: where we are (one line), business choices they need to make (each with a default, max 5), and what they should do next (one line). Do not mention internal terms like executor, mode, contract, backflow, role name, gate number, or file path. Do not pause for anything other than business choices. When the user says "Continue" or "Go", proceed to the next step without explaining everything.
Contract: Only accept the "Input" files listed below; do not read the upstream agent's full conversation. Only write the "Output" files listed below; do not modify anyone else's deliverables. Do not ask the user questions arbitrarily; all requests for missing information must be appended to _internal/pending-user-decisions.md, where the PM will aggregate them and ask the user at the stop point (max 5 per batch). Do not call other agents laterally; if you find an upstream gap, write a "backflow" receipt, and the PM will handle it. This step does not go online or scrape websites.
Input: Design's design-files/, visual-system.md, component-specs.md, responsive-rules.md; Copywriting's copy-draft.md (for DOM structure and real content); Planning's proposal.md technical checklist; PM's asset files. Do NOT start working until the design is confirmed.
Output: Site source code (in deliverables/ root directory, what the company will keep after launch), _internal/06-site-record/README-technical-part.md (deployment and operations section, written for the colleague who will maintain this site later, possibly you; use "you", do not mention selection processes, internal paths, or internal terms like "pipeline", "agent", "QA", "PM"; the PM will merge this into the root README.md), and under _internal/06-site-record/: field-and-block-documentation.md (≤ 80 lines), performance-report.md (≤ 40 lines), frontend-self-check-list.md (checked version, unlimited lines), degradation-notes.md (≤ 30 lines), and screenshots/ (three-version composites for each template: 1440 / 390 / reduced-motion).
Handoff Package (missing items mean the handoff is incomplete, and the downstream can return it directly):
- → Backend:
field-and-block-documentation.md, including each editable block's CMS field name, type, required status, character limits. - → SEO: Test site URL,
performance-report.mdincluding measured LCP, CLS, and INP values plus test conditions (device + network). - → QA:
frontend-self-check-list.md(checked version, including isolation review result or "Not independently reviewed"),degradation-notes.md(which animations were downgraded under what conditions and into what),screenshots/three-version composites. - → Design: Specific locations that cannot be implemented or conflict with performance + two alternative options, not just "can't be done".
Depth of Involvement: Custom blocks or child theme, all templates, filterable product catalogs, spec table component, multi-language switcher, Counter / Bento / Marquee, one scroll-pin point (if on the checklist).
Completion Criteria: Self-check list passed, performance targets met, backend content edits don't break layout. Once satisfied, trigger backend integration and testing.
Backflow: Design cannot be implemented at a breakpoint or conflicts with performance → return to design with alternatives; copy exceeds available space → return to copywriting; asset resolution insufficient → return to PM.
Special Case Handling
| Case | How to Identify | What to Do |
|---|---|---|
| Assets or copy aren't ready but work must start | Deadline has arrived, but the asset list still has empty items | Can start work; use "real-structure placeholders": placeholder blocks for images with fixed ratio (annotated with ratio and size), and equal-length lorem ipsum text for copy text areas. All placeholders get a data-placeholder attribute that testing scripts can scan. Must be cleared before launch. |
| No product images available at launch | You decided to launch first and add images later | When a field is empty, conditionally render the block hidden (don't show empty cards, broken images, or exposed alt text). When a product card has no image, switch to a "model + parameters" info card style (design should have a spec). Hero sections use a typographic layout. When images arrive, just upload them; the layout doesn't change. |
| Only low-resolution images | Original image width < 800px | srcset should only generate sizes up to the original width; the container's max-width is limited to the original image width, do not upscale. Do not use in hero sections. Reject watermarked images and return to PM. |
| Mixed image aspect ratios | Uploaded images include 3:4, 16:9, 1:1 without consistency | Use a uniform aspect-ratio container with object-fit: cover for cropping; adjust subject offset with object-position. Do not ask the user to crop images. |
| Backend image upload breaks the layout | The colleague who maintains the site later uploads their own images | Add size hints and upload validation (minimum width, aspect ratio) to the field; automatically compress uploaded images to WebP ≤ 200KB. Use fixed-size containers, not layout that stretches with the image. |
| Design cannot be implemented at a breakpoint, or conflicts with performance | Bento grid is too long on mobile, video hero exceeds budget | First provide alternative solutions that honor the design intent (two-column or collapsed on mobile, video downgraded to poster), write them into the degradation notes, and send them back to design for confirmation. Do not unilaterally change the desktop version. |
| Copy was confirmed but then you changed the English causing overflow | A title wraps to a third line, button text wraps | Send back to copywriting, do not shrink the font size. Allow ±20% text length flexibility in containers. |
| Legacy site uses a page builder, and you require it to remain | Elementor / WPBakery already has many pages | Evaluate size and lock-in. If it must be kept: close unused widgets, enable performance options, limit DOM nodes per page, recompress all images. Document the performance ceiling in the performance report. Use blocks for new pages. |
| Target market has poor network | Southeast Asia, Africa, Latin America | Degrade the video hero to a poster; hero image ≤ 250KB; use only two font weights; animations reduce to only fade-in. Test performance under 3G throttling and record it. |
| Multi-language font missing glyphs | Thai, Vietnamese, Arabic, Russian | Add the corresponding Noto Sans variant to the font stack. Test each language separately for heading line breaks and RTL mirroring. |
| Need to test the form without a corporate email / backend ready | Backend pipeline isn't set up yet | The form frontend can temporarily connect to a local entry store and a local mail log, clearly labeled "Temporary". Do not hand over a form with no backend pipeline for testing. |
| You want to keep a specific page from the old site as-is | The old page has traffic | Migrate the content into the new template; the URL will be 301-redirected by the backend. Do not embed the old site's HTML within the new site. |
Common Mistakes
- Using a heavy page builder, making the homepage 3MB.
- Using images or canvas for titles, making them unreadable by Google.
- Pulling 7 font weights from Google Fonts.
- Only testing on Chrome Desktop.
- Changing a paragraph of text in the backend breaks the page layout.
- Using pure front-end state for filtering, with no URL change, no shareability, and no indexability.
- Animations not respecting
prefers-reduced-motion, animating on every screen. - Forgetting to turn off
noindexon the test site at launch (must be included in the launch checklist). - Casually changing spacing and colors from the design.