Skip to content

Commit 42d27bc

Browse files
fix(tokens): NO-JIRA multi-layer box shadows processing (#1033)
1 parent c716285 commit 42d27bc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/dialtone-tokens/postcss/dialtone-tokens.cjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ function boxShadows (shadowDeclarations, Declaration) {
5252
.reduce((shadows, shadow) => {
5353
const [name, index] = shadow
5454
.split(shadowSegmentsRegex).slice(1, -1);
55-
// if not a number that means it's only a single shadow so set to 1.
56-
shadows[name] = Number.isNaN(Number.parseInt(index)) ? 1 : Number.parseInt(index);
55+
// Track the maximum layer index for multi-layer shadows
56+
const layerIndex = Number.isNaN(Number.parseInt(index)) ? 1 : Number.parseInt(index);
57+
shadows[name] = Math.max(shadows[name] || 0, layerIndex);
5758
return shadows;
5859
}, {});
5960

0 commit comments

Comments
 (0)