Earlier I thought websites used to put a GIF in such loaders, but that is not a responsive solution. Digging into the page code, here is how it's done on Hashnode:
https://codepen.io/sidhantpanda/pen/VpXdKW
Hashnode surely inspires great design in all of us :)