(rule: AtRule)
| 459 | let conditionalRules = ['@media', '@supports', '@container'] |
| 460 | |
| 461 | function negateAtRule(rule: AtRule) { |
| 462 | for (let ruleName of conditionalRules) { |
| 463 | if (ruleName !== rule.name) continue |
| 464 | |
| 465 | let conditions = segment(rule.params, ',') |
| 466 | |
| 467 | // We don't support things like `@media screen, print` because |
| 468 | // the negation would be `@media not screen and print` and we don't |
| 469 | // want to deal with that complexity. |
| 470 | if (conditions.length > 1) return null |
| 471 | |
| 472 | conditions = negateConditions(rule.name, conditions) |
| 473 | return atRule(rule.name, conditions.join(', ')) |
| 474 | } |
| 475 | |
| 476 | return null |
| 477 | } |
| 478 | |
| 479 | function negateSelector(selector: string) { |
| 480 | if (selector.includes('::')) return null |
no test coverage detected