Skip to content

Commit a71e8b7

Browse files
committed
fix ##11 tailwindcss data attributes: PR12
1 parent 46f18e7 commit a71e8b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function getClassNames(selectorStr) {
194194
.replace(/\.(?=[0-9-])/g, escpdSlctrPlchldr) // Match escaped dot
195195
.replace("::", " ")
196196
.replace(/\([^\)]*\)/g, "") // Remove string between starts with ( end with )
197-
.replace(/(?<!-)\\\[[^\\\]]*\\\]/g, "") // remove string starts with [ no(-[ "fix tailwindcss arbitrary values") end with ] as css [attribute*=value] Selector
197+
.replace(/(?<!-\\)\[[^\]]*=[^\]]*]/g, "") // Only removes CSS [attribute*=value] selectors when the `[` is not preceded by `-\`. thus it avoids tailwind`s arbitrary values, & data attributes
198198
.split(".")
199199
.slice(1);
200200

0 commit comments

Comments
 (0)