While grid is awesome, that codepen example is not fallowing a truly a masonry style, it should be more like Pinterest where you don't know how tall are the items beneath them cover the free space that shorter ones leave. With grid creating rows it will leave spaces or you have to stretch the items to the same height. Just different styles, I think the masonry flex solution from Tobias will work great for a feed or waterfall of content.
While grid is awesome, that codepen example is not fallowing a truly a masonry style, it should be more like Pinterest where you don't know how tall are the items beneath them cover the free space that shorter ones leave. With grid creating rows it will leave spaces or you have to stretch the items to the same height. Just different styles, I think the masonry flex solution from Tobias will work great for a feed or waterfall of content.