Skip to content

Commit 7b0465b

Browse files
committed
do not rely on regex
This test will verify that the usage of `segment` is correct. Before we were relying on a regex and check for `(=.*)` which would also match _inside_ of the quoted value.
1 parent e8b288f commit 7b0465b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/tailwindcss/src/variants.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,6 +2076,7 @@ test('data', async () => {
20762076
'data-[potato=salad]:flex',
20772077
'data-[potato_=_"salad"]:flex',
20782078
'data-[potato_^=_"salad"]:flex',
2079+
'data-[potato="^_="]:flex',
20792080
'data-[foo=1]:flex',
20802081
'data-[foo=bar_baz]:flex',
20812082
"data-[foo$='bar'_i]:flex",
@@ -2170,6 +2171,10 @@ test('data', async () => {
21702171
display: flex;
21712172
}
21722173
2174+
.data-\\[potato\\=\\"\\^_\\=\\"\\]\\:flex[data-potato="^ ="] {
2175+
display: flex;
2176+
}
2177+
21732178
.data-\\[foo\\=1\\]\\:flex[data-foo="1"] {
21742179
display: flex;
21752180
}

0 commit comments

Comments
 (0)