Pre-defined transform without matcher logic #1292
-
Apologies if I missed this in the docs, but is there an easy way to leverage a pre-defined transform without the built-in For reasons I'm not privy to, our team opted to use I know I could rework/reorganize some things, but I'm hoping to avoid reimplementing |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can kinda do it in v4: const colorHslBuiltin = StyleDictionary.hooks.transforms['color/hsl'];
StyleDictionary.registerTransform({
...colorHslBuiltin,
filter: (token) => token.type === 'colors',
name: 'colors/hsl', // if you don't override the name it will register on the original name and override the built-in one, which might be nice
}); |
Beta Was this translation helpful? Give feedback.
Hm no this is currently not possible, transforms aren't exposed publicly without the attached matcher/filter (called filter in v4).I'd be open to making the transforms themselves available without the filters though, feel free to raise an issue and I'll mark it as enhancementYou can kinda do it in v4: