I have a CSS grid, which looks like the following:
grid-template-columns: auto 1fr;
grid-template-rows: 2% 8% 1fr auto auto 2%;
grid-template-areas:
"sg-header sg-header"
"logo title"
"nav-bar content"
"nav-bar description"
"nav-bar extra-info"
"sg-bottom sg-bottom";
When I fill up the grid areas, everything works perfectly with texts. However I want to place an image in the first cell in the 2nd row ("logo" area). I want to keep its aspect ratio, and adjust its height to the row height. For this I'm using the following:
width: auto;
height: 100%;
The height adjusts perfectly to the row height and it keeps the aspect ratio too, however the column, which is auto doesn't adjust to the image width. If I replace the image with text, the column width will adjust to the text width, but for the image this just doesn't work.
What is more interesting that I've just noticed that this only occurs in Chrome (67.0.3396.87). In Firefox it is even worse, because in Firefox (52.9.0) for some reason the first column is as wide as the image before rescaling even though the image shrinks to to row height and keeps the aspect ratio, thus its display width is lower.