(value: string, config: CodegenConfig, prop?: string)
| 314 | } |
| 315 | |
| 316 | export function normalizeCssValue(value: string, config: CodegenConfig, prop?: string): string { |
| 317 | if (!value) return value |
| 318 | |
| 319 | let current = value.trim() |
| 320 | |
| 321 | if (prop && KEEP_PX_PROPS.has(prop)) { |
| 322 | return current |
| 323 | } |
| 324 | |
| 325 | if (typeof config.scale === 'number' && config.scale !== 1) { |
| 326 | current = scalePxValue(current, config.scale) |
| 327 | } |
| 328 | |
| 329 | if (config.cssUnit === 'rem') { |
| 330 | const root = config.rootFontSize || 16 |
| 331 | current = pxToRem(current, root) |
| 332 | } |
| 333 | |
| 334 | return current |
| 335 | } |
| 336 | |
| 337 | export function normalizeStyleValues( |
| 338 | style: Record<string, string>, |
no test coverage detected