-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Add style property to oh-card #1801
Conversation
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
Job #869: Bundle Size — 15.66MiB (-3.49%).Metrics (4 changes)
Total size by type (4 changes)
|
That would be a cool addition in general. Instead of adding the property to all card widgets, maybe it's time to do a refactoring I wanted to do for a while: There is currently no generic Lastly a component: f7-card
config:
style: {} # Card style
class: [] # Card classes
slots:
default:
- component: f7-card-header
config:
style: {} # Header style
class: [] # Header classes
slots:
default:
- component: oh-button
config:
text: Header
- component: f7-card-content
config:
style: {} # Content style
class: [] # Content classes
slots:
default:
- component: oh-button
config:
text: Content
- component: f7-card-footer
config:
style: {} # Footer style
class: [] # Footer classes
slots:
default:
- component: oh-button
config:
text: Footer would become: component: oh-card
style:
style: {} # Card style
class: [] # Card classes
headerStyle: {} # Header style
headerClass: [] # Header classes
contentStyle: {} # Content style
contentClass: [] # Content classes
footerStyle: {} # Footer style
footerClass: [] # Footer classes
slots:
header:
- component: oh-button
config:
text: Header
content:
- component: oh-button
config:
text: Content
footer:
- component: oh-button
config:
text: Footer If the |
Thanks for the feedback, Yannick. Just from your experience: do you think as a first guess that it would be possible without breaking the current widgets that are used by openHAB users? |
With the experience from my oh-knob refactoring (#1718) I would think that this refactoring of oh-card widgets from f7-card to an oh-card should be possible without introducing breaking changes. |
Yes, I agree. |
picked up and superseded by #2781 provided by @florian-h05 🎉 |
Supersedes #1801. Implements the proposal from #1801 (comment). ----- Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
This adds the style property to an oh-card widget.
The PR is not yet done and is meant to be as proposal to get feedback if this is actually wanted and done the right way.
It adds the style attribute to a card which is currently only also added to the rollershutter card as an example (all other cards would not to be adapted as well). This would allow for example to add a background image to any card which was my original intention. I could have added a background-image property like it is available on the oh-label-card but then I thought I would rather add a general style property which would be more versatile.
I also added a button-style to the rollershutter card itself that would allow additional styling to the buttons (also up to discussion).
in case the property "style" would "collide" with other components "style"-property, we could call this cardStyle instead or something else.
I have seen that people have asked for this now and then but maybe there was a reason not to add it intentionally from the start.
So, let me know what you think