From 84a2a16967da64bae9f56354d23d8d103a4c0bd6 Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Tue, 17 Sep 2024 11:48:29 +0200 Subject: [PATCH] Revert debugging code --- .../tailwindcss/src/compat/screens-config.ts | 1 - packages/tailwindcss/src/compile.ts | 22 ------------------- packages/tailwindcss/src/index.test.ts | 2 +- packages/tailwindcss/src/variants.ts | 7 ------ 4 files changed, 1 insertion(+), 31 deletions(-) diff --git a/packages/tailwindcss/src/compat/screens-config.ts b/packages/tailwindcss/src/compat/screens-config.ts index ca549fe384a9..b4b0cd4a2a91 100644 --- a/packages/tailwindcss/src/compat/screens-config.ts +++ b/packages/tailwindcss/src/compat/screens-config.ts @@ -4,7 +4,6 @@ import type { ResolvedConfig } from './config/types' import DefaultTheme from './default-theme' export function registerScreensConfig(config: ResolvedConfig, designSystem: DesignSystem) { - return let screens = config.theme.screens || {} // We want to insert the breakpoints in the right order as best we can. In the diff --git a/packages/tailwindcss/src/compile.ts b/packages/tailwindcss/src/compile.ts index 45976297392b..6450a288a073 100644 --- a/packages/tailwindcss/src/compile.ts +++ b/packages/tailwindcss/src/compile.ts @@ -32,27 +32,9 @@ export function compileCandidates( // Sort the variants let variants = designSystem.getUsedVariants().sort((a, z) => { - console.log(a, z, designSystem.variants.compare(a, z)) return designSystem.variants.compare(a, z) }) - // max-sm 0 => 1 - // min-sm 1 => 2 - // sm 2 => 4 - - // - // max-sm // [1] - // max-md // [1] - // - - // [ - // [max-sm, max-md], - // [[&:foo]], - // [[&:bar]], - // ] - - // To do this, variantOrder needs to be an array and the inner sorting needs to work - // Create the AST for (let [rawCandidate, candidates] of matches) { let found = false @@ -68,13 +50,9 @@ export function compileCandidates( // variant. This allows us to sort the rules based on the order of // variants used. let variantOrder = 0n - console.log(candidate.variants) - for (let variant of candidate.variants) { - console.log(designSystem.variants.getOrders(variant)) variantOrder |= 1n << BigInt(variants.indexOf(variant)) } - console.log({ variantOrder }) nodeSorting.set(node, { properties: propertySort, diff --git a/packages/tailwindcss/src/index.test.ts b/packages/tailwindcss/src/index.test.ts index 0da4758d8c10..fb226708e689 100644 --- a/packages/tailwindcss/src/index.test.ts +++ b/packages/tailwindcss/src/index.test.ts @@ -1416,7 +1416,7 @@ describe('Parsing themes values from CSS', () => { `) }) - test.only('`default` theme values can be overridden by plugin theme values', async () => { + test('`default` theme values can be overridden by plugin theme values', async () => { let { build } = await compile( css` @theme default { diff --git a/packages/tailwindcss/src/variants.ts b/packages/tailwindcss/src/variants.ts index 32ab92661d07..0ef2762634b9 100644 --- a/packages/tailwindcss/src/variants.ts +++ b/packages/tailwindcss/src/variants.ts @@ -130,13 +130,6 @@ export class Variants { return compareFn(a, z) || (a.root < z.root ? -1 : 1) } - getOrders(a: Variant): number[] { - if (a.kind === 'compound') { - return [this.variants.get(a.root)!.order, ...this.getOrders(a.variant)] - } - return [this.variants.get(a.root)!.order] - } - keys() { return this.variants.keys() }