2.11.0
Carbon.Number.pxToRem(value, fallback)
Convert a pixel value to rem
value
(numeric | string, required) The value to convertedfallback
(numeric | string, optional) Fallback value ifvalue
isfalse
ornull
Examples:
Expression | Result |
---|---|
Carbon.Number.pxToRem('') |
0 |
Carbon.Number.pxToRem('8px') |
0.5rem |
Carbon.Number.pxToRem(16) |
1rem |
Carbon.Number.pxToRem(0) |
0 |
Carbon.Number.pxToRem(false, 32) |
2rem |
Carbon.Number.pxToRem(null, '16px') |
2rem |
Returns a string with the converted value
Full Changelog: 2.10.0...2.11.0