Make theme colors accessible in a transformer / query

Hello, we would like to access the theme colors for the Background Color property of table columns.

How can we retrieve the theme in JS code, for example like this to get the Text color ?

{{ theme.colors.text }}
1 Like

I would also like to do this. Is there any way?

The theme settings aren't currently exposed inside of the retool app model unfortunately, but I'll move this over to a feature request and we can explore adding programmatic access in the future :grin:

For pulling app theme values in the app model, we've now added a themes global value that contains the App level theme. The theme.surfacePrimary would be the default background color for the table component's Background setting if it isn't overridden.

If a component has individual theme overrides configured, it will have a property that is an object containing the values in rgba strings:

1 Like

@alex-w That's a great news thanks !