JavaFX-CSS: How to “move” style of parent to a child?
问题 The trigger for this was a quick experiment to solve TreeItem selection width: the requirement is to highlight only the text, not the whole tree cell. Nothing easier than that (said Frederik :) implement a custom TreeCell with a Label as graphic (and configure the label with the item as needed) remove the selection style (mostly the highlight background from the cell add the highlight style to the label Something like (a runnable example using this is at the end): public static class