[FR] User defined properties (user_data) to be used inside custom styles #1113
marcuscps
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been wondering if it is possible to use card configurations inside custom styles.
I've been using Bubble Card with Decluttering-Card quite a bit. One common use case is to create a reusable Timer Card with Round Progress Bar template based on the example #937, then instantiate it several times across the UI.
Sometimes I want to remove the
Finish
sub button, though. The only way to do it AFAIK is to create another template without such sub button, leaving the original untouched (to preserve its use cases).It made me wonder if we could make Bubble Card even more flexible by introducing a
user_data
card property that would be made available as a template variable (and as a consequence when processing the custom styles).This way one could do something like this (omitting most of the css from the example mentioned for conciseness):
It could be used like this:
Where the first one would never show the Finish sub button, but the second would.
This creates a bridge for providing declarative configurations that can be used for component customisation in the imperative part of the component. This would make it incredibly flexible while promoting code reuse.
I'm not sure the
user_data
syntax would work this way, but I'm sure something similar can be achieved.Opinions?
Beta Was this translation helpful? Give feedback.
All reactions