See the following example:
.child1 {
font-weight: bold;
font: 48pt Tahoma;
}
.child2 {
font: 48pt Tahoma;
font-weight: bold;
}
in HTML:
a node styled with child1 is 'Regular' 48pt Tahoma
a node styled with child2 is 'Bold' 48pt Tahoma
In JFX this case works opposite
.child1 {
-fx-font-weight: bold;
-fx-font: 48pt 'Tahoma';
}
.child2 {
-fx-font: 48pt 'Tahoma';
-fx-font-weight: bold;
}
a node styled with child1 is 'Bold' 48pt Tahoma
a node styled with child2 is 'Regular' 48pt Tahoma
I believe the way this works:
a) font: 48pt Tahoma; expands to
font-style: normal;
font-variant: normal;
font-weight: normal;
font-size: 48pt;
font-family: Tahoma;
Replacing this in the first intance of child1 we have:
.child1 {
font-weight: bold;
font-style: normal;
font-variant: normal;
font-weight: normal;
font-size: 48pt;
font-family: Tahoma;
}
b) the last attribute set in the class definition overrides the rest
thus, HTML is right (tested on chrome and firefox), JFX is wrong
.child1 {
font-weight: bold;
font: 48pt Tahoma;
}
.child2 {
font: 48pt Tahoma;
font-weight: bold;
}
in HTML:
a node styled with child1 is 'Regular' 48pt Tahoma
a node styled with child2 is 'Bold' 48pt Tahoma
In JFX this case works opposite
.child1 {
-fx-font-weight: bold;
-fx-font: 48pt 'Tahoma';
}
.child2 {
-fx-font: 48pt 'Tahoma';
-fx-font-weight: bold;
}
a node styled with child1 is 'Bold' 48pt Tahoma
a node styled with child2 is 'Regular' 48pt Tahoma
I believe the way this works:
a) font: 48pt Tahoma; expands to
font-style: normal;
font-variant: normal;
font-weight: normal;
font-size: 48pt;
font-family: Tahoma;
Replacing this in the first intance of child1 we have:
.child1 {
font-weight: bold;
font-style: normal;
font-variant: normal;
font-weight: normal;
font-size: 48pt;
font-family: Tahoma;
}
b) the last attribute set in the class definition overrides the rest
thus, HTML is right (tested on chrome and firefox), JFX is wrong