Dynamic Opacity in Component Style > Background with JS

there may already be a topic for this, but nothing came up as i tried a few titles in the draft.

so basically in modules, abstraction is kinda the whole point. but sometimes it limits flexibility, so i want to pass module inputs like backgroundColor and backgroundOpacity for example when the module contains a container itself but is placed inside another container during implementation by an app. if it's inside nothing else but canvas, however, i'd prefer it take the style of the parent background.

and not having to publish a new release after editing the module :slight_smile:

image

i'd imagine this would apply more generally too; modules could have some new behavior about how to inherit component settings without requiring they be piped through module inputs as variables per se. /shrug

3 Likes

If it helps you can pass background color in rgba format so you can provide opacity without changing the percentage.

i.e. rgba(60, 179, 113, 0.5)

awesome thanks stefan!

Thanks @stefancvrkotic!

And thanks for the detailed examples + feedback, @trz-justin-dev