(px: string | number)
| 48 | } |
| 49 | |
| 50 | function pxToRem(px: string | number) { |
| 51 | if (typeof px === 'string') { |
| 52 | px = parseFloat(px); |
| 53 | } |
| 54 | |
| 55 | // In the docs, we need to be able to simulate font size adjustment. |
| 56 | if (process.env.DOCS_ENV) { |
| 57 | return `calc(${px / 16} * var(--rem, 1rem))`; |
| 58 | } |
| 59 | |
| 60 | return px / 16 + 'rem'; |
| 61 | } |
| 62 | |
| 63 | function hcmColor(color: string) { |
| 64 | // In the docs, HCM colors can be simulated. |
no outgoing calls
no test coverage detected