UNPKG

react-breakpoints

Version:

A library that allows you to mount/unmount components depending on the viewport size. Welcome to the next level of responsive React applications.

10 lines (9 loc) 254 B
export function stripUnit(value) { var unitlessValue = parseFloat(value); if (isNaN(unitlessValue)) return value; return unitlessValue; } export function em(pxValue) { var unitlessValue = stripUnit(pxValue); return unitlessValue / 16 + "em"; }