| 723 | const customProperties = new Map<string, string>(); |
| 724 | |
| 725 | const collectRuleCustomProperties = (rule: csstree.Rule) => { |
| 726 | customProperties.clear(); |
| 727 | csstree.walk(rule, { |
| 728 | visit: "Declaration", |
| 729 | enter(node) { |
| 730 | const decl = node as csstree.Declaration; |
| 731 | const prop = normalizeProperty(decl.property); |
| 732 | if (prop.startsWith("--")) { |
| 733 | const value = getRawDeclarationValue(css, decl); |
| 734 | if (value !== undefined && isValidCustomPropertyValue(value)) { |
| 735 | customProperties.set(prop, normalizeCustomPropertyValue(value)); |
| 736 | } |
| 737 | } |
| 738 | }, |
| 739 | }); |
| 740 | }; |
| 741 | |
| 742 | csstree.walk(ast, { |
| 743 | enter(node) { |