Skip to main content
Version: v2

px

Start from API_LEVEL 2.0 . Please refer to API_LEVEL.

Pixel scaling calculation. The designWidth of each model in the targets object in the app.json is used as the base..

Type​

function px(value: PxValue): Result

Parameters​

PxValue​

TypeDescription
numberPixel values based on designWidth

Result​

TypeDescription
stringPixel values after scaling calculation

Example​

import { px } from '@zos/utils'

px(480)