Skip to content

Commit 9fdc391

Browse files
committed
Revert apply defaults in isolation
1 parent 5f49e53 commit 9fdc391

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/lib/expandTailwindAtRules.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default function expandTailwindAtRules(context) {
140140
variants: null,
141141
}
142142

143-
let hasApply = false
143+
// let hasApply = false
144144

145145
root.walkAtRules((rule) => {
146146
// Make sure this file contains Tailwind directives. If not, we can save
@@ -156,12 +156,12 @@ export default function expandTailwindAtRules(context) {
156156
// We also want to check for @apply because the user can
157157
// apply classes in an isolated environment like CSS
158158
// modules and we still need to inject defaults
159-
if (rule.name === 'apply') {
160-
hasApply = true
161-
}
159+
// if (rule.name === 'apply') {
160+
// hasApply = true
161+
// }
162162
})
163163

164-
if (Object.values(layerNodes).every((n) => n === null) && !hasApply) {
164+
if (Object.values(layerNodes).every((n) => n === null)) {
165165
return root
166166
}
167167

tests/apply.test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from 'fs'
22
import path from 'path'
3-
import { DEFAULTS_LAYER } from '../src/lib/expandTailwindAtRules.js'
3+
// import { DEFAULTS_LAYER } from '../src/lib/expandTailwindAtRules.js'
44

55
import { run, html, css } from './util/run'
66

@@ -812,7 +812,8 @@ it('should be possible to apply user css without tailwind directives', () => {
812812
})
813813
})
814814

815-
fit('apply can emit defaults in isolated environments without @tailwind directives', () => {
815+
/*
816+
it('apply can emit defaults in isolated environments without @tailwind directives', () => {
816817
let config = {
817818
[DEFAULTS_LAYER]: true,
818819
experimental: { optimizeUniversalDefaults: true },
@@ -847,3 +848,4 @@ fit('apply can emit defaults in isolated environments without @tailwind directiv
847848
`)
848849
})
849850
})
851+
*/

0 commit comments

Comments
 (0)