do you think that would be a good enhancement?
# tornadofx
c
do you think that would be a good enhancement?
r
By "that", do you mean changing JavaFX to support structural pseudo-classes? If so, I personally don't think so, but that may have more to do with my style than anything.
c
no, enhancing CSSSelectors so that you can do styleclass.child(3) for the 3rd child
r
How would that work?
JavaFX has no support for structural pseudo-classes, so there's no way we could have
styleclass.child(3)
render to anything meaningful.
c
thinking more of a css preprocessor
r
I'm still not following...
c
apply a generated style for example
run a tornadofx preprocess on the style objects and add new objects based on these extension functions
something like vbox { nthChild(3) { background = RED results in a new style object to be applied to the vbox's child
w. a listener for changes to vbox
r
Ah, I see, though I don't think it would work. If I add a new
.vbox
on the fly, there's no way the processor could know about it.
The CSS DSL just generates CSS text, it ultimately has nothing to do with the running application itself.
(Much like Sass, Less, or any CSS preprocessor, you should treat it as statically compiled AoT. By the time the app sees it, it's just plain CSS.)
c
optional AOP on the builder?
which results in an aspect putting the builder's object through the preprocessor
r
That seems extremely fragile, and would pretty much break interop with any JavaFX libraries (or at the very least not work with them).