Skip to content

Commit a9c7e52

Browse files
Fix extraction of multi-word utilities with arbitrary values and quotes (#8604)
* Fix extraction of multi-word utilityies with arbitrary values and quotes * Update changelog * Fix changelog entry This wasn’t in 3.1.2 oops
1 parent ad98a61 commit a9c7e52

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Diff for: CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
- Nothing yet!
10+
- Fix extraction of multi-word utilities with arbitrary values and quotes ([#8604](https://github.com/tailwindlabs/tailwindcss/pull/8604))
11+
- Fix casing of import of `corePluginList` type definition ([#8587](https://github.com/tailwindlabs/tailwindcss/pull/8587))
1112

1213
## [3.1.2] - 2022-06-10
1314

1415
### Fixed
1516

1617
- Ensure `\` is a valid arbitrary variant token ([#8576](https://github.com/tailwindlabs/tailwindcss/pull/8576))
1718
- 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))
18-
- Fix casing of import of `corePluginList` type definition ([#8587](https://github.com/tailwindlabs/tailwindcss/pull/8587))
1919

2020
## [3.1.1] - 2022-06-09
2121

Diff for: src/lib/defaultExtractor.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function* buildRegExps(context) {
3737
regex.any([
3838
regex.pattern([
3939
// Arbitrary values
40-
/-\[[^\s:]+\]/,
40+
/-(?:\w+-)*\[[^\s:]+\]/,
4141

4242
// Not immediately followed by an `{[(`
4343
/(?![{([]])/,
@@ -48,7 +48,7 @@ function* buildRegExps(context) {
4848

4949
regex.pattern([
5050
// Arbitrary values
51-
/-\[[^\s]+\]/,
51+
/-(?:\w+-)*\[[^\s]+\]/,
5252

5353
// Not immediately followed by an `{[(`
5454
/(?![{([]])/,

Diff for: tests/default-extractor.test.js

+8
Original file line numberDiff line numberDiff line change
@@ -468,3 +468,11 @@ test('classes in slim templates', async () => {
468468
expect(extractions).toContain('italic')
469469
expect(extractions).toContain('text-gray-500')
470470
})
471+
472+
test('multi-word + arbitrary values + quotes', async () => {
473+
const extractions = defaultExtractor(`
474+
grid-cols-['repeat(2)']
475+
`)
476+
477+
expect(extractions).toContain(`grid-cols-['repeat(2)']`)
478+
})

0 commit comments

Comments
 (0)