I am following this Masonry & Bootstrap example.
And it works well until I am trying to use a custom Font. Then if the final boxes size is different with the custom Font that without it, the distribution of the boxes is not calculated properly.
Looks like Masonry code is executed before the font is loaded, it makes the calculations but then the font is loaded and the boxes sizes changes.
Here there is a working codepen example:
I am adding this:
<style>
/* Importing the fonts */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');
body {
font-family: 'Libre Baskerville', serif;
}
</style>
Try to reload without cache (cmd + shift + R (in Mac Chrome)).
Right distribution (second load):
How is the proper way to handle this?