From 1d505e9c8c256f4d35ea416d8b3294774671c74f Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Thu, 23 Mar 2023 15:18:49 -0400 Subject: [PATCH] Revert "Remove blocklisted classes from autocomplete (#10844)" This reverts commit f1473f53bb9e90b02f319cb1c88093406f10c990. --- CHANGELOG.md | 1 - src/lib/setupContextUtils.js | 5 ----- tests/getClassList.test.js | 12 ------------ 3 files changed, 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b06102bc1..13c37104d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disallow multiple selectors in arbitrary variants ([#10655](https://github.com/tailwindlabs/tailwindcss/pull/10655)) - Sort class lists deterministically for Prettier plugin ([#10672](https://github.com/tailwindlabs/tailwindcss/pull/10672)) - Ensure CLI builds have a non-zero exit code on failure ([#10703](https://github.com/tailwindlabs/tailwindcss/pull/10703)) -- Remove blocklisted classes from autocomplete ([#10844](https://github.com/tailwindlabs/tailwindcss/pull/10844)) ### Changed diff --git a/src/lib/setupContextUtils.js b/src/lib/setupContextUtils.js index e17ba43c1..0749da68d 100644 --- a/src/lib/setupContextUtils.js +++ b/src/lib/setupContextUtils.js @@ -1007,11 +1007,6 @@ function registerPlugins(plugins, context) { } } - // Exclude utilities that are known non-classes (e.g. from the blocklist) - if (context.notClassCache.size > 0) { - output = output.filter((cls) => !context.notClassCache.has(cls)) - } - return output } diff --git a/tests/getClassList.test.js b/tests/getClassList.test.js index 06e8dd345..671a767ec 100644 --- a/tests/getClassList.test.js +++ b/tests/getClassList.test.js @@ -191,18 +191,6 @@ crosscheck(() => { expect(classes).not.toContain('bg-red-500/50') }) - it('should not generate utilities that are present in the blocklist', () => { - let config = { - blocklist: ['font-bold'], - } - - let context = createContext(resolveConfig(config)) - let classes = context.getClassList() - - expect(classes).toContain('font-normal') - expect(classes).not.toContain('font-bold') - }) - it('should not generate utilities that are set to undefined or null to so that they are removed', () => { let config = { theme: {