Skip to Main Content
Builder.io Ideas
Categories Visual Editor
Created by Adrian Mouly
Created on Jul 18, 2023

Ability to setup colors from Application code

Would be nice to have a way to setup colors to be used in Builder Editor, from the application code.


Like we register Custom Components to be used, we should be able to setup Custom Colors in the same way.


This would enforce usage of pre-defined colors, ideally from a well-defined Design-System. Also this goes in hand with "components only" mode.


Ideally I want to consume the colors from my stylesheet file, where I have a bunch of css-variables which are consumed by all my custom-components.


Impact:

  • In the Builder Editor, the editor should not be able to "edit swatches", and should have a pre-populated list of colors to pick from.

  • The name of the color should be displayed next to the preview, due design-systems have a well defined name for each color.

  • The Builder SDK should have a method like registerColor, where it can accept strings, and other TS types. It must work with css-variables (like --color_blue-900: rgba(0, 16, 41, 100%).


  • Attach files