Is there a way to see a kvision preview (like comp...
# kvision
y
Is there a way to see a kvision preview (like compose or something else)? I don't want to wait every time a project is compiling 😢
r
Haven't used compose, but how does it work without compilation?
I'm still using legacy backend for development and the compilation and hot reload is really fast.
y
Oh, forgot about hot reload, thanks. Compose has a plugin for Android Studio that renders `@Composable`s in a separate window without compilation of the entire project.
Sorry for troubling you, but wanted to ask, can I somehow change this presets' values?
r
Using one of this enum values with for instance
addBsBgColor()
extension function just adds the
className
to list of css classes of the component. You can always do the same manually with
addCssClass()
method or
classes/className
constructor parameters.
Copy code
addCssClass("bg-somethingelse")
Is any value missing in the enum class?
If you have custom bootstrap css with background gradients (https://getbootstrap.com/docs/4.6/utilities/colors/#background-gradient) you can use the direct approach:
Copy code
addCssClass("bg-gradient-secondary")
👍 1
Back to your preview question - I think technically it could be possible to achieve live preview with an IDE plugin (probably with some conventions about creating KVision components, maybe also with some kind of annotation). But it would definitely require background compilation, so I'm not sure it would be much faster than standard webpack hot reload (perhaps for very large projects it would give noticeable benefits). It's for sure a nice feature request 🙂 but I'm not good enough with IntelliJ plugins to take on such task 🙂 But contributions are welcomed!
👍 1