From 6e9411c1033c4b8c3c57b6d4a8d1b37a961359b9 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Sun, 12 Jun 2022 10:03:04 -0400 Subject: [PATCH 1/3] Fix extraction of multi-word utilityies with arbitrary values and quotes --- src/lib/defaultExtractor.js | 4 ++-- tests/default-extractor.test.js | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/defaultExtractor.js b/src/lib/defaultExtractor.js index fa2cc92b8f17..9106bd59371a 100644 --- a/src/lib/defaultExtractor.js +++ b/src/lib/defaultExtractor.js @@ -37,7 +37,7 @@ function* buildRegExps(context) { regex.any([ regex.pattern([ // Arbitrary values - /-\[[^\s:]+\]/, + /-(?:\w+-)*\[[^\s:]+\]/, // Not immediately followed by an `{[(` /(?![{([]])/, @@ -48,7 +48,7 @@ function* buildRegExps(context) { regex.pattern([ // Arbitrary values - /-\[[^\s]+\]/, + /-(?:\w+-)*\[[^\s]+\]/, // Not immediately followed by an `{[(` /(?![{([]])/, diff --git a/tests/default-extractor.test.js b/tests/default-extractor.test.js index 75abf4caebfd..d23dfd9cc3ad 100644 --- a/tests/default-extractor.test.js +++ b/tests/default-extractor.test.js @@ -468,3 +468,11 @@ test('classes in slim templates', async () => { expect(extractions).toContain('italic') expect(extractions).toContain('text-gray-500') }) + +test('multi-word + arbitrary values + quotes', async () => { + const extractions = defaultExtractor(` + grid-cols-['repeat(2)'] + `) + + expect(extractions).toContain(`grid-cols-['repeat(2)']`) +}) From 71b6c8d18454ab3378a2d3cf10f01322abf6a1ac Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Sun, 12 Jun 2022 10:05:38 -0400 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 136efcafce5c..a4b5777c66d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing yet! +- Fix extraction of multi-word utilities with arbitrary values and quotes ([#8604](https://github.com/tailwindlabs/tailwindcss/pull/8604)) ## [3.1.2] - 2022-06-10 From 89f0121021d0cbfb886bf094458e5aac1cc1b8ac Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Sun, 12 Jun 2022 10:05:46 -0400 Subject: [PATCH 3/3] Fix changelog entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This wasn’t in 3.1.2 oops --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4b5777c66d7..2c065711e6d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - Fix extraction of multi-word utilities with arbitrary values and quotes ([#8604](https://github.com/tailwindlabs/tailwindcss/pull/8604)) +- Fix casing of import of `corePluginList` type definition ([#8587](https://github.com/tailwindlabs/tailwindcss/pull/8587)) ## [3.1.2] - 2022-06-10 @@ -15,7 +16,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Ensure `\` is a valid arbitrary variant token ([#8576](https://github.com/tailwindlabs/tailwindcss/pull/8576)) - Enable `postcss-import` in the CLI by default in watch mode ([#8574](https://github.com/tailwindlabs/tailwindcss/pull/8574), [#8580](https://github.com/tailwindlabs/tailwindcss/pull/8580)) -- Fix casing of import of `corePluginList` type definition ([#8587](https://github.com/tailwindlabs/tailwindcss/pull/8587)) ## [3.1.1] - 2022-06-09