invent-framework / invent

Express yourself with code.
https://invent-framework.github.io/
Apache License 2.0
107 stars 12 forks source link

Refine style attribute on components #73

Open ntoll opened 3 weeks ago

ntoll commented 3 weeks ago

Styling is provided by themes. However, we need to provide an "escape hatch" for experienced developers who want more flexibility on styling components. Hence the need for (and refinement of) a style attribute on Component subclasses. In its simplest form, style could just be raw CSS attached to the component via the HTML style attribute.

ntoll commented 2 weeks ago

Do we have a style collection for each widget? If so, what are they for each widget. Ask Toga..!

Examples include platform agnostic ways to define (as appropriate for each different widget):

mhsmith commented 1 week ago

Toga doesn't explicitly list which styles are appropriate to which widget – irrelevant styles are simply ignored. But the Invent builder would need such a list.

The applicable styles depend not only on the class of the widget, but also on the widget's parent. For example, every Invent Component currently has a row_span and column_span, but they have no effect unless the Component is inside a Grid.

So here's what I'm thinking of:

Advantages of this approach:

ntoll commented 1 week ago

@mhsmith Thank you for this... it all makes sense to me..! :slightly_smiling_face:

Happy to pair on this with you at a time of your convenience. :+1:

mhsmith commented 1 week ago

How about during the Honkathon on Thursday, unless you already have something planned for that?

ntoll commented 1 week ago

Sounds like a plan! Looking forward to it. We can also explain the work we've been doing on tasks (i.e. the simple abstraction in Invent for asynchronous / non-blocking activity).