MCPcopy
hub / github.com/tailwindlabs/tailwindcss / negateAtRule

Function negateAtRule

packages/tailwindcss/src/variants.ts:461–477  ·  view source on GitHub ↗
(rule: AtRule)

Source from the content-addressed store, hash-verified

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

Callers 1

createVariantsFunction · 0.85

Calls 3

segmentFunction · 0.90
atRuleFunction · 0.90
negateConditionsFunction · 0.85

Tested by

no test coverage detected