Coerces a value to a CSS pixel value.
(value: any)
| 546 | |
| 547 | /** Coerces a value to a CSS pixel value. */ |
| 548 | function coerceCssPixelValue(value: any): string { |
| 549 | if (value == null) { |
| 550 | return ''; |
| 551 | } |
| 552 | |
| 553 | return cssUnitsPattern.test(value) ? value : `${value}px`; |
| 554 | } |