Skip to content

Commit 546cff8

Browse files
authored
Allow quotes in arbitrary value blocks (tailwindlabs#4625)
1 parent cb2598c commit 546cff8

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/jit/lib/expandTailwindAtRules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import cloneNodes from '../../util/cloneNodes'
66
let env = sharedState.env
77
let contentMatchCache = sharedState.contentMatchCache
88

9-
const BROAD_MATCH_GLOBAL_REGEXP = /[^<>"'`\s]*[^<>"'`\s:]/g
9+
const BROAD_MATCH_GLOBAL_REGEXP = /([^<>"'`\s]*\[[^<>\s]+\])|([^<>"'`\s]*[^<>"'`\s:])/g
1010
const INNER_MATCH_GLOBAL_REGEXP = /[^<>"'`\s.(){}[\]#=%]*[^<>"'`\s.(){}[\]#=%:]/g
1111

1212
const builtInExtractors = {

tests/jit/arbitrary-values.test.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@
391391
.duration-\[var\(--app-duration\)\] {
392392
transition-duration: var(--app-duration);
393393
}
394+
.content-\[\'hello\'\] {
395+
content: 'hello';
396+
}
394397
.content-\[attr\(content-before\)\] {
395398
content: attr(content-before);
396399
}

tests/jit/arbitrary-values.test.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
<div class="ring-offset-[19rem]"></div>
112112
<div class="ring-opacity-[var(--ring-opacity)]"></div>
113113
<div class="delay-[var(--delay)]"></div>
114+
<div class="content-['hello']"></div>
114115
<div class="content-[attr(content-before)]"></div>
115116
</body>
116117
</html>

0 commit comments

Comments
 (0)