Skip to content

Commit b620a19

Browse files
committed
Don’t break sibling-*() functions when used inside calc(…)
1 parent 7e2dd53 commit b620a19

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/util/dataTypes.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ function normalizeMathOperatorSpacing(value) {
149149
'repeating-conic-gradient',
150150

151151
'anchor-size',
152+
153+
'sibling-index',
154+
'sibling-count',
152155
]
153156

154157
return value.replace(/(calc|min|max|clamp)\(.+\)/g, (match) => {

tests/normalize-data-types.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ let table = [
9898

9999
// Prevent formatting functions that are not math functions
100100
['w-[calc(anchor-size(width)+8px)]', 'w-[calc(anchor-size(width) + 8px)]'],
101+
['w-[calc(sibling-index()*1%)]', 'w-[calc(sibling-index() * 1%)]'],
102+
['w-[calc(sibling-count()*1%)]', 'w-[calc(sibling-count() * 1%)]'],
101103

102104
// Misc
103105
['color(0_0_0/1.0)', 'color(0 0 0/1.0)'],

0 commit comments

Comments
 (0)