Revert apply defaults in isolation

This commit is contained in:
Jordan Pittman 2022-01-05 08:36:30 -05:00
parent 5f49e53aba
commit 9fdc391d4f
2 changed files with 9 additions and 7 deletions

View File

@ -140,7 +140,7 @@ export default function expandTailwindAtRules(context) {
variants: null,
}
let hasApply = false
// let hasApply = false
root.walkAtRules((rule) => {
// Make sure this file contains Tailwind directives. If not, we can save
@ -156,12 +156,12 @@ export default function expandTailwindAtRules(context) {
// We also want to check for @apply because the user can
// apply classes in an isolated environment like CSS
// modules and we still need to inject defaults
if (rule.name === 'apply') {
hasApply = true
}
// if (rule.name === 'apply') {
// hasApply = true
// }
})
if (Object.values(layerNodes).every((n) => n === null) && !hasApply) {
if (Object.values(layerNodes).every((n) => n === null)) {
return root
}

View File

@ -1,6 +1,6 @@
import fs from 'fs'
import path from 'path'
import { DEFAULTS_LAYER } from '../src/lib/expandTailwindAtRules.js'
// import { DEFAULTS_LAYER } from '../src/lib/expandTailwindAtRules.js'
import { run, html, css } from './util/run'
@ -812,7 +812,8 @@ it('should be possible to apply user css without tailwind directives', () => {
})
})
fit('apply can emit defaults in isolated environments without @tailwind directives', () => {
/*
it('apply can emit defaults in isolated environments without @tailwind directives', () => {
let config = {
[DEFAULTS_LAYER]: true,
experimental: { optimizeUniversalDefaults: true },
@ -847,3 +848,4 @@ fit('apply can emit defaults in isolated environments without @tailwind directiv
`)
})
})
*/