Extending Pollen
Just as you can customise, extend, and overwrite the included modules in Pollen, you can also use Pollen to generate your own completely custom design system.
Custom modules
Every key in Pollen's modules
configuration is turned into a family of CSS variables. The module name becomes the variable prefix, and a property is generated for each key in the module object.
For example this configuration would generate a new group of variables as --typeset-*
Configuration logic
Since Pollen's configuration is just JavaScript, you can run any logic you need to generate your design system configuration as long as it's synchronous.
The above example could be simplified with a makeTypeset()
function like so
This can be especially powerful for things like generating opacities from HEX colours, value scales based on ratios, and more.
Last updated