| 331 | } |
| 332 | |
| 333 | function applyImportant(ast: AstNode[]): void { |
| 334 | for (let node of ast) { |
| 335 | // Skip any `AtRoot` nodes — we don't want to make the contents of things |
| 336 | // like `@keyframes` or `@property` important. |
| 337 | if (node.kind === 'at-root') { |
| 338 | continue |
| 339 | } |
| 340 | |
| 341 | if (node.kind === 'declaration') { |
| 342 | node.important = true |
| 343 | } else if (node.kind === 'rule' || node.kind === 'at-rule') { |
| 344 | applyImportant(node.nodes) |
| 345 | } |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | function getPropertySort(nodes: AstNode[]) { |
| 350 | // Determine sort order based on properties used |