Skip to content

Commit

Permalink
Revert debugging code
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-spiess committed Sep 17, 2024
1 parent 8345e05 commit affd493
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 33 deletions.
1 change: 0 additions & 1 deletion packages/tailwindcss/src/compat/screens-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 0 additions & 22 deletions packages/tailwindcss/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions packages/tailwindcss/src/variants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1356,13 +1356,13 @@ test('min, max and unprefixed breakpoints', async () => {
}
@media (width >= 1024px) {
.min-lg\\:flex {
.lg\\:flex {
display: flex;
}
}
@media (width >= 1024px) {
.lg\\:flex {
.min-lg\\:flex {
display: flex;
}
}"
Expand Down
7 changes: 0 additions & 7 deletions packages/tailwindcss/src/variants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit affd493

Please sign in to comment.