Until masonry is implemented as part of the Level 3 CSS Grid Layout spec, you still need to use JavaScript to achieve the Pinterest-style Masonry layout. CSS Grid will get you part of the way there but it can’t handle bumping up tiles to fill gaps left by short tiles. I have been looking for a JavaScript library to handle this. Here are some of the candidates I’ve found:
Here is a good CSS-Tricks article on the subject: https://css-tricks.com/piecing-together-approaches-for-a-css-masonry-layout/