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

Function compareBreakpointVariants

packages/tailwindcss/src/variants.ts:968–982  ·  view source on GitHub ↗
(
      a: Variant,
      z: Variant,
      direction: 'asc' | 'desc',
      lookup: { get(v: Variant): string | null },
    )

Source from the content-addressed store, hash-verified

966 // responsive variants (`sm`, `md`, ...), `min-*`, `max-*` and container
967 // queries (`@`).
968 function compareBreakpointVariants(
969 a: Variant,
970 z: Variant,
971 direction: 'asc' | 'desc',
972 lookup: { get(v: Variant): string | null },
973 ) {
974 if (a === z) return 0
975 let aValue = lookup.get(a)
976 if (aValue === null) return direction === 'asc' ? -1 : 1
977
978 let zValue = lookup.get(z)
979 if (zValue === null) return direction === 'asc' ? 1 : -1
980
981 return compareBreakpoints(aValue, zValue, direction)
982 }
983
984 // Breakpoints
985 {

Callers 1

createVariantsFunction · 0.85

Calls 2

compareBreakpointsFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected