@tokens-studio/sd-transforms
Version:
Custom transforms for Style-Dictionary, to work with Design Tokens that are exported from Tokens Studio
16 lines (15 loc) • 424 B
JavaScript
export function transformShadow(value) {
const alignShadowType = (val) => {
return val === 'innerShadow' || val === 'inset' ? 'inset' : undefined;
};
if (Array.isArray(value)) {
return value.map(v => ({
...v,
type: alignShadowType(v.type),
}));
}
if (typeof value === 'object') {
value.type = alignShadowType(value.type);
}
return value;
}