(value: string)
| 489 | // node.name = "border-\\[color\\:var\\(--border-color\\)\\]". |
| 490 | // We unescape it so class names match authored HTML class attributes. |
| 491 | const unescapeCssIdentifier = (value: string): string => |
| 492 | value.replace(/\\([0-9a-fA-F]{1,6}\s?|.)/g, (_match, escaped: string) => { |
| 493 | const hexMatch = escaped.match(/^([0-9a-fA-F]{1,6})\s?$/); |
| 494 | if (hexMatch) { |
| 495 | const codePoint = Number.parseInt(hexMatch[1], 16); |
| 496 | return String.fromCodePoint(codePoint); |
| 497 | } |
| 498 | return escaped; |
| 499 | }); |
| 500 | |
| 501 | /** |
| 502 | * Substitute var() references in a shorthand value then expand the result. |
no outgoing calls
no test coverage detected