({selectors, declarations}: ParsedStyleRule, indent: string)
| 25 | } |
| 26 | |
| 27 | function formatStyleRule({selectors, declarations}: ParsedStyleRule, indent: string) { |
| 28 | const lastSelectorIndex = selectors.length - 1; |
| 29 | selectors.forEach((selector, i) => { |
| 30 | lines.push(`${indent}${selector}${i < lastSelectorIndex ? ',' : ' {'}`); |
| 31 | }); |
| 32 | const sorted = sortDeclarations(declarations); |
| 33 | sorted.forEach(({property, value, important}) => { |
| 34 | lines.push(`${indent}${tab}${property}: ${value}${important ? ' !important' : ''};`); |
| 35 | }); |
| 36 | lines.push(`${indent}}`); |
| 37 | } |
| 38 | |
| 39 | clearEmptyRules(parsed); |
| 40 | parsed.forEach((rule) => formatRule(rule, '')); |
no test coverage detected