Skip to content

Commit

Permalink
Revert apply defaults in isolation
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrypticace committed Jan 5, 2022
1 parent 5f49e53 commit 9fdc391
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/lib/expandTailwindAtRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand Down
6 changes: 4 additions & 2 deletions tests/apply.test.js
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -847,3 +848,4 @@ fit('apply can emit defaults in isolated environments without @tailwind directiv
`)
})
})
*/

0 comments on commit 9fdc391

Please sign in to comment.