I have this CSS style in my application:
.list-cell {
-fx-background-color: null;
-fx-font-size: 24px;
-fx-text-fill: linear-gradient( from 0.0% 0.0% to 0.0% 50.0%, reflect, rgba(255,0,0,0.28) 0.0, rgba(102,243,255,0.58) 50.0, rgba(179,179,179,0.45) 70.0, rgba(179,179,179,0.45) 100.0);
}
.list-cell:hover {
-fx-text-fill:linear-gradient( from 0.0% 0.0% to 100.0% 100.0%, reflect, rgb(255,255,255) 0.0, rgb(255,255,77) 100.0);
}
And I apply it to my program:
scene.getStylesheets().add(getClass().getResource("/com/root/tomaszm/Design.css").toExternalForm());
And I would like to use this style only for one ListView node not for any other. I have problem that new ComboBox inherit this style.
I know thats probably basic thing but Im not yet familiar with CSS, and just looking for quick fix...
EDIT:
@CHARSET "UTF-8";
#mainList .list-cell {
-fx-background-color: null;
-fx-font-size: 24px;
-fx-text-fill: linear-gradient( from 0.0% 0.0% to 0.0% 50.0%, reflect, rgba(255,0,0,0.28) 0.0, rgba(102,243,255,0.58) 50.0, rgba(179,179,179,0.45) 70.0, rgba(179,179,179,0.45) 100.0);
}
#mainList .list-cell:hover {
-fx-text-fill:linear-gradient( from 0.0% 0.0% to 100.0% 100.0%, reflect, rgb(255,255,255) 0.0, rgb(255,255,77) 100.0);
}
Application class
scene.getStylesheets().add(getClass().getResource("/com/root/tomaszm/Design.css").toExternalForm());
controller class
listView.getStyleClass().add("mainList");