diff --git a/packages/tailwindcss-language-service/src/diagnostics/getRecommendedVariantOrderDiagnostics.ts b/packages/tailwindcss-language-service/src/diagnostics/getRecommendedVariantOrderDiagnostics.ts index 82385d9..72a71ef 100644 --- a/packages/tailwindcss-language-service/src/diagnostics/getRecommendedVariantOrderDiagnostics.ts +++ b/packages/tailwindcss-language-service/src/diagnostics/getRecommendedVariantOrderDiagnostics.ts @@ -30,10 +30,9 @@ export async function getRecommendedVariantOrderDiagnostics( return } + let order = state.jitContext.variantOrder ?? state.jitContext.offsets.variantOffsets let { variants, offset } = getVariantsFromClassName(state, className.className) - let sortedVariants = [...variants].sort((a, b) => - jit.bigSign(state.jitContext.variantOrder.get(b) - state.jitContext.variantOrder.get(a)) - ) + let sortedVariants = [...variants].sort((a, b) => jit.bigSign(order.get(b) - order.get(a))) if (!equalExact(variants, sortedVariants)) { diagnostics.push({