Closed iboard closed 5 years ago
Thanks, I think this is a great addition!
My only thought is that it would be nice to pass the attributes through in a way that allows for them to be documented and validated similarly to the others, and based on the element specs here:
https://github.com/ndreynolds/ratatouille/blob/master/lib/ratatouille/renderer/element.ex#L27
I'm not sure how to do that with the tuple approach. What do you think about passing the attributes via the panel's attributes? E.g.:
panel title: "The Text", title_background: color(:white), title_color: color(:black)
Or allowing title
to be passed as a text
element, e.g.:
panel title: text(content: "The Text", background: color(:white), color: color(:black))
Yes, you're right. I'll try to solve it this way. I just figured out how the documentation is generated through the macros. Interesting ;-) When done I'll update this PR.
I couldn't figure out how panel title: title( content: "whatever" )
can work. So, I implemented the first way you mentioned
panel title: "Title", color: ..., background: ...
the two new arguments are documented with View.panel
Looks great, thank you very much!
I missed the possibility to highlight a panel's title.
With these changes, you can use
panel title: "Some Text"
as before or pass extra attributes which will be forwarded to thetext(...)
function for panel's title.