So, when we designed the Workflow Builder and our underlying component library overflow on top of which it is built, we decided to take this zero-styling approach and tackle some of these problems. So, let me talk to you about what is this approach. So, first of all, it starts with the design, with the design team. We do our designs in Figma. I'm sure many of you are familiar with it. And yeah, the approach we've took is from the start. When designing the components, the designers are not using any values directly. Everything is built on top of set of primitives and numerals that are created to store the actual values and then the values for styles in the components are actually created using tokens that reference those numerals and primitives. It is important to keep everything in this library in that way but it will help us at the later stage.
The next step, I think the most important one, is the automation. So, with Figma, with two plugins like Token Exporter, you can export those tokens and styles and create a simple JSON files out of them. We have an automated script that can turn this into the actual CSS bundle that is being used in the project. So, with a proper setup like on GitHub pipeline, we can make this completely automatic and actually to generate new styles, a designer can do it, right? To get the CSS bundle and get it into the code. It's not even needed for developers' work there. And yeah, then the final step, of course, in the code. When you implement the components instead of writing the CSS, you're referencing those CSS variables from the bundle generated. So, yeah. One important thing to add here is that the, in our components library, the styles import is completely separate from the build of the application so it's entirely possible to, you know, just replace the CSS bundle and restyling the same version of the components.
So, to sum this up, this zero styling has three steps. First one is using the design tokens of the design phase. Another one is creating this automation that enables the designers to actually generate the CSS and update it into the code. And of course, when implementing, we always use those CSS variables. So, what does it allow us to do? Well, it makes ease of, it makes changes of styling in the app much easier, especially for cases like we have where, you know, very often it's no logic changes but just making sure that the workflow builder setup is now following the company branding of the tool that's being used. No errors on style transferring, right? If it's all done by the design team and you reference the token, you can never misspell that one property or paste in the wrong number. And design team can do the changes without the dev team, which is really important.
Comments