Skip to content

Commit feea7f1

Browse files
committed
fix(tokens): handle multi-layer box shadows correctly in postcss plugin
1 parent 3d61d9b commit feea7f1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ function boxShadows (shadowDeclarations, Declaration, parentRule) {
7979
.reduce((shadows, shadow) => {
8080
const [name, index] = shadow
8181
.split(shadowSegmentsRegex).slice(1, -1);
82-
shadows[name] = Number.isNaN(Number.parseInt(index)) ? 1 : Number.parseInt(index);
82+
// Track the maximum layer index for multi-layer shadows
83+
const layerIndex = Number.isNaN(Number.parseInt(index)) ? 1 : Number.parseInt(index);
84+
shadows[name] = Math.max(shadows[name] || 0, layerIndex);
8385
return shadows;
8486
}, {});
8587

0 commit comments

Comments
 (0)