diff --git a/libs/tokens/src/lib/transforms/shadow-shorthand.spec.ts b/libs/tokens/src/lib/transforms/shadow-shorthand.spec.ts index 2a608acbf1..9ddee2e041 100644 --- a/libs/tokens/src/lib/transforms/shadow-shorthand.spec.ts +++ b/libs/tokens/src/lib/transforms/shadow-shorthand.spec.ts @@ -61,6 +61,13 @@ describe('basic', () => { it('should match if category and type comply to a shadow type', () => { expect(matcher({ ...defaultToken, attributes: {} })).toEqual(false); + expect( + matcher({ + ...defaultToken, + type: 'boxShadow', + attributes: { category: 'something-with-shadow' }, + }) + ).toEqual(true); expect(matcher(token)).toEqual(true); }); }); diff --git a/libs/tokens/src/lib/transforms/shadow-shorthand.ts b/libs/tokens/src/lib/transforms/shadow-shorthand.ts index f9e6bf7ce2..c3b1a0728d 100644 --- a/libs/tokens/src/lib/transforms/shadow-shorthand.ts +++ b/libs/tokens/src/lib/transforms/shadow-shorthand.ts @@ -27,7 +27,7 @@ export default { name: 'shadow/shorthand', transitive: true, matcher: ({ type, attributes: { category } }) => - category?.includes('shadow') && type == 'boxShadow', + !!category?.includes('shadow') && type == 'boxShadow', transformer: ({ value }) => Array.isArray(value) ? parseShadowEffects(value) : value, } as Named;