I am using a Grid and wish the cells to take up all the available space
Eventually I managed to get it working, the way I wanted by a combination of grid.addThemeVariants(GridVariant.LUMO_COMPACT, GridVariant.LUMO_COLUMN_BORDERS);
You can use css classes on either the grid or any other component (the view, the layout, whatever) in the dom above the grid and extend your css selector.
For instance setting
myView.addClassName("hello");
and apply it to your css
.hello vaadin-grid-cell-content {
...
}
But be careful to be not to general, otherwise other components might match those selectors, too. So you should/could make the selectors more specific depending on potential side effects.
And you should also check, if that !important is really needed, as this should always be the last resort.
and as expected, it is being applied only for this view.
Also, agree about the !important
I don’t even remember why I put it there, probably before I realised the GridVariant.LUMO_COMPACT is what I actually need.
I have removed it now.