Is it possible to add classes and props as object? #561
-
It starts to get really messy if If i add a lot of classes and props, can i provide them as object somehow so i can indent them freely? with ui.column()
.classes("w-full h-full")
.props("blah blah"): |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Mar 19, 2023
Replies: 1 comment
-
There are a couple of ways to do this:
Apart from that we are already working on an improved Tailwind API (#362). This will allow you keep the Tailwind style definition in an object and apply it to different objects, like: style = Tailwind().width('full').height('full')
with ui.column() as column:
...
style.apply(column) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
falkoschindler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are a couple of ways to do this:
Use Python's line continuation
\
:Break the builder-pattern into multiple lines:
Keep the classes and props in strings:
Apart from that we are already working on an improved Tailwind API (#362). This will allow you keep the Tailwind style definition in an object and apply it to different objects, like: