Skip to content

Style your form with css

amischler edited this page Jun 29, 2011 · 13 revisions

FXForm supports two levels of styling:

  • A global style for all forms used in your application
  • A local style for each form

Global style

Classes

The default FXForm skin defines the following classes

Class name Applied to
form-label field labels
form-editor field editors
form-tooltip field tooltips
form-title the title of the form
form-content-box the form background
### Example
.form-label {
    -fx-font-size: 20;
}

.form-editor {
    -fx-font-size: 20;
}

.form-title {
    -fx-font-size: 20;
    -fx-text-fill: dimgray;
}

.form-tooltip {
    -fx-font-size: 11;
    -fx-text-fill: gray;
}

.form-content-box {
    -fx-background-color : linear (0%,0%) to (0%,20%) stops (0%, rgba(225,225,225,1)) (100%, white);
    -fx-background-radius : 5, 5, 5, 5;
    -fx-border-color: linear (0%,0%) to (0%,20%) stops (0%, dimgray) (100%, white);
    -fx-border-radius: 5;
}

Local style

Clone this wiki locally