Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

WEB_PACKAGE

const WEB_PACKAGE: IEnginePackage;

Defined in: packages/engine/src/packages/web/WebPackage.ts:126

Web: the sums a front-end or an image needs, beside the ones the units already do.

px in rem is an ordinary unit conversion and already ships, treating one rem as the CSS default of 16px. What was missing is everything that default cannot answer: a page whose root font size is not 16px, the shape of a screen or an image, the other side of a resize, and the print size of an image at a stated density (4000px at 300 dpi), the one bridge between pixels and physical length.

The boundary: the two dimension forms are whole pixels in and whole pixels out, because a screen and an image file are counted that way, and a resize rounds rather than answering with a fraction of a pixel. em, which is measured against an element’s own font size rather than the root, is still deliberately not converted: what an em is worth depends on where it sits.