From 9fdc391d4ff93e7e350f5ce439060176b1f0162f Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 5 Jan 2022 08:36:30 -0500 Subject: [PATCH] Revert apply defaults in isolation --- src/lib/expandTailwindAtRules.js | 10 +++++----- tests/apply.test.js | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/lib/expandTailwindAtRules.js b/src/lib/expandTailwindAtRules.js index 9aa91f0e94fb..21bef516d704 100644 --- a/src/lib/expandTailwindAtRules.js +++ b/src/lib/expandTailwindAtRules.js @@ -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 } diff --git a/tests/apply.test.js b/tests/apply.test.js index f53d2a41185d..ebba23526352 100644 --- a/tests/apply.test.js +++ b/tests/apply.test.js @@ -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 `) }) }) +*/