Hello again all. Hope everyone is having a good da...
# tornadofx
s
Hello again all. Hope everyone is having a good day today! I'm getting into the styling of my application and have been messing around with the idea of a default "theme" that I would override when necessary rather than what I would normally do for a web application (which is to say, just add css classes to elements as I make them). I was wondering if anyone has made a theme (in the traditional javafx sense, I guess just something that encompasses all possible widgets) with the TornadoFX type-safe css builders, and if so if there is like, a template somewhere that I can use as a starting point? Or more broadly, maybe: what is the best practice for styling an application?
r
I'm not sure if such a thing has been done, and to be honest I'm not sure if it would be to pleasant to do with the current implementation of the CSS DSL. We've previously discussed a future rewrite of the CSS DSL taking that and some other ideas into account, but I don't believe anything has been done with it yet.
s
I was considering just taking an existing css theme for javafx and hand converting it to the kotlin css dsl format and using that with my application. It seems.. tedious, but it should work, no? I suppose also I could upload this somewhere to be used as a "default" css dsl theme template. Maybe it would be better to just use @addamsson’s approach and load a regular css file and then override as needed? Not sure!
a
I used the css way because the DSL was not handy for me, but I think it wouldn't hurt if you tried both ways and see which one is better for you?
n
Hey I started playing around with theming a while back but didn't work on it for a while because I have to many other things going on...https://github.com/nimakro/tornadofx-material maybe it can be an inspiration..and feel free to take send PRs😉
👍 2