Miniapp Figma Alignment
Official Baselines
Use these facts before applying project-specific rules:
- WeChat WXSS adds
rpx as a responsive unit and defines the screen width as 750rpx.
- uni-app supports
px and rpx; for normal Vue page layout, treat 750rpx as the full screen width unless the project has an explicit alternate unit system. Use upx only when maintaining older code that already uses it.
- uni-app
nvue/uvue, App titleNView, plus APIs, canvas, and native APIs can have different unit rules. Verify before converting those values to rpx.
- Taro recommends writing design dimensions as
px only when the project designWidth matches the design draft width. Taro's default designWidth is 750, and pxtransform converts eligible lowercase px.
- Taro JS inline styles are not rewritten by compile-time
pxtransform; convert values to final rpx or use the project's runtime helper.
Primary docs to check when uncertain:
- WeChat WXSS:
https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxss.html
- uni-app CSS and units:
https://uniapp.dcloud.net.cn/tutorial/syntax-css.html
- Taro design and size units:
https://docs.taro.zone/docs/size
- Taro compile config:
https://docs.taro.zone/docs/config
Core Rule
Treat Figma measurements as design-canvas pixels, not web CSS pixels. Always identify the target unit pipeline before writing dimensions.
General formula:
scale = targetDesignWidth / figmaFrameWidth
targetValue = figmaPx * scale
Common targets:
- Native WeChat/Alipay/Douyin/QQ-style mini-program styles: usually
targetDesignWidth = 750; verify the target platform's style language and then write targetValue rpx unless the platform or codebase uses another responsive unit.
- uni-app mini-program target:
targetDesignWidth = 750, write targetValue rpx in page/component styles.
- Taro mini-program target with global
designWidth = 750: choose one strategy per layout region. Either write final scaled rpx, or write project-design px that will be converted by pxtransform.
- Taro project whose
designWidth equals the Figma frame width: stylesheet px may be 1:1, but still verify pxtransform, selector blacklists, and inline style behavior.
Do not assume figmaFrameWidth = 750. Designers may use 375, 390, 393, 402, 414, 430, 750, or another frame width inside the same product.
Inputs to Confirm
Before editing, establish:
framework: native mini-program, uni-app, Taro, or another framework.
targetPlatform: WeChat, Alipay, Douyin, QQ, Baidu, Kuaishou, DingTalk, Feishu, or mixed.
figmaFrameWidth: read from Figma metadata/design context or the screenshot dimensions.
targetDesignWidth: usually 750 for direct rpx; for Taro, read designWidth.
unitPipeline: native stylesheet, uni-app style block, SCSS/Less, CSS modules, Tailwind/UnoCSS, inline style, or canvas/API pixel values.
runtimeChrome: native/custom navigation, tab bar, capsule/menu button, status bar, safe area, popup, and fixed footer behavior.
Platform Review Rules
Use this quick check before choosing a conversion pattern:
| Branch |
Good default |
Main exception |
| Native mini-program |
Convert Figma px to final rpx with 750 / figmaFrameWidth. |
Confirm platform file extensions and style-unit support; keep true hairlines and API pixel values as px when required. |
| uni-app |
In Vue page styles, convert Figma px to rpx with 750 / figmaFrameWidth. |
nvue/uvue, App titleNView, plus APIs, canvas, and native modules can require px or have special semantics. |
| Taro |
Prefer the existing project convention: final rpx helper or pxtransform via designWidth. |
Do not mix final rpx and transformable px for the same Figma values in one layout region. Inline styles need runtime conversion. |
First-Pass Investigation
Run targeted searches before editing:
rg -n "designWidth|deviceRatio|pxtransform|selectorBlackList|postcss-pxtransform" . --glob '!**/node_modules/**'
rg -n "toRpx|upx2px|pxTransform|px\\(|rpx\\(|750 /|designWidth" . --glob '!**/node_modules/**'
rg -n "navigationStyle|navigationBar|usingComponents|tabBar|pages.json|manifest.json|app.json" . --glob '!**/node_modules/**'
rg --files . --glob '*.wxml' --glob '*.wxss' --glob '*.axml' --glob '*.acss' --glob '*.ttml' --glob '*.ttss' --glob '*.qml' --glob '*.qss' --glob '*.vue' --glob '*.tsx' --glob '*.scss' --glob '*.less' --glob '!**/node_modules/**'
Then inspect:
- The exact page/component files and nearby sibling pages.
- The exact Figma node width, screenshot width, and intended phone model if given.
- Existing unit helpers, global SCSS variables, and project conventions.
- Whether static layout is in stylesheets and dynamic values are in inline style objects.
- The app/page navigation configuration and real mini-program chrome.
Framework Detection
Use file/config shape to choose the branch:
- Native WeChat:
app.json, project.config.json, .wxml, .wxss, .js, .ts.
- Native Alipay:
app.json, .axml, .acss, mini.project.json.
- Native Douyin/ByteDance:
.ttml, .ttss, platform project config.
- Native QQ/Baidu/Kuaishou/DingTalk/Feishu: platform templates plus style files similar to WXSS/CSS.
- uni-app:
pages.json, manifest.json, .vue pages, uni.scss, uni_modules.
- Taro:
config/index.*, src/app.config.*, @tarojs/*, .tsx/.jsx pages.
- Other cross-frameworks: identify their unit transform plugin and generated mini-program output before changing dimensions.
If the framework is ambiguous, inspect package.json, app config, and page extensions before assuming Taro.
Workflow
Inspect the Figma node or screenshot before editing.
- Use Figma design context for layout, text, colors, assets, and frame width.
- If using image-to-ui output, load
image-to-ui-skill first and separate code-rendered UI from bitmap assets.
Identify implementation context.
- Confirm framework, target platform, and page route.
- Read app/page config for navigation, tab bar, component registration, and safe-area behavior.
- Check nearby pages for the established unit convention.
Choose the scaling strategy.
- Direct
rpx projects: write scaled rpx from the real Figma frame width.
- Existing Taro project: do not change global
designWidth for one page; use a local helper unless the whole project is moving to a new design system.
- New Taro project: align
designWidth and deviceRatio to the design draft if that is the product-wide standard.
- Mixed design widths: keep path/package-specific helpers; only use Taro
designWidth(input) when the project intentionally supports that pattern.
- API/canvas/native pixels: convert
rpx to device pixels with the platform/framework helper at runtime.
Compute scale from actual values.
- Native/uni-app target:
scale = 750 / figmaFrameWidth.
- Taro target:
scale = taroDesignWidth / figmaFrameWidth when converting to project design units, or 750 / figmaFrameWidth when writing final rpx directly.
- Keep the helper near the page styles or reuse an existing shared helper.
Convert dimensions consistently.
- Convert width, height, padding, margin, gap, top, left, right, border-radius, font-size, line-height, and border widths.
- Prefer flex, percentage, or
calc() only where the design is genuinely responsive.
- For safe-area spacing, combine scaled spacing with
env(safe-area-inset-bottom) using the project's style syntax.
- Avoid
vw for fixed mobile Figma matching unless the existing codebase deliberately uses it.
Respect mini-program chrome and platform behavior.
- Do not redraw battery, signal, status bar, or the platform capsule/menu button in a real mini-program page.
- For custom navigation, use the project's navigation component or platform menu-button metrics.
- For tab pages, do not add a back button unless the product flow requires one.
- Verify fixed bottom buttons do not cover scroll content or safe-area padding.
Use real assets and configuration.
- Prefer Figma-exported assets, configured remote assets, or backend/OSS content over CSS approximations.
- Do not hard-code configurable examples, icons, prompts, limits, copy, or button text if the backend already owns them.
- Keep route params, event channels, and page callbacks compatible with callers.
Native Mini-Program Pattern
Use direct scaled rpx for Figma-derived layout:
/* frame width 390, target screen 750rpx */
$scale: 1.9231rpx; // 750 / 390
@function fp($value) {
@return $value * $scale;
}
.card {
width: fp(338);
height: fp(296);
padding: fp(16) fp(24);
border-radius: fp(12);
font-size: fp(14);
}
For plain .wxss or platform styles without Sass, either write computed rpx values or add a project-approved preprocessor. Avoid raw Figma px for layout.
.card {
width: 650rpx; /* 338 * 750 / 390 */
border-radius: 23rpx;
}
For dynamic inline style:
const FIGMA_WIDTH = 390;
const toRpx = (value: number) => `${(value * 750 / FIGMA_WIDTH).toFixed(2)}rpx`;
Keep platform-required fixed pixels as px, especially 1px hairlines, canvas dimensions, and values passed to native APIs that explicitly require physical or logical pixels.
uni-app Pattern
In .vue pages/components, prefer the existing rpx style convention:
$figma-width: 390;
$scale: 750rpx / $figma-width;
@function fp($value) {
@return $value * $scale;
}
.action-panel {
width: fp(338);
padding: fp(20);
border-radius: fp(12);
}
For runtime device pixels, convert responsive units through uni-app APIs/helpers only when a native API, canvas, or measurement call requires physical pixels. Do not replace stylesheet rpx with JS-calculated pixels for normal layout.
For nvue/uvue, App titleNView, plus APIs, or modules that are not regular Vue page CSS, read the local docs/config and nearby code first. In those contexts, px may be fixed, dynamic, or required depending on renderer and target platform.
Taro Pattern
Read designWidth, deviceRatio, and pxtransform before editing. If the project uses designWidth: 750 and Figma width is 402, write scaled final rpx:
$scale: 1.8657rpx; // 750 / 402
@function fp($value) {
@return $value * $scale;
}
.example-card {
width: fp(338);
height: fp(296);
padding: fp(16) fp(32) fp(32);
border-radius: fp(12);
font-size: fp(14);
}
For TSX inline style objects:
const FIGMA_WIDTH = 402;
const toRpx = (value: number) => `${(value * 750 / FIGMA_WIDTH).toFixed(2)}rpx`;
If the codebase standardizes on Taro.pxTransform, pass values after converting Figma pixels to the project's design unit:
const figmaToProjectPx = (value: number) => value * (taroDesignWidth / figmaFrameWidth);
const width = Taro.pxTransform(figmaToProjectPx(338));
Do not call Taro.pxTransform(338) directly unless figmaFrameWidth === taroDesignWidth.
Two Taro strategies are valid; pick one and keep it consistent:
- Final rpx strategy: compute
figmaPx * 750 / figmaFrameWidth and write rpx strings. This bypasses pxtransform for those values and works well for Figma-matched mini-program-only screens.
- pxtransform strategy: compute
figmaPx * taroDesignWidth / figmaFrameWidth, write that as lowercase px in stylesheets or pass it to Taro.pxTransform at runtime. This keeps Taro's multi-end conversion behavior.
Do not write raw Figma px in Taro styles when figmaFrameWidth !== taroDesignWidth, and do not multiply a value into final rpx and then pass it through Taro.pxTransform.
Scale Quick Reference
For 750rpx target:
- Figma
375: 2rpx
- Figma
390: 1.9231rpx
- Figma
393: 1.9084rpx
- Figma
402: 1.8657rpx
- Figma
414: 1.8116rpx
- Figma
430: 1.7442rpx
- Figma
750: 1rpx
For other targets, recompute targetDesignWidth / figmaFrameWidth.
Utility Class and Inline Style Notes
- Verify whether Tailwind/UnoCSS/arbitrary values are transformed before using arbitrary
px classes.
- For Figma-matched screens, prefer a small SCSS/helper function over long arbitrary utility values.
- Search changed files for raw Figma numbers in inline styles and convert them through
toRpx, fp, final rpx strings, or the local equivalent as appropriate.
- Keep 1px hairlines intentional; do not scale them blindly if the platform/component expects a physical border.
- Do not use
uni.upx2px, Taro.pxTransform, or platform pixel APIs for normal stylesheet layout unless the codebase already uses that runtime path.
Visual QA Checklist
Before reporting completion:
- State framework, target platform, Figma frame width, target design width, and scale/helper used.
- Run
rg -n "[0-9]+px" <changed-style-files> and justify remaining CSS px.
- Search inline styles in changed TS/JS/Vue/TSX files for raw design numbers.
- Run the project’s scoped type check or build command for the changed mini-program app.
- Compare the page against the Figma screenshot at the same phone width.
- Check width, top spacing, tab underline, primary button size, card width, image aspect ratio, and fixed bottom placement.
- Check custom navigation, capsule/menu-button clearance, tab bar, and safe-area spacing on real target platform assumptions.
- Check text overflow with real configured/backend copy.
Common Failure Modes
- Everything is half-size: Figma
px was written directly into a 750rpx mini-program layout. Convert with 750 / figmaFrameWidth.
- Everything is too large: the Figma frame was already
750 wide, but values were multiplied again.
- Only one design matches: the scale was hard-coded for one frame width. Re-read the actual Figma node each time.
- Inline styles ignore compile transforms: JS/Vue style objects need explicit
rpx strings or runtime helpers.
- Native page shows duplicated chrome: system status/capsule UI was drawn manually. Use platform navigation metrics instead.
- Looks correct in H5 but wrong in WeChat/Alipay/Douyin: verify in mini-program units and target runtime, not only browser CSS.
- Assets differ from Figma/app config: use exported or configured assets instead of approximations.
Completion Report Template
When finishing a mini-program/Figma alignment task, report:
- Framework/platform:
- Figma node/frame width:
- Target design width:
- Scale/helper used:
- Files changed:
- Remaining raw
px and why:
- Verification command:
- Known visual risks:
1---2name: miniapp-figma-alignment3description: Align native mini-program, uni-app, Taro, and other mini-app framework pages to Figma designs with correct frame-width scaling, rpx/designWidth conversion, platform chrome handling, asset reuse, and visual QA. Use when implementing or fixing any mini-program UI from Figma links, screenshots, image-to-ui output, or user reports that a mini-program layout is too small, too large, misaligned, or not 1:1 with Figma.4---56# Miniapp Figma Alignment78## Official Baselines910Use these facts before applying project-specific rules:1112- WeChat WXSS adds `rpx` as a responsive unit and defines the screen width as `750rpx`.13- uni-app supports `px` and `rpx`; for normal Vue page layout, treat `750rpx` as the full screen width unless the project has an explicit alternate unit system. Use `upx` only when maintaining older code that already uses it.14- uni-app `nvue`/`uvue`, App `titleNView`, plus APIs, canvas, and native APIs can have different unit rules. Verify before converting those values to `rpx`.15- Taro recommends writing design dimensions as `px` only when the project `designWidth` matches the design draft width. Taro's default `designWidth` is `750`, and `pxtransform` converts eligible lowercase `px`.16- Taro JS inline styles are not rewritten by compile-time `pxtransform`; convert values to final `rpx` or use the project's runtime helper.1718Primary docs to check when uncertain:1920- WeChat WXSS: `https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxss.html`21- uni-app CSS and units: `https://uniapp.dcloud.net.cn/tutorial/syntax-css.html`22- Taro design and size units: `https://docs.taro.zone/docs/size`23- Taro compile config: `https://docs.taro.zone/docs/config`2425## Core Rule2627Treat Figma measurements as design-canvas pixels, not web CSS pixels. Always identify the target unit pipeline before writing dimensions.2829General formula:3031```text32scale = targetDesignWidth / figmaFrameWidth33targetValue = figmaPx * scale34```3536Common targets:3738- Native WeChat/Alipay/Douyin/QQ-style mini-program styles: usually `targetDesignWidth = 750`; verify the target platform's style language and then write `targetValue rpx` unless the platform or codebase uses another responsive unit.39- uni-app mini-program target: `targetDesignWidth = 750`, write `targetValue rpx` in page/component styles.40- Taro mini-program target with global `designWidth = 750`: choose one strategy per layout region. Either write final scaled `rpx`, or write project-design `px` that will be converted by `pxtransform`.41- Taro project whose `designWidth` equals the Figma frame width: stylesheet `px` may be 1:1, but still verify `pxtransform`, selector blacklists, and inline style behavior.4243Do not assume `figmaFrameWidth = 750`. Designers may use `375`, `390`, `393`, `402`, `414`, `430`, `750`, or another frame width inside the same product.4445## Inputs to Confirm4647Before editing, establish:4849- `framework`: native mini-program, uni-app, Taro, or another framework.50- `targetPlatform`: WeChat, Alipay, Douyin, QQ, Baidu, Kuaishou, DingTalk, Feishu, or mixed.51- `figmaFrameWidth`: read from Figma metadata/design context or the screenshot dimensions.52- `targetDesignWidth`: usually `750` for direct `rpx`; for Taro, read `designWidth`.53- `unitPipeline`: native stylesheet, uni-app style block, SCSS/Less, CSS modules, Tailwind/UnoCSS, inline style, or canvas/API pixel values.54- `runtimeChrome`: native/custom navigation, tab bar, capsule/menu button, status bar, safe area, popup, and fixed footer behavior.5556## Platform Review Rules5758Use this quick check before choosing a conversion pattern:5960| Branch | Good default | Main exception |61| --- | --- | --- |62| Native mini-program | Convert Figma px to final `rpx` with `750 / figmaFrameWidth`. | Confirm platform file extensions and style-unit support; keep true hairlines and API pixel values as `px` when required. |63| uni-app | In Vue page styles, convert Figma px to `rpx` with `750 / figmaFrameWidth`. | `nvue`/`uvue`, App `titleNView`, plus APIs, canvas, and native modules can require `px` or have special semantics. |64| Taro | Prefer the existing project convention: final `rpx` helper or `pxtransform` via `designWidth`. | Do not mix final `rpx` and transformable `px` for the same Figma values in one layout region. Inline styles need runtime conversion. |6566## First-Pass Investigation6768Run targeted searches before editing:6970```bash71rg -n "designWidth|deviceRatio|pxtransform|selectorBlackList|postcss-pxtransform" . --glob '!**/node_modules/**'72rg -n "toRpx|upx2px|pxTransform|px\\(|rpx\\(|750 /|designWidth" . --glob '!**/node_modules/**'73rg -n "navigationStyle|navigationBar|usingComponents|tabBar|pages.json|manifest.json|app.json" . --glob '!**/node_modules/**'74rg --files . --glob '*.wxml' --glob '*.wxss' --glob '*.axml' --glob '*.acss' --glob '*.ttml' --glob '*.ttss' --glob '*.qml' --glob '*.qss' --glob '*.vue' --glob '*.tsx' --glob '*.scss' --glob '*.less' --glob '!**/node_modules/**'75```7677Then inspect:7879- The exact page/component files and nearby sibling pages.80- The exact Figma node width, screenshot width, and intended phone model if given.81- Existing unit helpers, global SCSS variables, and project conventions.82- Whether static layout is in stylesheets and dynamic values are in inline style objects.83- The app/page navigation configuration and real mini-program chrome.8485## Framework Detection8687Use file/config shape to choose the branch:8889- **Native WeChat**: `app.json`, `project.config.json`, `.wxml`, `.wxss`, `.js`, `.ts`.90- **Native Alipay**: `app.json`, `.axml`, `.acss`, `mini.project.json`.91- **Native Douyin/ByteDance**: `.ttml`, `.ttss`, platform project config.92- **Native QQ/Baidu/Kuaishou/DingTalk/Feishu**: platform templates plus style files similar to WXSS/CSS.93- **uni-app**: `pages.json`, `manifest.json`, `.vue` pages, `uni.scss`, `uni_modules`.94- **Taro**: `config/index.*`, `src/app.config.*`, `@tarojs/*`, `.tsx`/`.jsx` pages.95- **Other cross-frameworks**: identify their unit transform plugin and generated mini-program output before changing dimensions.9697If the framework is ambiguous, inspect `package.json`, app config, and page extensions before assuming Taro.9899## Workflow1001011. Inspect the Figma node or screenshot before editing.102 - Use Figma design context for layout, text, colors, assets, and frame width.103 - If using image-to-ui output, load `image-to-ui-skill` first and separate code-rendered UI from bitmap assets.1041052. Identify implementation context.106 - Confirm framework, target platform, and page route.107 - Read app/page config for navigation, tab bar, component registration, and safe-area behavior.108 - Check nearby pages for the established unit convention.1091103. Choose the scaling strategy.111 - Direct `rpx` projects: write scaled `rpx` from the real Figma frame width.112 - Existing Taro project: do not change global `designWidth` for one page; use a local helper unless the whole project is moving to a new design system.113 - New Taro project: align `designWidth` and `deviceRatio` to the design draft if that is the product-wide standard.114 - Mixed design widths: keep path/package-specific helpers; only use Taro `designWidth(input)` when the project intentionally supports that pattern.115 - API/canvas/native pixels: convert `rpx` to device pixels with the platform/framework helper at runtime.1161174. Compute scale from actual values.118 - Native/uni-app target: `scale = 750 / figmaFrameWidth`.119 - Taro target: `scale = taroDesignWidth / figmaFrameWidth` when converting to project design units, or `750 / figmaFrameWidth` when writing final `rpx` directly.120 - Keep the helper near the page styles or reuse an existing shared helper.1211225. Convert dimensions consistently.123 - Convert width, height, padding, margin, gap, top, left, right, border-radius, font-size, line-height, and border widths.124 - Prefer flex, percentage, or `calc()` only where the design is genuinely responsive.125 - For safe-area spacing, combine scaled spacing with `env(safe-area-inset-bottom)` using the project's style syntax.126 - Avoid `vw` for fixed mobile Figma matching unless the existing codebase deliberately uses it.1271286. Respect mini-program chrome and platform behavior.129 - Do not redraw battery, signal, status bar, or the platform capsule/menu button in a real mini-program page.130 - For custom navigation, use the project's navigation component or platform menu-button metrics.131 - For tab pages, do not add a back button unless the product flow requires one.132 - Verify fixed bottom buttons do not cover scroll content or safe-area padding.1331347. Use real assets and configuration.135 - Prefer Figma-exported assets, configured remote assets, or backend/OSS content over CSS approximations.136 - Do not hard-code configurable examples, icons, prompts, limits, copy, or button text if the backend already owns them.137 - Keep route params, event channels, and page callbacks compatible with callers.138139## Native Mini-Program Pattern140141Use direct scaled `rpx` for Figma-derived layout:142143```scss144/* frame width 390, target screen 750rpx */145$scale: 1.9231rpx; // 750 / 390146147@function fp($value) {148 @return $value * $scale;149}150151.card {152 width: fp(338);153 height: fp(296);154 padding: fp(16) fp(24);155 border-radius: fp(12);156 font-size: fp(14);157}158```159160For plain `.wxss` or platform styles without Sass, either write computed `rpx` values or add a project-approved preprocessor. Avoid raw Figma `px` for layout.161162```css163.card {164 width: 650rpx; /* 338 * 750 / 390 */165 border-radius: 23rpx;166}167```168169For dynamic inline style:170171```ts172const FIGMA_WIDTH = 390;173const toRpx = (value: number) => `${(value * 750 / FIGMA_WIDTH).toFixed(2)}rpx`;174```175176Keep platform-required fixed pixels as `px`, especially 1px hairlines, canvas dimensions, and values passed to native APIs that explicitly require physical or logical pixels.177178## uni-app Pattern179180In `.vue` pages/components, prefer the existing `rpx` style convention:181182```scss183$figma-width: 390;184$scale: 750rpx / $figma-width;185186@function fp($value) {187 @return $value * $scale;188}189190.action-panel {191 width: fp(338);192 padding: fp(20);193 border-radius: fp(12);194}195```196197For runtime device pixels, convert responsive units through uni-app APIs/helpers only when a native API, canvas, or measurement call requires physical pixels. Do not replace stylesheet `rpx` with JS-calculated pixels for normal layout.198199For `nvue`/`uvue`, App `titleNView`, plus APIs, or modules that are not regular Vue page CSS, read the local docs/config and nearby code first. In those contexts, `px` may be fixed, dynamic, or required depending on renderer and target platform.200201## Taro Pattern202203Read `designWidth`, `deviceRatio`, and `pxtransform` before editing. If the project uses `designWidth: 750` and Figma width is `402`, write scaled final `rpx`:204205```scss206$scale: 1.8657rpx; // 750 / 402207208@function fp($value) {209 @return $value * $scale;210}211212.example-card {213 width: fp(338);214 height: fp(296);215 padding: fp(16) fp(32) fp(32);216 border-radius: fp(12);217 font-size: fp(14);218}219```220221For TSX inline style objects:222223```ts224const FIGMA_WIDTH = 402;225const toRpx = (value: number) => `${(value * 750 / FIGMA_WIDTH).toFixed(2)}rpx`;226```227228If the codebase standardizes on `Taro.pxTransform`, pass values after converting Figma pixels to the project's design unit:229230```ts231const figmaToProjectPx = (value: number) => value * (taroDesignWidth / figmaFrameWidth);232const width = Taro.pxTransform(figmaToProjectPx(338));233```234235Do not call `Taro.pxTransform(338)` directly unless `figmaFrameWidth === taroDesignWidth`.236237Two Taro strategies are valid; pick one and keep it consistent:238239- **Final rpx strategy:** compute `figmaPx * 750 / figmaFrameWidth` and write `rpx` strings. This bypasses `pxtransform` for those values and works well for Figma-matched mini-program-only screens.240- **pxtransform strategy:** compute `figmaPx * taroDesignWidth / figmaFrameWidth`, write that as lowercase `px` in stylesheets or pass it to `Taro.pxTransform` at runtime. This keeps Taro's multi-end conversion behavior.241242Do not write raw Figma `px` in Taro styles when `figmaFrameWidth !== taroDesignWidth`, and do not multiply a value into final `rpx` and then pass it through `Taro.pxTransform`.243244## Scale Quick Reference245246For `750rpx` target:247248- Figma `375`: `2rpx`249- Figma `390`: `1.9231rpx`250- Figma `393`: `1.9084rpx`251- Figma `402`: `1.8657rpx`252- Figma `414`: `1.8116rpx`253- Figma `430`: `1.7442rpx`254- Figma `750`: `1rpx`255256For other targets, recompute `targetDesignWidth / figmaFrameWidth`.257258## Utility Class and Inline Style Notes259260- Verify whether Tailwind/UnoCSS/arbitrary values are transformed before using arbitrary `px` classes.261- For Figma-matched screens, prefer a small SCSS/helper function over long arbitrary utility values.262- Search changed files for raw Figma numbers in inline styles and convert them through `toRpx`, `fp`, final `rpx` strings, or the local equivalent as appropriate.263- Keep 1px hairlines intentional; do not scale them blindly if the platform/component expects a physical border.264- Do not use `uni.upx2px`, `Taro.pxTransform`, or platform pixel APIs for normal stylesheet layout unless the codebase already uses that runtime path.265266## Visual QA Checklist267268Before reporting completion:269270- State framework, target platform, Figma frame width, target design width, and scale/helper used.271- Run `rg -n "[0-9]+px" <changed-style-files>` and justify remaining CSS `px`.272- Search inline styles in changed TS/JS/Vue/TSX files for raw design numbers.273- Run the project’s scoped type check or build command for the changed mini-program app.274- Compare the page against the Figma screenshot at the same phone width.275- Check width, top spacing, tab underline, primary button size, card width, image aspect ratio, and fixed bottom placement.276- Check custom navigation, capsule/menu-button clearance, tab bar, and safe-area spacing on real target platform assumptions.277- Check text overflow with real configured/backend copy.278279## Common Failure Modes280281- **Everything is half-size:** Figma `px` was written directly into a `750rpx` mini-program layout. Convert with `750 / figmaFrameWidth`.282- **Everything is too large:** the Figma frame was already `750` wide, but values were multiplied again.283- **Only one design matches:** the scale was hard-coded for one frame width. Re-read the actual Figma node each time.284- **Inline styles ignore compile transforms:** JS/Vue style objects need explicit `rpx` strings or runtime helpers.285- **Native page shows duplicated chrome:** system status/capsule UI was drawn manually. Use platform navigation metrics instead.286- **Looks correct in H5 but wrong in WeChat/Alipay/Douyin:** verify in mini-program units and target runtime, not only browser CSS.287- **Assets differ from Figma/app config:** use exported or configured assets instead of approximations.288289## Completion Report Template290291When finishing a mini-program/Figma alignment task, report:292293- Framework/platform:294- Figma node/frame width:295- Target design width:296- Scale/helper used:297- Files changed:298- Remaining raw `px` and why:299- Verification command:300- Known visual risks: