In tornadoFX I found one issue without any solutio...
# tornadofx
a
In tornadoFX I found one issue without any solution, if I want to design a window without FXML, I can't add a margin is there anyone managed to do that with the CSS file or tornadoFX style builders?
j
🤩 1
r
DSL
Copy code
root {
  padding = 1.em
}
CSS
Copy code
.root {
  -fx-padding: 1em;
}
a
@Ruckus This way you will end up adding inside-padding on a component like buttons
r
Yes, the padding will be added to whatever the root of the scene is. JavaFX doesn't have a distinction between padding and margins. "Margins" are just some form of padding on a parent.
If you have a button as the root, just wrap it in a
Pane
of some sort and pad the pane.
❤️ 1
Some components may add their own concept of a margin, but it's not a universal thing like in HTML.