For example I have a grid where I let the user define the colors for certain data using Vaadin 8 and I'd like to offer this in Vaadin 14 / Flow as well.
In Vaadin 8 I did (for each style/data type):
Page.getCurrent().getStyles()
.add(".MyCustomTheme .v-grid-cell." + cssName + " { background-color:" + userSelectedColor + "; }");
then in the grid code I would do:
addColumn(myColumn).setStyleGenerator(cssName);
In Vaadin 14 / Flow I have:
addColumn(myColumn).setClassNameGenerator(cssName);
However I can't seem to figure out how to programmatically change the css values for cssName. In essence how do I do the first part where I inject my css in the Java code?
Just to add I couldn't do anything as shown here at: https://vaadin.com/docs/v14/flow/element-api/tutorial-dynamic-styling When I tried to do grid.getElement().getStyle().set(...) this would apply to the whole table rather than the rows.