Skip to content

Adaptive MatrixOne design width per design file

A px cannot be converted until you know which design file it was drawn on. Give every design file its own canvas, and pages, mobile components and desktop components all scale correctly at the same time.

FROM DESIGN TO BROWSER

Move the viewport. Understand the numbers.

Start with 24px of spacing on a 375px canvas. Bounds are optional and the formula stays visible.

spacing.css375px → 375px
Design canvas24px
Spacing in the browser24px
padding: clamp(20.48px, 6.4vw, 38.4px);

This illustrates ordinary lengths. Compile complete CSS, typography and component libraries in the playground.

POSTCSS 8 · TYPESCRIPT · OPEN SOURCE

Start with one line of CSS.

See the output first. Choose your canvas and bounds when you need them.

npm i -D postcss-adaptive-matrix

English · 简体中文

Released under the MIT License.