Skip to content

Documentation

English · 简体中文

Pick the page that matches what you are doing right now:

What you wantRead this
Install it and get a first page workingGetting started
Try a configuration without installing anythingPlayground
Wire it into Vite / Nuxt / Webpack / TaroBuild tool integration
Check the output after changing configurationCLI preview
The project uses Vant / Element Plus / antd…Component libraries
Look up an option name or its defaultConfiguration reference
Understand where the numbers come fromArchitecture and formulas
Keyboards / address bars / WebViews break the layoutOptional runtime
Support an old Safari or WebViewBrowser support and degradation
Move over from an existing px conversion setupMigration guide
Releases, artifacts, Node versionsRelease and compatibility
Point a coding agent at this projectDocumentation for agents

Specification and examples:

  • Conformance suite — a language-agnostic behavioural definition, pure data, usable as an acceptance suite by an implementation in any language
  • Runnable example — a complete app 375 + desktop 1440 project

The core model

The multi-canvas model

This project solves exactly one problem: a px cannot be converted until you know which design file it was drawn on.

Your pages, a mobile component library and a desktop component library come from three different design files — and the third one may have no design file at all. Giving each file its own canvas (a profile), and converting every px against the width of the canvas it belongs to, is the only approach that does not force a choice between "the page scales but the components stay put" and "the components get stretched against the wrong ratio".

Canvas membership is decided by three channels: class-name prefix, custom-property prefix, and file path. The channels for the built-in component libraries are already written, which is why the default configuration is already correct.

Released under the MIT License.