You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been reading the Terazzo plugin API docs to figure out how to migrate some custom Cobalt plugins I made for our design system at work, Most of my plugins pre-process the design token data before it gets handed to a "normal" plugin to be output as CSS, JS, or whatever.
With Cobalt I used a hacky approach where you can pass one plugin into the config of my plugin. My plugin manipulates the parsed token data in some way and then runs the plugin specified in the config with that modfied token data. I suspect Cobalt's plugin API wasn't intended to be (ab)used in that way, but it worked :-)
I don't think Terrazo's new 2-step proces would let me do that. What I'm after isn't a transform() step to generate values to later be output. I want to modfiy the tokens data before it gets passed into transform().
Maybe there could be a preProcess() hook or something like that? It could take the same read-only tokens data and return a new tokens data that replaces it and is used later on.
Not quite sure how this would work with the AST stuff (I don't really have any experience of that), so I'm sure this proposal will require more thought and refinement. But hopefully, you get what I'm after.
The text was updated successfully, but these errors were encountered:
I've been reading the Terazzo plugin API docs to figure out how to migrate some custom Cobalt plugins I made for our design system at work, Most of my plugins pre-process the design token data before it gets handed to a "normal" plugin to be output as CSS, JS, or whatever.
With Cobalt I used a hacky approach where you can pass one plugin into the config of my plugin. My plugin manipulates the parsed token data in some way and then runs the plugin specified in the config with that modfied token data. I suspect Cobalt's plugin API wasn't intended to be (ab)used in that way, but it worked :-)
I don't think Terrazo's new 2-step proces would let me do that. What I'm after isn't a
transform()
step to generate values to later be output. I want to modfiy thetokens
data before it gets passed intotransform()
.Maybe there could be a
preProcess()
hook or something like that? It could take the same read-onlytokens
data and return a newtokens
data that replaces it and is used later on.Not quite sure how this would work with the AST stuff (I don't really have any experience of that), so I'm sure this proposal will require more thought and refinement. But hopefully, you get what I'm after.
The text was updated successfully, but these errors were encountered: